ApplicationDefinition.st
branchjv
changeset 18120 e3a375d5f6a8
parent 18115 26ac4840e5d0
parent 17578 21ce684d369f
child 18430 bd95f94284c8
--- a/ApplicationDefinition.st	Tue Feb 04 21:09:59 2014 +0100
+++ b/ApplicationDefinition.st	Wed Apr 01 10:20:10 2015 +0100
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 2006 by eXept Software AG
               All Rights Reserved
@@ -11,6 +13,8 @@
 "
 "{ Package: 'stx:libbasic' }"
 
+"{ NameSpace: Smalltalk }"
+
 ProjectDefinition subclass:#ApplicationDefinition
 	instanceVariableNames:''
 	classVariableNames:''
@@ -185,7 +189,11 @@
     |classes startClasses mainClasses appClasses|
 
     classes := self classNamesAndAttributes 
-                collect:[:nm | Smalltalk classNamed:nm] 
+                collect:[:nmOrPair | 
+                            |nm| 
+                            nm := nmOrPair isArray ifTrue:[nmOrPair first] ifFalse:[nmOrPair].
+                            Smalltalk classNamed:nm
+                        ] 
                 thenSelect:[:cls | cls notNil and:[cls isProjectDefinition not ]].
 
     mainClasses := classes select:[:each | each theMetaclass includesSelector:#main ].
@@ -434,7 +442,7 @@
 !
 
 includedInPreRequisites
-    "list packages which are to be explicitely included in the prerequisites list,
+    "list packages which are to be implicitely included in the prerequisites list,
      even if not found by the automatic search.
      Redefine this, if classes from other packages are referred to via reflection
      or by constructing names dynamically (i.e. the search cannot find it)"
@@ -1013,7 +1021,7 @@
             ].
             destination := contentsDir,'/',d,'/',relPath.
             (dirsMade includes:destination) ifFalse:[
-                s tab; nextPutLine:'@-mkdir ',destination.
+                s tab; nextPutLine:('@-mkdir "%1"' bindWith:destination).
                 dirsMade add:destination.
             ].
             s tab; nextPutLine:('-cp -r %1 "%2"' bindWith:sourcePattern with:destination).
