#QUALITY by stefan
authorStefan Vogel <sv@exept.de>
Thu, 21 Jun 2018 14:51:38 +0200
changeset 23123 a120d0418bd7
parent 23122 eb0d57c1bf36
child 23124 d02eecc4b7b1
#QUALITY by stefan class: ProjectDefinition class removed: #forEachFileNameAndGeneratorMethodDo: changed: #forEachFileNameAndGeneratedContentsDo: #generateFile: Show warning if deoendencies are missing.
ProjectDefinition.st
--- a/ProjectDefinition.st	Thu Jun 21 14:50:40 2018 +0200
+++ b/ProjectDefinition.st	Thu Jun 21 14:51:38 2018 +0200
@@ -2897,7 +2897,6 @@
     "Created: / 23-01-2007 / 19:08:27 / cg"
 ! !
 
-
 !ProjectDefinition class methodsFor:'description - project information'!
 
 applicationAdditionalIconFileNames
@@ -3507,12 +3506,12 @@
     |pairs|
 
     pairs := OrderedCollection new.
-    self forEachFileNameAndGeneratorMethodDo:[:fileName :generator |
-        |file|
-
-        file := self perform:generator.
-        file notNil ifTrue:[
-            pairs add:(Array with:fileName with:file)
+    self fileNamesToGenerate keysDo:[:fileName |
+        |fileContents|
+
+        fileContents := self generateFile:fileName.
+        fileContents notNil ifTrue:[
+            pairs add:(Array with:fileName with:fileContents)
         ].
     ].
 
@@ -3523,17 +3522,26 @@
     "Modified (comment): / 04-12-2017 / 17:40:49 / cg"
 !
 
-forEachFileNameAndGeneratorMethodDo:aTwoArgBlock
-    "helper for build-support file generation; enumerates all build-support files"
-
-    self fileNamesToGenerate keysAndValuesDo:aTwoArgBlock
-
-    "Modified: / 14-09-2006 / 21:02:37 / cg"
-    "Modified (comment): / 04-12-2017 / 17:40:39 / cg"
-!
-
 generateFile:filename
-    |action|
+    |action missingNames|
+
+    (#('bc.mak' 'Make.proto' 'loadAll') includes:filename) ifTrue:[
+        "if there are missing classes in image, the dependencies cannot be computed.
+         Warn the user"
+
+        missingNames := self allClassNames "compiled_classNames"
+                                    select:[:aName |
+                                        |cls|
+
+                                        cls := environment at:aName asSymbol.
+                                        cls isNil
+                                    ].
+        missingNames notEmpty ifTrue:[
+            (self confirm:(self classResources stringWithCRs:'While generating %1:\Some classes from the list of compiled classes are missing in the image:\\%2\\If you continue, you have to fix dependencies for these classes in %1 manually!!\\Continue anyway?'
+                                        with:filename with:(missingNames asStringWith:', ')))
+            ifFalse:[^ nil].
+        ].
+    ].
 
     action := self basicFileNamesToGenerate at:filename ifAbsent:[].
     action notNil ifTrue:[
@@ -3545,9 +3553,6 @@
     (filename = 'loadAll') ifTrue:[
         ^ self generate_loadAll
     ].
-    (filename = 'osx/Info.plist') ifTrue:[
-        ^ self generate_osx_info_dot_plist
-    ].
     self error:('File "%1" not appropriate (not generated) for this type of project.' bindWith:filename)
 
     "Modified: / 24-02-2017 / 11:53:18 / cg"
@@ -4990,7 +4995,6 @@
     ^ self subProjectMakeCallsUsing:'call vcmake %1 %2'.
 ! !
 
-
 !ProjectDefinition class methodsFor:'file templates'!
 
 autopackage_default_dot_apspec