ProjectProblem.st
changeset 3198 74cd57db7717
parent 3171 cf50d68535e0
child 3200 ef12ced16ea9
--- a/ProjectProblem.st	Wed Apr 03 18:29:04 2013 +0200
+++ b/ProjectProblem.st	Wed Apr 03 20:38:43 2013 +0200
@@ -528,31 +528,31 @@
     "Created: / 26-07-2012 / 10:21:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!ProjectProblem::ClassProblem methodsFor:'fixing'!
+
+doUpdateAllProjectDefinitions
+    "full update the project definition class;
+     will do a rescan to add all missing items"
+
+    | def |
+
+    def := self packageDefinitionClass.
+    def isNil ifTrue:[ ^ false ].
+
+    def
+        updateMethodsCodeUsingCompiler:Compiler 
+        ignoreOldDefinition:false.
+
+    UserNotification notify: ('Project definitions updated. Do not forget to check in build support files!!').
+    ^true
+! !
+
 !ProjectProblem::InconsistentProjectDefinition methodsFor:'fixes'!
 
 fixes
 
     ^Array
-        with: (Array with: 'Regenerate specs in ProjectDefinitions' with: [ self regenerateProjectDefinition ])
-!
-
-regenerateProjectDefinition
-    |defClass|
-
-    defClass := self packageDefinitionClass.
-    Class packageQuerySignal
-        answer:defClass package
-        do:[
-            defClass theNonMetaclass
-                forEachContentsMethodsCodeToCompileDo:
-                    [:code :category |
-                        Compiler
-                            compile:code
-                            forClass:defClass theMetaclass
-                            inCategory:category.
-                    ]
-                ignoreOldDefinition:false
-        ].
+        with: (Array with: 'Full update of the project definitions (rescan)' with: [ self doUpdateAllProjectDefinitions ])
 ! !
 
 !ProjectProblem::ClassListedButDoesNotExist methodsFor:'accessing'!
@@ -674,8 +674,9 @@
 fixes
 
     ^Array
-	with: (Array with: 'Include in project' with: [ self doIncludeInProject ])
-	with: (Array with: 'Include in project as autoloaded' with: [ self doIncludeInProjectAsAutoloaded ])
+        with: (Array with: 'Include in project' with: [ self doIncludeInProject ])
+        with: (Array with: 'Include in project as autoloaded' with: [ self doIncludeInProjectAsAutoloaded ])
+        with: (Array with: 'Full update of the project definitions (rescan)' with: [ self doUpdateAllProjectDefinitions ])
 
     "Created: / 26-07-2012 / 10:41:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
@@ -1001,6 +1002,7 @@
     ^Array
         with: (Array with: 'Update project definition' with: [ self doUpdateExtensionMethodsInProject ])
         with: (Array with: 'Move to classes package' with: [ self doMoveToClassesPackage ])
+        with: (Array with: 'Full update of the project definitions (rescan)' with: [ self doUpdateAllProjectDefinitions ])
 ! !
 
 !ProjectProblem::ExtensionMethodsClassDoesNotExist methodsFor:'accessing-description'!
@@ -1454,16 +1456,17 @@
     "Return a (HTML) describing the problem."
 
     package = 'stx' ifTrue:[
-	^
+        ^
 'Move your code to another package.
-<br>The package named "stx" is reserveed for exept''s ST/X development.'
+<br>The package name "stx" is reserveed for exept''s ST/X development.'
     ].
 
     ^
 'A project definition class for package "%1" does not exist.
 <br>Project definition classes keep the meta information of a package,
 such as contents and build parameters.
-You <b>must</b> create it, otherwise package management won''t work.'
+You <b>must</b> create it, otherwise package management won''t work,
+and the package cannot be compiled to a binary dll.'
     bindWith: package
 
     "Modified: / 23-02-2012 / 13:29:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -1478,10 +1481,16 @@
 !ProjectProblem::ProjectDefinitionDoesNotExist methodsFor:'fixing'!
 
 doCreateAs:whatType
-    ProjectDefinition
-	definitionClassForPackage:package
-	projectType: whatType
-	createIfAbsent:true.
+    |prjDef|
+
+    prjDef := ProjectDefinition
+        definitionClassForPackage:package
+        projectType: whatType
+        createIfAbsent:true.
+
+    prjDef
+        updateMethodsCodeUsingCompiler:Compiler 
+        ignoreOldDefinition:true
 !
 
 doCreateAsGUIApplication
@@ -1508,11 +1517,11 @@
 !ProjectProblem class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic3/ProjectProblem.st,v 1.17 2013-03-30 21:02:36 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic3/ProjectProblem.st,v 1.18 2013-04-03 18:38:43 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic3/ProjectProblem.st,v 1.17 2013-03-30 21:02:36 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic3/ProjectProblem.st,v 1.18 2013-04-03 18:38:43 cg Exp $'
 !
 
 version_SVN