preparations for source code delivery option
authorClaus Gittinger <cg@exept.de>
Wed, 16 May 2007 20:35:04 +0200
changeset 10547 af59f1ae6f0b
parent 10546 0b4c5dc2ecd3
child 10548 8a3fdcd87fd9
preparations for source code delivery option
ApplicationDefinition.st
--- a/ApplicationDefinition.st	Wed May 16 13:24:04 2007 +0200
+++ b/ApplicationDefinition.st	Wed May 16 20:35:04 2007 +0200
@@ -446,6 +446,22 @@
     ^ (self applicationNameNoConsole , '.log')
 !
 
+offerApplicationSourceCode
+    "Return true, if the source code of the application should be offered as install option"
+
+    ^ false
+
+    "Created: / 15-05-2007 / 16:46:05 / cg"
+!
+
+offerSmalltalkSourceCode
+    "Return true, if the source code of the smalltalk base system should be offered as install option"
+
+    ^ false
+
+    "Created: / 15-05-2007 / 16:46:18 / cg"
+!
+
 startupClassName
     "The name of the class which provides the entry point for the application."
 
@@ -721,6 +737,9 @@
 %(RESOURCE_RULES)
 %(STX_RESOURCE_RULES)
 
+%(APP_SOURCE_RULES)
+%(STX_SOURCE_RULES)
+
 %(PREREQUISITES_LIBS)      
 %(SUBPROJECTS_LIBS)
 
@@ -804,7 +823,51 @@
 # ENDMAKEDEPEND --- do not remove this line
 '.
 
-    "Modified: / 01-03-2007 / 18:07:05 / cg"
+    "Modified: / 15-05-2007 / 17:26:57 / cg"
+!
+
+bc_dot_mak_app_source_rules
+    |p|
+
+    ^ String streamContents:[:s |
+        s nextPutAll:'
+%(APPLICATION)_SOURCES: sources\%(MODULE)\%(MODULE_PATH)\NUL
+        -copy ..\*.st sources\%(MODULE)\%(MODULE_PATH)\..\*.*
+
+sources\%(MODULE)\%(MODULE_PATH)\NUL: sources\%(MODULE)\NUL
+        mkdir sources\%(MODULE)\%(MODULE_PATH)
+
+sources\NUL: 
+        mkdir sources
+'.
+
+        p := self moduleDirectory_win32 asCollectionOfSubstringsSeparatedBy:$\.
+        p size to:2 by:-1 do:[:len |
+            |part2 part1|
+
+            part2 := (p copyTo:len) asStringWith:$\.
+            part1 := (p copyTo:len-1) asStringWith:$\.
+            s nextPutAll:'
+sources\%(MODULE)\',part2,'\NUL: sources\%(MODULE)\',part1,'\NUL
+        mkdir sources\%(MODULE)\',part2,'
+'.
+        ].
+
+        s nextPutAll:'
+sources\%(MODULE)\',p first,'\NUL: sources\%(MODULE)\NUL
+        mkdir sources\%(MODULE)\',p first,'
+'.
+
+        "/ be careful to not include two rules for it (-> stx_source_rules).
+        self module ~= 'stx' ifTrue:[
+            s nextPutAll:
+'sources\%(MODULE)\NUL: sources\NUL
+        mkdir sources\%(MODULE)
+'.
+        ].
+    ]
+
+    "Created: / 15-05-2007 / 17:27:37 / cg"
 !
 
 bc_dot_mak_resource_rules
@@ -928,6 +991,44 @@
     "Created: / 20-09-2006 / 17:36:29 / cg"
 !
 