@@ -1021,10 +1029,10 @@
 
     ^ String streamContents:[:s |
         s tab; nextPutLine:('@-rm -rf "%1"' bindWith:dmgDir).
-        s tab; nextPutLine:('@-mkdir "%1"' bindWith:dmgDir).
-        s tab; nextPutLine:('@-mkdir "%1"' bindWith:appDir).
-        s tab; nextPutLine:('@-mkdir "%1"' bindWith:contentsDir).
-        s tab; nextPutLine:('@-mkdir "%1"' bindWith:macOSDir).
+        s tab; nextPutLine:('@-mkdir "%1"' bindWith:dmgDir).  dirsMade add:dmgDir.
+        s tab; nextPutLine:('@-mkdir "%1"' bindWith:appDir).  dirsMade add:appDir.
+        s tab; nextPutLine:('@-mkdir "%1"' bindWith:contentsDir).  dirsMade add:contentsDir.
+        s tab; nextPutLine:('@-mkdir "%1"' bindWith:macOSDir).  dirsMade add:macOSDir.
         s tab; nextPutLine:('cp "',self applicationName,'" "',macOSDir,'/',product,'"').
         self commonFilesToInstall_unix do:[:eachPair | genLine value:s value:'MacOS' value:eachPair].
         self additionalFilesToInstall_unix do:[:eachPair | genLine value:s value:'MacOS' value:eachPair].
@@ -1175,7 +1183,7 @@
 
     d := Dictionary new.
     d
-        at: 'TOP' put: ( self pathToTop_win32 );
+        at: 'TOP' put: ( self pathToTopWithSeparator:'\' );
 
         at: 'APPLICATION' put: (self applicationName);
         at: 'APPLICATION_ICON' put: (self applicationInstallIconFileName);
@@ -1295,8 +1303,8 @@
 
     ^ Dictionary new
         at: 'FILE_NAME' put: (self libraryNameFor:aProjectID);  
-        at: 'MODULE_DIRECTORY' put: (self unixPathToPackage:aProjectID from:self package);     
-        at: 'BACK_DIRECTORY' put: (self unixPathToPackage:self package from:aProjectID);     
+        at: 'MODULE_DIRECTORY' put: (self pathToPackage:aProjectID from:self package withSeparator:'/');     
+        at: 'BACK_DIRECTORY' put: (self pathToPackage:self package from:aProjectID withSeparator:'/');     
         yourself
 !
 
@@ -1375,8 +1383,8 @@
 subProjectLine_make_dot_proto_mappings: aProjectID 
     ^ Dictionary new
         at: 'LIBRARY_NAME' put: (self libraryNameFor:aProjectID );     
-        at: 'PATH_TO_SUB_PROJECT' put: (self unixPathToPackage:aProjectID from:self package); 
-        at: 'PATH_TO_MYPROJECT' put: (self unixPathToPackage:self package from:aProjectID); 
+        at: 'PATH_TO_SUB_PROJECT' put: (self pathToPackage:aProjectID from:self package withSeparator:'/'); 
+        at: 'PATH_TO_MYPROJECT' put: (self pathToPackage:self package from:aProjectID withSeparator:'/'); 
         yourself
 
     "Modified: / 14-09-2006 / 18:59:26 / cg"
@@ -1501,7 +1509,7 @@
         self allPreRequisitesSorted do:[:projectID |
             |libobjPath libPath|
 
-            libPath := self pathToPackage_unix:projectID.
+            libPath := self pathToPackage:projectID withSeparator:'/'.
             libobjPath := libPath , '/', (self libraryNameFor:projectID).
             s space; nextPutAll: libobjPath; nextPutLine:'$(O_EXT) \'.
         ].
@@ -1593,7 +1601,7 @@
         self subProjects do:[:projectID | 
             |libPath libobjPath|
 
-            libPath := self pathToPackage_win32:projectID.
+            libPath := self pathToPackage:projectID withSeparator:'\'.
             libobjPath := libPath , '\', (self libraryNameFor:projectID).
             s space; nextPutAll:libobjPath; nextPutLine:'.dll \'.
         ].
@@ -1614,7 +1622,7 @@
         self effectiveSubProjects do:[:projectID | 
             |libPath libobjPath|
 
-            libPath := self pathToPackage_unix:projectID.
+            libPath := self pathToPackage:projectID withSeparator:'/'.
             libobjPath := libPath , '/', (self libraryNameFor:projectID).
             s space; nextPutAll:libobjPath; nextPutLine:'$(O_EXT) \'.
         ].
@@ -1758,7 +1766,9 @@
 %(ADDITIONAL_DEFINITIONS)
 
 #
+APPNAME=%(LIBRARY_NAME)
 LIBNAME=dummy
+MODULE_PATH=%(MODULE_PATH)
 STCOPT="+optinline"
 LOCALINCLUDES=%(LOCAL_INCLUDES)
 LOCALDEFINES=%(LOCAL_DEFINES)
@@ -1796,7 +1806,7 @@
 # all, but no prereqs
 ALL_NP:: exe $(REQUIRED_SUPPORT_DIRS) postBuildCleanup setup
 
-exe:  newBuildDate $(REQUIRED_LIBS) noConsoleApp consoleApp
+exe:  newBuildDate $(REQUIRED_LIBS) noConsoleApp consoleApp registerApplication
 
 # the executable only
 # with console
@@ -2329,6 +2339,7 @@
 
 DELIVERBINARIES=
 
+APPNAME=%(LIBRARY_NAME)
 LIBNAME=%(LIBRARY_NAME)
 STCLOCALOPT=''-package=$(PACKAGE)'' -I. -headerDir=. $(LOCALINCLUDES) $(STCLOCALOPTIMIZATIONS) $(STCWARNINGS) $(LOCALDEFINES) %(HEADEROUTPUTARG) %(COMMONSYMFLAG) -varPrefix=$(LIBNAME)
 
@@ -2368,7 +2379,7 @@
 # like ALL, but not prereqs
 ALL_NP:: exe $(SUBPROJECT_LIBS) $(REQUIRED_SUPPORT_DIRS) $(SETUP_RULE)
 
-exe:    %(APPLICATION) 
+exe:    %(APPLICATION) registerApplication
 
 %(APPLICATION): $(APP_DIRS_TO_MAKE) $(APP_LIBOBJS) $(REQUIRED_LIBOBJS) $(OBJS)
         $(MAKE) link_%(APPLICATION)
@@ -2420,7 +2431,9 @@
         -rm "%(PRODUCT_NAME).dmg"
         hdiutil create -fs HFSX -layout SPUD "%(PRODUCT_NAME).dmg" -srcfolder "%(PRODUCT_NAME)_dmg" -format UDZO -volname "%(PRODUCT_NAME)" -quiet
 
-"%(PRODUCT_NAME)_dmg":
+app: "%(PRODUCT_NAME)_dmg"
+
+"%(PRODUCT_NAME)_dmg": $(SUBPROJECT_LIBS) $(REQUIRED_SUPPORT_DIRS) 
 %(DMG_IMAGE_SETUP)
 
 SOURCEFILES: %(APPLICATION)_SOURCES \
@@ -2836,7 +2849,7 @@
   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
 SectionEnd
 
-LangString appOpen ${LANG_GERMAN}  "Mit %(PRODUCT_NAME) öffnen"
+LangString appOpen ${LANG_GERMAN}  "Mit %(PRODUCT_NAME) öffnen"
 LangString appOpen ${LANG_ENGLISH} "Open with %(PRODUCT_NAME)"
 
 LangString DESC_Section1 ${LANG_ENGLISH} "Program components of %(PRODUCT_NAME)"
@@ -2870,7 +2883,7 @@
 
 Function un.onInit
 !!insertmacro MUI_UNGETLANGUAGE
-  MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Möchten Sie %(PRODUCT_NAME) und alle seine Komponenten deinstallieren?" IDYES +2
+  MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Möchten Sie %(PRODUCT_NAME) und alle seine Komponenten deinstallieren?" IDYES +2
   Abort
 FunctionEnd
 
@@ -3046,6 +3059,22 @@
 
 !ApplicationDefinition class methodsFor:'queries'!
 
+definitionClassOfApplicationBundle
+    "Return the applicationDefinition of the applicationBundle or nil. 
+     This is the applicationDefinition of the package which gets actually deployed.
+     This information is currently used for automatic check of language translations.
+     Here, ssume that I am the bundle.
+     Redefine in other applications if that is not true."
+
+    ^ self
+
+    "
+     exept_expecco definitionClassOfApplicationBundle    
+     exept_expecco_application definitionClassOfApplicationBundle    
+     exept_expecco_plugin_swt definitionClassOfApplicationBundle    
+    "
+!
+
 projectType
     ^ self isGUIApplication
         ifTrue:[ GUIApplicationType  ]
@@ -3114,16 +3143,11 @@
 !ApplicationDefinition class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ApplicationDefinition.st,v 1.253 2013-12-17 20:57:10 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ApplicationDefinition.st,v 1.265 2015-03-02 16:07:03 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/ApplicationDefinition.st,v 1.253 2013-12-17 20:57:10 stefan Exp $'
-!
-
-version_HG
-
-    ^ '$Changeset: <not expanded> $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ApplicationDefinition.st,v 1.265 2015-03-02 16:07:03 cg Exp $'
 !
 
 version_SVN