+bc_dot_mak_stx_source_rules
+    |libDirs p|
+
+    libDirs := #('libbasic' 'libbasic2' 'libcomp' 'libview' 'libview2'
+                 'libwidg' 'libwidg2' 'libtool' 'libtool2' 'libhtml' 'libui').
+
+    ^ String streamContents:[:s |
+        s nextPutAll:'
+STX_SOURCES: '.
+        libDirs do:[:libDir |
+            s nextPutAll:' '; nextPutAll:('sources\stx\',libDir,'\NUL')
+        ].
+        s cr.
+
+        libDirs do:[:libDir |
+            s nextPutLine:('sources\stx\',libDir,'\NUL: sources\stx\NUL
+        mkdir sources\stx\',libDir).
+            s cr.
+        ].
+
+        s nextPutAll:'
+sources\NUL: 
+        mkdir sources
+
+STX_SOURCES: sources\stx\NUL
+        -copy ..\*.st sources\%(MODULE)\%(MODULE_PATH)\..\*.*
+
+sources\%(MODULE)\%(MODULE_PATH)\NUL: sources\%(MODULE)\NUL
+        mkdir sources\%(MODULE)\%(MODULE_PATH)
+
+sources\NUL: 
+        mkdir sources
+'.
+    ]
+
+    "Created: / 15-05-2007 / 17:27:37 / cg"
+!
+
 buildDate_dot_h
     "the template code for the buildDate.h file"
 
@@ -1272,6 +1373,20 @@
 ;; ;  File /r /x CVS "..\reportGenerator\java" "..\reportGenerator\rules" "..\reportGenerator\*.xml" "..\reportGenerator\*.xslt" "..\reportGenerator\CloseApp.exe" "..\reportGenerator\eXpecco.jpg"
 ;; SectionEnd
 
+%(SEMI_IF_NO_STX_SOURCES)Section "Sources of the ST/X System" Section5
+%(SEMI_IF_NO_STX_SOURCES)  SectionIn 1
+%(SEMI_IF_NO_STX_SOURCES)  SetOutPath "$INSTDIR\source"
+%(SEMI_IF_NO_STX_SOURCES)  SetOverwrite ifnewer
+%(SEMI_IF_NO_STX_SOURCES)  File /r /x CVS "${STX_ROOT}\%(MODULE)\%(APPLICATION)\*.st"
+%(SEMI_IF_NO_STX_SOURCES)SectionEnd
+
+%(SEMI_IF_NO_APP_SOURCES)Section "Sources of the Base-System %(PRODUCT_NAME)" Section6
+%(SEMI_IF_NO_APP_SOURCES)  SectionIn 1
+%(SEMI_IF_NO_APP_SOURCES)  SetOutPath "$INSTDIR\source"
+%(SEMI_IF_NO_APP_SOURCES)  SetOverwrite ifnewer
+%(SEMI_IF_NO_APP_SOURCES)  File /r /x CVS "${STX_ROOT}\stx\*.st"
+%(SEMI_IF_NO_APP_SOURCES)SectionEnd
+
 Section -AdditionalIcons
   SetOutPath "$INSTDIR\bin"
   WriteIniStr "$INSTDIR\${PRODUCT_FILENAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
@@ -1302,6 +1417,10 @@
 ;; LangString DESC_Section3 ${LANG_GERMAN}  "Bibliotheken und Beispielprojekte"
 ;; LangString DESC_Section4 ${LANG_ENGLISH} "Logfile Printing and Report Generation"
 ;; LangString DESC_Section4 ${LANG_GERMAN}  "Drucken und Report-Generierung aus Log-Dateien"
+%(SEMI_IF_NO_STX_SOURCES) LangString DESC_Section5 ${LANG_ENGLISH} "Sources of ST/X (Base-System)"
+%(SEMI_IF_NO_STX_SOURCES) LangString DESC_Section5 ${LANG_GERMAN}  "Quellcode von ST/X (Basis-System)"
+%(SEMI_IF_NO_APP_SOURCES) LangString DESC_Section6 ${LANG_ENGLISH} "Sources of %(PRODUCT_NAME)"
+%(SEMI_IF_NO_APP_SOURCES) LangString DESC_Section6 ${LANG_GERMAN}  "Quellcode von %(PRODUCT_NAME)"
 
 
 !!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
@@ -1309,6 +1428,8 @@
 %(SEMI_IF_NO_DOC_EXISTS)  !!insertmacro MUI_DESCRIPTION_TEXT ${Section2} $(DESC_Section2)
 ;;  !!insertmacro MUI_DESCRIPTION_TEXT ${Section3} $(DESC_Section3)
 ;;  !!insertmacro MUI_DESCRIPTION_TEXT ${Section4} $(DESC_Section4)
+%(SEMI_IF_NO_STX_SOURCES)  !!insertmacro MUI_DESCRIPTION_TEXT ${Section5} $(DESC_Section5)
+%(SEMI_IF_NO_APP_SOURCES)  !!insertmacro MUI_DESCRIPTION_TEXT ${Section6} $(DESC_Section6)
 !!insertmacro MUI_FUNCTION_DESCRIPTION_END
 
 
@@ -1351,7 +1472,7 @@
 
     "Modified: / 09-08-2006 / 15:10:57 / fm"
     "Created: / 14-09-2006 / 21:09:18 / cg"
-    "Modified: / 01-03-2007 / 20:13:45 / cg"
+    "Modified: / 15-05-2007 / 17:22:37 / cg"
 !
 
 packageName_dot_rc
@@ -1491,9 +1612,21 @@
                                             in: self bc_dot_mak_stx_resource_rules);
         yourself
     ].
+    self offerSmalltalkSourceCode ifTrue:[
+        d 
+            at: 'STX_SOURCE_RULES' put: ( self replaceMappings: d 
+                                               in: self bc_dot_mak_stx_source_rules);
+        yourself
+    ].
+    self offerApplicationSourceCode ifTrue:[
+        d 
+            at: 'APP_SOURCE_RULES' put: ( self replaceMappings: d 
+                                               in: self bc_dot_mak_app_source_rules);
+        yourself
+    ].
     ^ d
 
-    "Modified: / 20-09-2006 / 17:37:57 / cg"
+    "Modified: / 15-05-2007 / 17:27:04 / cg"
 !
 
 buildDate_dot_h_mappings
@@ -1619,11 +1752,22 @@
         d  at:'SEMI_IF_ICON_EXISTS' put:';; '.
         d  at: #'ICONDEFINITION_LINE' put: 'IDR_MAINFRAME           ICON    DISCARDABLE     "',s,'"'
     ].
-    self docDirPath_win32 isNil ifTrue:[
+    s := self docDirPath_win32.
+    s isNil ifTrue:[
         d  at:'SEMI_IF_NO_DOC_EXISTS' put:';; '.
     ] ifFalse:[
         d  at:'SEMI_IF_NO_DOC_EXISTS' put:''.
     ].
+    self offerSmalltalkSourceCode ifTrue:[
+        d at:'SEMI_IF_NO_STX_SOURCES' put:''.
+    ] ifTrue:[
+        d at:'SEMI_IF_NO_STX_SOURCES' put:';; '.
+    ].
+    self offerApplicationSourceCode ifTrue:[
+        d at:'SEMI_IF_NO_APP_SOURCES' put:''.
+    ] ifTrue:[
+        d at:'SEMI_IF_NO_APP_SOURCES' put:';; '.
+    ].
 
     defLines := self fileExtensionDefinitionLines_dot_nsi:d.
     undefLines := self fileExtensionUndefinitionLines_dot_nsi:d.
@@ -1635,7 +1779,7 @@
     ^ d
 
     "Created: / 14-09-2006 / 21:08:44 / cg"
-    "Modified: / 01-03-2007 / 20:05:03 / cg"
+    "Modified: / 15-05-2007 / 17:24:27 / cg"
 !
 
 preRequisiteLine_bc_dot_mak_mappings: aProjectID 
@@ -1874,5 +2018,5 @@
 !ApplicationDefinition class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ApplicationDefinition.st,v 1.76 2007-04-11 10:30:51 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ApplicationDefinition.st,v 1.77 2007-05-16 18:35:04 cg Exp $'
 ! !