ProjectDefinition.st
changeset 13695 278e1b963c87
parent 13694 ff3118874df3
child 13696 814c2dc1a4f8
equal deleted inserted replaced
13694:ff3118874df3 13695:278e1b963c87
   227 
   227 
   228 allPreRequisites
   228 allPreRequisites
   229     "answer all (recursive) prerequisite project ids of myself - in random order."
   229     "answer all (recursive) prerequisite project ids of myself - in random order."
   230 
   230 
   231     ^ self allPreRequisitesWithParentDo:[:parent :prereq |
   231     ^ self allPreRequisitesWithParentDo:[:parent :prereq |
   232         prereq = self package ifTrue:[ Transcript showCR:('oops: %1 depends on itself' bindWith:prereq) ].
   232 	prereq = self package ifTrue:[ Transcript showCR:('oops: %1 depends on itself' bindWith:prereq) ].
   233       ]
   233       ]
   234 
   234 
   235     "
   235     "
   236      stx_libbasic allPreRequisites
   236      stx_libbasic allPreRequisites
   237      stx_libbasic2 allPreRequisites
   237      stx_libbasic2 allPreRequisites
   300     "Modified: / 28-06-2011 / 14:04:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   300     "Modified: / 28-06-2011 / 14:04:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   301 !
   301 !
   302 
   302 
   303 allPreRequisitesWithParentDo:aBlock
   303 allPreRequisitesWithParentDo:aBlock
   304     "answer all (recursive) prerequisite project ids of myself - in random order.
   304     "answer all (recursive) prerequisite project ids of myself - in random order.
   305      If we exclude a project, but one of our prerequisite projects depends on it, 
   305      If we exclude a project, but one of our prerequisite projects depends on it,
   306      then what ????"
   306      then what ????"
   307 
   307 
   308     |setOfAllPreRequisites toAdd|
   308     |setOfAllPreRequisites toAdd|
   309 
   309 
   310     setOfAllPreRequisites := Set new.
   310     setOfAllPreRequisites := Set new.
   316      so the following line has been deleted.
   316      so the following line has been deleted.
   317      Unfortunately the meaning of 'subproject' has never been well defined. SV."
   317      Unfortunately the meaning of 'subproject' has never been well defined. SV."
   318 "/    toAdd addAll:self effectiveSubProjects.
   318 "/    toAdd addAll:self effectiveSubProjects.
   319 
   319 
   320     [toAdd notEmpty] whileTrue:[
   320     [toAdd notEmpty] whileTrue:[
   321         |aPreRequisiteProjectID def|
   321 	|aPreRequisiteProjectID def|
   322 
   322 
   323         aPreRequisiteProjectID := toAdd removeFirst.
   323 	aPreRequisiteProjectID := toAdd removeFirst.
   324         (setOfAllPreRequisites includes:aPreRequisiteProjectID) ifFalse:[
   324 	(setOfAllPreRequisites includes:aPreRequisiteProjectID) ifFalse:[
   325             setOfAllPreRequisites add:aPreRequisiteProjectID.
   325 	    setOfAllPreRequisites add:aPreRequisiteProjectID.
   326 
   326 
   327             def := self definitionClassForPackage:aPreRequisiteProjectID.
   327 	    def := self definitionClassForPackage:aPreRequisiteProjectID.
   328             def isNil ifTrue:[
   328 	    def isNil ifTrue:[
   329                 Transcript showCR:'ProjectDefinition ', aPreRequisiteProjectID, ' is missing - cannot find its preRequisites.'.
   329 		Transcript showCR:'ProjectDefinition ', aPreRequisiteProjectID, ' is missing - cannot find its preRequisites.'.
   330             ] ifFalse:[
   330 	    ] ifFalse:[
   331                 def effectivePreRequisites
   331 		def effectivePreRequisites
   332                     select:[:eachSubPreRequisite | (setOfAllPreRequisites includes:eachSubPreRequisite) not]
   332 		    select:[:eachSubPreRequisite | (setOfAllPreRequisites includes:eachSubPreRequisite) not]
   333                     thenDo:[:eachSubPreRequisite |
   333 		    thenDo:[:eachSubPreRequisite |
   334                                 Transcript show:'ProjectDefinition preRequisites: '; showCR:(aPreRequisiteProjectID, ' requires ', eachSubPreRequisite).
   334 				Transcript show:'ProjectDefinition preRequisites: '; showCR:(aPreRequisiteProjectID, ' requires ', eachSubPreRequisite).
   335                                 aBlock value:def value:eachSubPreRequisite.
   335 				aBlock value:def value:eachSubPreRequisite.
   336                                 toAdd add:eachSubPreRequisite
   336 				toAdd add:eachSubPreRequisite
   337                            ].
   337 			   ].
   338 
   338 
   339                 "but subprojects of our prerequisites are also prerequisites"
   339 		"but subprojects of our prerequisites are also prerequisites"
   340                 def effectiveSubProjects
   340 		def effectiveSubProjects
   341                     select:[:eachSubSubRequisite | eachSubSubRequisite ~= self package and:[ (setOfAllPreRequisites includes:eachSubSubRequisite) not ]]
   341 		    select:[:eachSubSubRequisite | eachSubSubRequisite ~= self package and:[ (setOfAllPreRequisites includes:eachSubSubRequisite) not ]]
   342                     thenDo:[:eachSubSubRequisite |
   342 		    thenDo:[:eachSubSubRequisite |
   343                                 Transcript show:'ProjectDefinition preRequisites: '; showCR:(aPreRequisiteProjectID, ' hasSub ', eachSubSubRequisite).
   343 				Transcript show:'ProjectDefinition preRequisites: '; showCR:(aPreRequisiteProjectID, ' hasSub ', eachSubSubRequisite).
   344                                 aBlock value:def value:eachSubSubRequisite.
   344 				aBlock value:def value:eachSubSubRequisite.
   345                                 toAdd add:eachSubSubRequisite
   345 				toAdd add:eachSubSubRequisite
   346                            ].
   346 			   ].
   347             ].
   347 	    ].
   348         ]
   348 	]
   349     ].
   349     ].
   350     ^ setOfAllPreRequisites.
   350     ^ setOfAllPreRequisites.
   351 
   351 
   352     "
   352     "
   353      stx_libbasic allPreRequisites
   353      stx_libbasic allPreRequisites
  1111     "generate and return a testSuite containing all of my test-classes"
  1111     "generate and return a testSuite containing all of my test-classes"
  1112 
  1112 
  1113     |suite classes|
  1113     |suite classes|
  1114 
  1114 
  1115     suite := TestSuite named:self package.
  1115     suite := TestSuite named:self package.
  1116     classes := self classes 
  1116     classes := self classes
  1117                 select:[:each |
  1117 		select:[:each |
  1118                     each isLoaded ifFalse:[each autoload].
  1118 		    each isLoaded ifFalse:[each autoload].
  1119                     (each isTestCaseLike) and:[ each isAbstract not ] 
  1119 		    (each isTestCaseLike) and:[ each isAbstract not ]
  1120                 ].
  1120 		].
  1121 
  1121 
  1122     classes := classes asSortedCollection:[:a :b | a name <= b name ].
  1122     classes := classes asSortedCollection:[:a :b | a name <= b name ].
  1123     classes do: [:eachClass | 
  1123     classes do: [:eachClass |
  1124         | tests |
  1124 	| tests |
  1125 
  1125 
  1126         tests := eachClass suite tests.
  1126 	tests := eachClass suite tests.
  1127         tests := tests reject:[:test|self shouldExcludeTest: test].
  1127 	tests := tests reject:[:test|self shouldExcludeTest: test].
  1128         suite addTests: tests
  1128 	suite addTests: tests
  1129     ].
  1129     ].
  1130     ^ suite
  1130     ^ suite
  1131 
  1131 
  1132     "Created: / 01-04-2011 / 15:20:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1132     "Created: / 01-04-2011 / 15:20:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1133     "Modified: / 03-06-2011 / 17:07:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1133     "Modified: / 03-06-2011 / 17:07:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1151 
  1151 
  1152 initializeAllProjectDefinitions
  1152 initializeAllProjectDefinitions
  1153     "needs everything else (especially the compiler etc.) to be initialized.
  1153     "needs everything else (especially the compiler etc.) to be initialized.
  1154      Therefore, its not invoked by #initialize, but instead explicitely,
  1154      Therefore, its not invoked by #initialize, but instead explicitely,
  1155      by Smalltalk"
  1155      by Smalltalk"
  1156     
  1156 
  1157     |isStandAloneApp|
  1157     |isStandAloneApp|
  1158 
  1158 
  1159     isStandAloneApp := Smalltalk isStandAloneApp.
  1159     isStandAloneApp := Smalltalk isStandAloneApp.
  1160 
  1160 
  1161     self allSubclassesDo:[:eachProjectDefinitionClass |
  1161     self allSubclassesDo:[:eachProjectDefinitionClass |
  1162         eachProjectDefinitionClass isAbstract ifFalse:[
  1162 	eachProjectDefinitionClass isAbstract ifFalse:[
  1163             isStandAloneApp ifFalse:[
  1163 	    isStandAloneApp ifFalse:[
  1164                 eachProjectDefinitionClass installAutoloadedClasses.
  1164 		eachProjectDefinitionClass installAutoloadedClasses.
  1165             ].
  1165 	    ].
  1166             eachProjectDefinitionClass projectIsLoaded:true.
  1166 	    eachProjectDefinitionClass projectIsLoaded:true.
  1167         ]
  1167 	]
  1168     ].
  1168     ].
  1169 
  1169 
  1170     "
  1170     "
  1171      self initialize
  1171      self initialize
  1172     "
  1172     "
  1180     |classesToFixClassFileName|
  1180     |classesToFixClassFileName|
  1181 
  1181 
  1182     classesToFixClassFileName := OrderedCollection new.
  1182     classesToFixClassFileName := OrderedCollection new.
  1183 
  1183 
  1184     self autoloaded_classNames do:[:className |
  1184     self autoloaded_classNames do:[:className |
  1185         |cls|
  1185 	|cls|
  1186 
  1186 
  1187         "/ 'install as autoloaded: ' errorPrint. className errorPrintCR.
  1187 	"/ 'install as autoloaded: ' errorPrint. className errorPrintCR.
  1188         (cls := Smalltalk classNamed:className) isNil ifTrue:[
  1188 	(cls := Smalltalk classNamed:className) isNil ifTrue:[
  1189             Error handle:[:ex |
  1189 	    Error handle:[:ex |
  1190                 (self name,' [warning]: failed to install autoloaded: ',className) errorPrintCR.
  1190 		(self name,' [warning]: failed to install autoloaded: ',className) errorPrintCR.
  1191                 (self name,' [info]: reason: ',ex description) errorPrintCR.
  1191 		(self name,' [info]: reason: ',ex description) errorPrintCR.
  1192                 "/ thisContext fullPrintAll.
  1192 		"/ thisContext fullPrintAll.
  1193             ] do:[
  1193 	    ] do:[
  1194                 cls := Smalltalk
  1194 		cls := Smalltalk
  1195                     installAutoloadedClassNamed:className
  1195 		    installAutoloadedClassNamed:className
  1196                     category:'* as yet unknown category *'
  1196 		    category:'* as yet unknown category *'
  1197                     package:self package
  1197 		    package:self package
  1198                     revision:nil
  1198 		    revision:nil
  1199             ].
  1199 	    ].
  1200             cls notNil ifTrue:[
  1200 	    cls notNil ifTrue:[
  1201                 classesToFixClassFileName add:cls.
  1201 		classesToFixClassFileName add:cls.
  1202             ].
  1202 	    ].
  1203         ].
  1203 	].
  1204     ].
  1204     ].
  1205 
  1205 
  1206     Smalltalk addStartBlock:[
  1206     Smalltalk addStartBlock:[
  1207         |abbrevs|
  1207 	|abbrevs|
  1208 
  1208 
  1209         abbrevs := self abbrevs.
  1209 	abbrevs := self abbrevs.
  1210         "/ patch the classFileNames
  1210 	"/ patch the classFileNames
  1211         classesToFixClassFileName do:[:cls | 
  1211 	classesToFixClassFileName do:[:cls |
  1212             |entry classFilenameFromAbbreviations|
  1212 	    |entry classFilenameFromAbbreviations|
  1213 
  1213 
  1214             entry := abbrevs at:cls name ifAbsent:nil.
  1214 	    entry := abbrevs at:cls name ifAbsent:nil.
  1215             entry notNil ifTrue:[
  1215 	    entry notNil ifTrue:[
  1216                 classFilenameFromAbbreviations := entry fileName.
  1216 		classFilenameFromAbbreviations := entry fileName.
  1217                 classFilenameFromAbbreviations notNil ifTrue:[
  1217 		classFilenameFromAbbreviations notNil ifTrue:[
  1218                     classFilenameFromAbbreviations := classFilenameFromAbbreviations,'.st'.
  1218 		    classFilenameFromAbbreviations := classFilenameFromAbbreviations,'.st'.
  1219                     (classFilenameFromAbbreviations ~= cls getClassFilename) ifTrue:[
  1219 		    (classFilenameFromAbbreviations ~= cls getClassFilename) ifTrue:[
  1220                         cls setClassFilename:classFilenameFromAbbreviations
  1220 			cls setClassFilename:classFilenameFromAbbreviations
  1221                     ].
  1221 		    ].
  1222                 ].
  1222 		].
  1223             ]
  1223 	    ]
  1224         ].
  1224 	].
  1225 
  1225 
  1226         "/ patch the categories
  1226 	"/ patch the categories
  1227         Class withoutUpdatingChangesDo:[
  1227 	Class withoutUpdatingChangesDo:[
  1228             |entry|
  1228 	    |entry|
  1229 
  1229 
  1230             self classNames do:[:nm | 
  1230 	    self classNames do:[:nm |
  1231                 |cls|
  1231 		|cls|
  1232 
  1232 
  1233                 ((cls := Smalltalk at: nm) notNil 
  1233 		((cls := Smalltalk at: nm) notNil
  1234                         and:[ cls isLoaded not 
  1234 			and:[ cls isLoaded not
  1235                         and:[ (entry := abbrevs at:cls name ifAbsent:[nil]) notNil
  1235 			and:[ (entry := abbrevs at:cls name ifAbsent:[nil]) notNil
  1236                 ]]) ifTrue:[
  1236 		]]) ifTrue:[
  1237                     cls category: (entry category)
  1237 		    cls category: (entry category)
  1238                 ]
  1238 		]
  1239             ]
  1239 	    ]
  1240         ]
  1240 	]
  1241     ].
  1241     ].
  1242 
  1242 
  1243 
  1243 
  1244     "
  1244     "
  1245      stx_libbasic installAutoloadedClasses
  1245      stx_libbasic installAutoloadedClasses
  1315     oldSpec := self classNamesAndAttributesAsSpecArray.
  1315     oldSpec := self classNamesAndAttributesAsSpecArray.
  1316     ignored := self ignoredClassNames asSet.
  1316     ignored := self ignoredClassNames asSet.
  1317     newSpec := OrderedCollection new.
  1317     newSpec := OrderedCollection new.
  1318 
  1318 
  1319     ignoreOldEntries ifFalse:[
  1319     ignoreOldEntries ifFalse:[
  1320         oldSpec do:[:oldEntry |
  1320 	oldSpec do:[:oldEntry |
  1321             |newEntry className cls |
  1321 	    |newEntry className cls |
  1322 
  1322 
  1323             newEntry := oldEntry copy.
  1323 	    newEntry := oldEntry copy.
  1324             className := newEntry first.
  1324 	    className := newEntry first.
  1325 
  1325 
  1326             (ignored includes:className) ifFalse:[
  1326 	    (ignored includes:className) ifFalse:[
  1327                 cls := Smalltalk classNamed:className.
  1327 		cls := Smalltalk classNamed:className.
  1328                 ignoreOldDefinition ifTrue:[
  1328 		ignoreOldDefinition ifTrue:[
  1329                     (cls notNil and:[cls isLoaded not]) ifTrue:[
  1329 		    (cls notNil and:[cls isLoaded not]) ifTrue:[
  1330                         (newEntry includes:#autoload) ifFalse:[
  1330 			(newEntry includes:#autoload) ifFalse:[
  1331                             newEntry := newEntry copyWith:#autoload.
  1331 			    newEntry := newEntry copyWith:#autoload.
  1332                         ].
  1332 			].
  1333                     ].
  1333 		    ].
  1334                 ].
  1334 		].
  1335                 cls notNil ifTrue:[
  1335 		cls notNil ifTrue:[
  1336                     "JV @ 2010-06-19
  1336 		    "JV @ 2010-06-19
  1337                      Force merge default class attributes with existing ones"
  1337 		     Force merge default class attributes with existing ones"
  1338                     newEntry := self mergeDefaultClassAttributesFor: cls with: newEntry.
  1338 		    newEntry := self mergeDefaultClassAttributesFor: cls with: newEntry.
  1339                     newSpec add:newEntry.
  1339 		    newSpec add:newEntry.
  1340                 ]
  1340 		]
  1341             ].
  1341 	    ].
  1342         ].
  1342 	].
  1343     ].
  1343     ].
  1344 
  1344 
  1345     self searchForClasses do:[:eachClass |
  1345     self searchForClasses do:[:eachClass |
  1346         |className attributes oldSpecEntry oldAttributes newEntry|
  1346 	|className attributes oldSpecEntry oldAttributes newEntry|
  1347 
  1347 
  1348         className := eachClass name.
  1348 	className := eachClass name.
  1349         (ignored includes:className) ifFalse:[
  1349 	(ignored includes:className) ifFalse:[
  1350             oldSpecEntry := oldSpec detect:[:entry | entry first = className] ifNone:nil.
  1350 	    oldSpecEntry := oldSpec detect:[:entry | entry first = className] ifNone:nil.
  1351 
  1351 
  1352             (ignoreOldEntries or:[ oldSpecEntry isNil]) ifTrue:[
  1352 	    (ignoreOldEntries or:[ oldSpecEntry isNil]) ifTrue:[
  1353                 (eachClass isLoaded not or:[eachClass isPrivate not]) ifTrue:[
  1353 		(eachClass isLoaded not or:[eachClass isPrivate not]) ifTrue:[
  1354                     (self additionalClassNamesAndAttributes includes:className) ifFalse:[
  1354 		    (self additionalClassNamesAndAttributes includes:className) ifFalse:[
  1355                         (oldSpecEntry size > 1) ifTrue:[
  1355 			(oldSpecEntry size > 1) ifTrue:[
  1356                             oldAttributes := oldSpecEntry copyFrom:2.
  1356 			    oldAttributes := oldSpecEntry copyFrom:2.
  1357                         ].
  1357 			].
  1358 
  1358 
  1359                         ignoreOldDefinition ifTrue:[
  1359 			ignoreOldDefinition ifTrue:[
  1360                             "take autoload attribute from classes state in the image"
  1360 			    "take autoload attribute from classes state in the image"
  1361                             oldAttributes notNil ifTrue:[
  1361 			    oldAttributes notNil ifTrue:[
  1362                                 attributes := oldAttributes copyWithout:#autoload.
  1362 				attributes := oldAttributes copyWithout:#autoload.
  1363                             ] ifFalse:[
  1363 			    ] ifFalse:[
  1364                                 attributes := #()
  1364 				attributes := #()
  1365                             ].
  1365 			    ].
  1366                             eachClass isLoaded ifFalse:[
  1366 			    eachClass isLoaded ifFalse:[
  1367                                 attributes := attributes copyWith:#autoload.
  1367 				attributes := attributes copyWith:#autoload.
  1368                             ].
  1368 			    ].
  1369                         ] ifFalse:[
  1369 			] ifFalse:[
  1370                             "keep any existing attribute"
  1370 			    "keep any existing attribute"
  1371                             oldAttributes notNil ifTrue:[
  1371 			    oldAttributes notNil ifTrue:[
  1372                                 attributes := oldAttributes.
  1372 				attributes := oldAttributes.
  1373                             ] ifFalse:[
  1373 			    ] ifFalse:[
  1374                                 attributes := eachClass isLoaded ifTrue:[ #() ] ifFalse:[ #(autoload) ].
  1374 				attributes := eachClass isLoaded ifTrue:[ #() ] ifFalse:[ #(autoload) ].
  1375                             ].
  1375 			    ].
  1376                         ].
  1376 			].
  1377                         "JV @ 2010-06-19
  1377 			"JV @ 2010-06-19
  1378                          Support fo additional class attributes and programming language attribute"
  1378 			 Support fo additional class attributes and programming language attribute"
  1379                         attributes := self mergeDefaultClassAttributesFor: eachClass with: attributes.
  1379 			attributes := self mergeDefaultClassAttributesFor: eachClass with: attributes.
  1380 
  1380 
  1381                         newEntry := Array with:className.
  1381 			newEntry := Array with:className.
  1382                         attributes notEmptyOrNil ifTrue:[
  1382 			attributes notEmptyOrNil ifTrue:[
  1383                             newEntry := newEntry , attributes.
  1383 			    newEntry := newEntry , attributes.
  1384                         ].
  1384 			].
  1385                         newSpec add:newEntry
  1385 			newSpec add:newEntry
  1386                     ]
  1386 		    ]
  1387                 ]
  1387 		]
  1388             ]
  1388 	    ]
  1389         ]
  1389 	]
  1390     ].
  1390     ].
  1391     ^ self classNamesAndAttributes_codeFor:newSpec
  1391     ^ self classNamesAndAttributes_codeFor:newSpec
  1392 
  1392 
  1393     "
  1393     "
  1394      stx_libbasic3 classNamesAndAttributes_code_ignoreOldEntries:false ignoreOldDefinition:true
  1394      stx_libbasic3 classNamesAndAttributes_code_ignoreOldEntries:false ignoreOldDefinition:true
  2050     "rules for header files (of autoloaded classes).
  2050     "rules for header files (of autoloaded classes).
  2051      For each extended class, which is autoloaded (and therefore, we will not find a header file for it),
  2051      For each extended class, which is autoloaded (and therefore, we will not find a header file for it),
  2052      generate a rule to create the header file only."
  2052      generate a rule to create the header file only."
  2053 
  2053 
  2054     ^ String streamContents:[:s |
  2054     ^ String streamContents:[:s |
  2055         (self extensionClassesWithSuperclasses:true) do:[:eachExtendedClass |
  2055 	(self extensionClassesWithSuperclasses:true) do:[:eachExtendedClass |
  2056             |headerFileDirPath baseFilename|
  2056 	    |headerFileDirPath baseFilename|
  2057 
  2057 
  2058             (eachExtendedClass isLoaded not or:[eachExtendedClass wasAutoloaded]) ifTrue:[
  2058 	    (eachExtendedClass isLoaded not or:[eachExtendedClass wasAutoloaded]) ifTrue:[
  2059                 headerFileDirPath := self perform:pathConverter with:eachExtendedClass package.
  2059 		headerFileDirPath := self perform:pathConverter with:eachExtendedClass package.
  2060                 baseFilename := self filenameForClass:eachExtendedClass.
  2060 		baseFilename := self filenameForClass:eachExtendedClass.
  2061 
  2061 
  2062                 s nextPutAll:(template
  2062 		s nextPutAll:(template
  2063                     bindWith:headerFileDirPath
  2063 		    bindWith:headerFileDirPath
  2064                     with:baseFilename).
  2064 		    with:baseFilename).
  2065             ]
  2065 	    ]
  2066         ].
  2066 	].
  2067     ].
  2067     ].
  2068 
  2068 
  2069     "Created: / 12-09-2011 / 16:23:52 / cg"
  2069     "Created: / 12-09-2011 / 16:23:52 / cg"
  2070 !
  2070 !
  2071 
  2071 
  2072 additionalHeaderRules_bc_dot_mak
  2072 additionalHeaderRules_bc_dot_mak
  2073     "rules for header files (of autoloaded classes)"
  2073     "rules for header files (of autoloaded classes)"
  2074 
  2074 
  2075     ^ self 
  2075     ^ self
  2076         additionalHeaderRulesUsingTemplate:(self singleHeaderRuleTemplate_bc_dot_mak)
  2076 	additionalHeaderRulesUsingTemplate:(self singleHeaderRuleTemplate_bc_dot_mak)
  2077         pathConverter:#pathToPackage_win32:
  2077 	pathConverter:#pathToPackage_win32:
  2078 
  2078 
  2079     "Created: / 12-09-2011 / 15:44:09 / cg"
  2079     "Created: / 12-09-2011 / 15:44:09 / cg"
  2080 !
  2080 !
  2081 
  2081 
  2082 additionalHeaderRules_make_dot_proto
  2082 additionalHeaderRules_make_dot_proto
  2083     "rules for header files (of autoloaded classes)"
  2083     "rules for header files (of autoloaded classes)"
  2084 
  2084 
  2085     ^ self 
  2085     ^ self
  2086         additionalHeaderRulesUsingTemplate:(self singleHeaderRuleTemplate_make_dot_proto)
  2086 	additionalHeaderRulesUsingTemplate:(self singleHeaderRuleTemplate_make_dot_proto)
  2087         pathConverter:#pathToPackage_unix:
  2087 	pathConverter:#pathToPackage_unix:
  2088 
  2088 
  2089     "Created: / 12-09-2011 / 15:44:28 / cg"
  2089     "Created: / 12-09-2011 / 15:44:28 / cg"
  2090 !
  2090 !
  2091 
  2091 
  2092 additionalLinkLibraries_bc_dot_mak
  2092 additionalLinkLibraries_bc_dot_mak
  3243 bc_dot_mak_mappings
  3243 bc_dot_mak_mappings
  3244     |d|
  3244     |d|
  3245 
  3245 
  3246     d := Dictionary new.
  3246     d := Dictionary new.
  3247     d
  3247     d
  3248         at: 'TAB' put: ( Character tab asString );
  3248 	at: 'TAB' put: ( Character tab asString );
  3249         at: 'TOP' put: ( self pathToTop_win32 );
  3249 	at: 'TOP' put: ( self pathToTop_win32 );
  3250         at: 'MODULE' put: ( self module );
  3250 	at: 'MODULE' put: ( self module );
  3251         at: 'MODULE_DIRECTORY' put: ( self moduleDirectory );
  3251 	at: 'MODULE_DIRECTORY' put: ( self moduleDirectory );
  3252         at: 'MODULE_PATH' put: ( self moduleDirectory_win32 );
  3252 	at: 'MODULE_PATH' put: ( self moduleDirectory_win32 );
  3253         at: 'PRIMARY_TARGET' put: (self primaryTarget_bc_dot_mak);
  3253 	at: 'PRIMARY_TARGET' put: (self primaryTarget_bc_dot_mak);
  3254         at: 'ADDITIONAL_BASE_ADDRESS_DEFINITION' put: (self additionalBaseAddressDefinition_bc_dot_mak ? '');
  3254 	at: 'ADDITIONAL_BASE_ADDRESS_DEFINITION' put: (self additionalBaseAddressDefinition_bc_dot_mak ? '');
  3255         at: 'ADDITIONAL_DEFINITIONS' put: (self additionalDefinitions_bc_dot_mak ? '');
  3255 	at: 'ADDITIONAL_DEFINITIONS' put: (self additionalDefinitions_bc_dot_mak ? '');
  3256         at: 'ADDITIONAL_HEADERRULES' put: (self additionalHeaderRules_bc_dot_mak);
  3256 	at: 'ADDITIONAL_HEADERRULES' put: (self additionalHeaderRules_bc_dot_mak);
  3257         at: 'ADDITIONAL_RULES' put: (self additionalRules_bc_dot_mak ? '');
  3257 	at: 'ADDITIONAL_RULES' put: (self additionalRules_bc_dot_mak ? '');
  3258         at: 'ADDITIONAL_TARGETS' put: (self additionalTargets_bc_dot_mak ? '');
  3258 	at: 'ADDITIONAL_TARGETS' put: (self additionalTargets_bc_dot_mak ? '');
  3259         at: 'ADDITIONAL_LINK_LIBRARIES' put: (self additionalLinkLibraries_bc_dot_mak ? '');
  3259 	at: 'ADDITIONAL_LINK_LIBRARIES' put: (self additionalLinkLibraries_bc_dot_mak ? '');
  3260         at: 'LOCAL_INCLUDES' put: (self generateLocalIncludes_win32 ? '');
  3260 	at: 'LOCAL_INCLUDES' put: (self generateLocalIncludes_win32 ? '');
  3261         at: 'LOCAL_DEFINES' put: self localDefines_win32 ? '';
  3261 	at: 'LOCAL_DEFINES' put: self localDefines_win32 ? '';
  3262         at: 'GLOBAL_DEFINES' put: self globalDefines_win32 ? '';
  3262 	at: 'GLOBAL_DEFINES' put: self globalDefines_win32 ? '';
  3263         at: 'MAKE_PREREQUISITES' put: (self generateRequiredMakePrerequisites_bc_dot_mak ? '').
  3263 	at: 'MAKE_PREREQUISITES' put: (self generateRequiredMakePrerequisites_bc_dot_mak ? '').
  3264     ^ d
  3264     ^ d
  3265 
  3265 
  3266     "Created: / 18-08-2006 / 11:43:39 / cg"
  3266     "Created: / 18-08-2006 / 11:43:39 / cg"
  3267     "Modified: / 12-09-2011 / 15:43:30 / cg"
  3267     "Modified: / 12-09-2011 / 15:43:30 / cg"
  3268 !
  3268 !
  3317     "Created: / 19-09-2006 / 22:47:43 / cg"
  3317     "Created: / 19-09-2006 / 22:47:43 / cg"
  3318 !
  3318 !
  3319 
  3319 
  3320 make_dot_proto_mappings
  3320 make_dot_proto_mappings
  3321     ^ Dictionary new
  3321     ^ Dictionary new
  3322         at: 'TAB' put: ( Character tab asString );
  3322 	at: 'TAB' put: ( Character tab asString );
  3323         at: 'TOP' put: ( self pathToTop_unix );
  3323 	at: 'TOP' put: ( self pathToTop_unix );
  3324         at: 'LIBRARY_NAME' put: ( self libraryName );
  3324 	at: 'LIBRARY_NAME' put: ( self libraryName );
  3325         at: 'SUBDIRECTORIES' put: (self generateSubDirectories);
  3325 	at: 'SUBDIRECTORIES' put: (self generateSubDirectories);
  3326         at: 'LOCAL_INCLUDES' put: (self generateLocalIncludes_unix);
  3326 	at: 'LOCAL_INCLUDES' put: (self generateLocalIncludes_unix);
  3327         at: 'LOCAL_DEFINES' put: self localDefines_unix;
  3327 	at: 'LOCAL_DEFINES' put: self localDefines_unix;
  3328         at: 'GLOBAL_DEFINES' put: self globalDefines_unix;
  3328 	at: 'GLOBAL_DEFINES' put: self globalDefines_unix;
  3329         at: 'COMMONSYMFLAG' put: (self commonSymbolsFlag);
  3329 	at: 'COMMONSYMFLAG' put: (self commonSymbolsFlag);
  3330         at: 'HEADEROUTPUTARG' put: (self headerFileOutputArg);
  3330 	at: 'HEADEROUTPUTARG' put: (self headerFileOutputArg);
  3331         at: 'PRIMARY_TARGET' put: (self primaryTarget_make_dot_proto);
  3331 	at: 'PRIMARY_TARGET' put: (self primaryTarget_make_dot_proto);
  3332         at: 'ADDITIONAL_DEFINITIONS' put: (self additionalDefinitions_make_dot_proto);
  3332 	at: 'ADDITIONAL_DEFINITIONS' put: (self additionalDefinitions_make_dot_proto);
  3333         at: 'ADDITIONAL_HEADERRULES' put: (self additionalHeaderRules_make_dot_proto);
  3333 	at: 'ADDITIONAL_HEADERRULES' put: (self additionalHeaderRules_make_dot_proto);
  3334         at: 'ADDITIONAL_RULES' put: (self additionalRules_make_dot_proto);
  3334 	at: 'ADDITIONAL_RULES' put: (self additionalRules_make_dot_proto);
  3335         at: 'ADDITIONAL_RULES_SVN' put: (self additionalRulesSvn_make_dot_proto);
  3335 	at: 'ADDITIONAL_RULES_SVN' put: (self additionalRulesSvn_make_dot_proto);
  3336         at: 'ADDITIONAL_TARGETS' put: (self additionalTargets_make_dot_proto);
  3336 	at: 'ADDITIONAL_TARGETS' put: (self additionalTargets_make_dot_proto);
  3337         at: 'ADDITIONAL_TARGETS_SVN' put: (self additionalTargetsSvn_make_dot_proto);
  3337 	at: 'ADDITIONAL_TARGETS_SVN' put: (self additionalTargetsSvn_make_dot_proto);
  3338         at: 'ADDITIONAL_LINK_LIBRARIES' put: (self additionalLinkLibraries_make_dot_proto);
  3338 	at: 'ADDITIONAL_LINK_LIBRARIES' put: (self additionalLinkLibraries_make_dot_proto);
  3339         at: 'ADDITIONAL_SHARED_LINK_LIBRARIES' put: (self additionalSharedLinkLibraries_make_dot_proto);
  3339 	at: 'ADDITIONAL_SHARED_LINK_LIBRARIES' put: (self additionalSharedLinkLibraries_make_dot_proto);
  3340         at: 'DEPENDENCIES' put: (self generateDependencies_unix);
  3340 	at: 'DEPENDENCIES' put: (self generateDependencies_unix);
  3341         at: 'MODULE' put: ( self module );
  3341 	at: 'MODULE' put: ( self module );
  3342         at: 'MODULE_DIRECTORY' put: ( self moduleDirectory );
  3342 	at: 'MODULE_DIRECTORY' put: ( self moduleDirectory );
  3343         at: 'MODULE_PATH' put: ( self moduleDirectory );
  3343 	at: 'MODULE_PATH' put: ( self moduleDirectory );
  3344         at: 'MAKE_PREREQUISITES' put: (self generateRequiredMakePrerequisites_make_dot_proto);
  3344 	at: 'MAKE_PREREQUISITES' put: (self generateRequiredMakePrerequisites_make_dot_proto);
  3345         yourself
  3345 	yourself
  3346 
  3346 
  3347     "Created: / 09-08-2006 / 11:20:45 / fm"
  3347     "Created: / 09-08-2006 / 11:20:45 / fm"
  3348     "Modified: / 09-08-2006 / 16:44:48 / fm"
  3348     "Modified: / 09-08-2006 / 16:44:48 / fm"
  3349     "Modified: / 24-06-2009 / 21:50:13 / Jan Vrany <vranyj1@fel.cvut.cz>"
  3349     "Modified: / 24-06-2009 / 21:50:13 / Jan Vrany <vranyj1@fel.cvut.cz>"
  3350     "Modified: / 22-08-2009 / 12:03:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3350     "Modified: / 22-08-2009 / 12:03:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3482 
  3482 
  3483 !ProjectDefinition class methodsFor:'file mappings support'!
  3483 !ProjectDefinition class methodsFor:'file mappings support'!
  3484 
  3484 
  3485 classNamesByCategory
  3485 classNamesByCategory
  3486     "answer a dictionary
  3486     "answer a dictionary
  3487         category -> classNames topological sorted"
  3487 	category -> classNames topological sorted"
  3488 
  3488 
  3489     |pivateClassesOf sorter classes classNames mapping|
  3489     |pivateClassesOf sorter classes classNames mapping|
  3490 
  3490 
  3491     mapping := Dictionary new.
  3491     mapping := Dictionary new.
  3492 
  3492 
  3493     classes := self compiled_classes_common.
  3493     classes := self compiled_classes_common.
  3494     pivateClassesOf := IdentityDictionary new.
  3494     pivateClassesOf := IdentityDictionary new.
  3495     classes do:[:each | pivateClassesOf at:each put:(each allPrivateClasses)].
  3495     classes do:[:each | pivateClassesOf at:each put:(each allPrivateClasses)].
  3496 
  3496 
  3497     sorter := [:a :b |
  3497     sorter := [:a :b |
  3498         "/ a must come before b iff:
  3498 	"/ a must come before b iff:
  3499         "/    b is a subclass of a
  3499 	"/    b is a subclass of a
  3500         "/    b has a private class which is a subclass of a
  3500 	"/    b has a private class which is a subclass of a
  3501         "/    a is a sharedPool, used by b
  3501 	"/    a is a sharedPool, used by b
  3502 
  3502 
  3503         |mustComeBefore pivateClassesOfB|
  3503 	|mustComeBefore pivateClassesOfB|
  3504 
  3504 
  3505         mustComeBefore := false.
  3505 	mustComeBefore := false.
  3506         mustComeBefore := (a isSharedPool and:[(b sharedPoolNames includes: a name)]).
  3506 	mustComeBefore := (a isSharedPool and:[(b sharedPoolNames includes: a name)]).
  3507         mustComeBefore := mustComeBefore or:[b isSubclassOf:a].
  3507 	mustComeBefore := mustComeBefore or:[b isSubclassOf:a].
  3508         mustComeBefore ifFalse:[
  3508 	mustComeBefore ifFalse:[
  3509             pivateClassesOfB := pivateClassesOf at:b ifAbsent:[ #() ].
  3509 	    pivateClassesOfB := pivateClassesOf at:b ifAbsent:[ #() ].
  3510             pivateClassesOfB do:[:eachClassInB |
  3510 	    pivateClassesOfB do:[:eachClassInB |
  3511                 mustComeBefore := mustComeBefore or:[eachClassInB isSubclassOf:a]
  3511 		mustComeBefore := mustComeBefore or:[eachClassInB isSubclassOf:a]
  3512             ].
  3512 	    ].
  3513         ].
  3513 	].
  3514         mustComeBefore
  3514 	mustComeBefore
  3515     ].
  3515     ].
  3516 
  3516 
  3517     classes topologicalSort:sorter.
  3517     classes topologicalSort:sorter.
  3518 
  3518 
  3519     OperatingSystem knownPlatformNames do:[:platformID |
  3519     OperatingSystem knownPlatformNames do:[:platformID |
  3520         |prefix depClasses depClassNames|
  3520 	|prefix depClasses depClassNames|
  3521 
  3521 
  3522         prefix := platformID asUppercase.
  3522 	prefix := platformID asUppercase.
  3523         depClasses := self compiled_classesForArchitecture:platformID.
  3523 	depClasses := self compiled_classesForArchitecture:platformID.
  3524         depClasses notEmpty ifTrue:[
  3524 	depClasses notEmpty ifTrue:[
  3525             (self compiled_classNamesForPlatform:platformID) 
  3525 	    (self compiled_classNamesForPlatform:platformID)
  3526                 select:[:nm | (Smalltalk at:nm ifAbsent:nil) isNil]
  3526 		select:[:nm | (Smalltalk at:nm ifAbsent:nil) isNil]
  3527                 thenDo:[:nm | Transcript showCR:nm].
  3527 		thenDo:[:nm | Transcript showCR:nm].
  3528             (depClasses includes:nil) ifTrue:[
  3528 	    (depClasses includes:nil) ifTrue:[
  3529                 (Dialog confirm:'Dependencies might be incorrect (some classes are not present).\\Continue anyway ?' withCRs)
  3529 		(Dialog confirm:'Dependencies might be incorrect (some classes are not present).\\Continue anyway ?' withCRs)
  3530                 ifFalse:[
  3530 		ifFalse:[
  3531                     AbortOperationRequest raise.
  3531 		    AbortOperationRequest raise.
  3532                 ].
  3532 		].
  3533                 depClassNames := self compiled_classNamesForPlatform:platformID.
  3533 		depClassNames := self compiled_classNamesForPlatform:platformID.
  3534             ] ifFalse:[
  3534 	    ] ifFalse:[
  3535                 depClasses topologicalSort:sorter.
  3535 		depClasses topologicalSort:sorter.
  3536                 depClassNames := depClasses collect:[:eachClass| eachClass name].
  3536 		depClassNames := depClasses collect:[:eachClass| eachClass name].
  3537             ].
  3537 	    ].
  3538             mapping at:prefix put:depClassNames.
  3538 	    mapping at:prefix put:depClassNames.
  3539         ].
  3539 	].
  3540 
  3540 
  3541         classNames := classes collect:[:eachClass| eachClass name].
  3541 	classNames := classes collect:[:eachClass| eachClass name].
  3542         self namesAndAttributesIn:(self additionalClassNamesAndAttributes) do: [:nm :attr |
  3542 	self namesAndAttributesIn:(self additionalClassNamesAndAttributes) do: [:nm :attr |
  3543             (attr isEmptyOrNil or:[(attr includes:#autoload) not]) ifTrue:[
  3543 	    (attr isEmptyOrNil or:[(attr includes:#autoload) not]) ifTrue:[
  3544                 classNames add:nm.
  3544 		classNames add:nm.
  3545             ].
  3545 	    ].
  3546         ].
  3546 	].
  3547 
  3547 
  3548         mapping at:'COMMON' put:classNames.
  3548 	mapping at:'COMMON' put:classNames.
  3549     ].
  3549     ].
  3550     ^ mapping
  3550     ^ mapping
  3551 
  3551 
  3552     "
  3552     "
  3553      stx_libbasic classNamesByCategory
  3553      stx_libbasic classNamesByCategory
  4481      This is normally no problem for compiled classLibs - however, if a package
  4481      This is normally no problem for compiled classLibs - however, if a package
  4482      has only be installedAsAutoloaded, some classes might want to ensure that
  4482      has only be installedAsAutoloaded, some classes might want to ensure that
  4483      when being loaded themself."
  4483      when being loaded themself."
  4484 
  4484 
  4485     self hasAllExtensionsLoaded ifFalse:[
  4485     self hasAllExtensionsLoaded ifFalse:[
  4486         self breakPoint:#cg.
  4486 	self breakPoint:#cg.
  4487     ].
  4487     ].
  4488     self hasAllClassesFullyLoaded ifFalse:[
  4488     self hasAllClassesFullyLoaded ifFalse:[
  4489         self hasAllClassesLoaded ifFalse:[
  4489 	self hasAllClassesLoaded ifFalse:[
  4490             self breakPoint:#cg.
  4490 	    self breakPoint:#cg.
  4491         ].
  4491 	].
  4492         self installAutoloadedClasses.
  4492 	self installAutoloadedClasses.
  4493         self classes do:[:cls | cls autoload ].
  4493 	self classes do:[:cls | cls autoload ].
  4494     ].
  4494     ].
  4495 
  4495 
  4496     "
  4496     "
  4497      stx_libbasic ensureFullyLoaded
  4497      stx_libbasic ensureFullyLoaded
  4498     "
  4498     "
  4521      false if the package's classes have been already present."
  4521      false if the package's classes have been already present."
  4522 
  4522 
  4523     |newStuffHasBeenLoaded meOrMySecondIncarnation|
  4523     |newStuffHasBeenLoaded meOrMySecondIncarnation|
  4524 
  4524 
  4525     self projectIsLoaded ifTrue:[
  4525     self projectIsLoaded ifTrue:[
  4526         asAutoloaded ifFalse:[
  4526 	asAutoloaded ifFalse:[
  4527             "/ to be considered !!
  4527 	    "/ to be considered !!
  4528 "/            self isFullyLoaded ifFalse:[
  4528 "/            self isFullyLoaded ifFalse:[
  4529 "/                self hasAllExtensionsLoaded ifFalse:[
  4529 "/                self hasAllExtensionsLoaded ifFalse:[
  4530 "/                    self loadExtensions.
  4530 "/                    self loadExtensions.
  4531 "/                ].
  4531 "/                ].
  4532 "/                self loadAllAutoloadedClasses
  4532 "/                self loadAllAutoloadedClasses
  4533 "/            ].
  4533 "/            ].
  4534         ].
  4534 	].
  4535         ^ false
  4535 	^ false
  4536     ].
  4536     ].
  4537     thisContext isRecursive ifTrue:[self breakPoint:#cg. ^ false].    "/ avoid endless loops
  4537     thisContext isRecursive ifTrue:[self breakPoint:#cg. ^ false].    "/ avoid endless loops
  4538 
  4538 
  4539     newStuffHasBeenLoaded := false.
  4539     newStuffHasBeenLoaded := false.
  4540 
  4540 
  4541     (self infoPrinting and:[Smalltalk silentLoading not]) ifTrue:[
  4541     (self infoPrinting and:[Smalltalk silentLoading not]) ifTrue:[
  4542         "/ thisContext fullPrintAll.
  4542 	"/ thisContext fullPrintAll.
  4543         Transcript showCR:('loading %1%2...'
  4543 	Transcript showCR:('loading %1%2...'
  4544                             bindWith:(asAutoloaded ifTrue:['as autoloaded '] ifFalse:[''])
  4544 			    bindWith:(asAutoloaded ifTrue:['as autoloaded '] ifFalse:[''])
  4545                             with:self name).
  4545 			    with:self name).
  4546     ].
  4546     ].
  4547 
  4547 
  4548     self rememberOverwrittenExtensionMethods.
  4548     self rememberOverwrittenExtensionMethods.
  4549 
  4549 
  4550     self activityNotification:'Executing pre-load action'.
  4550     self activityNotification:'Executing pre-load action'.
  4551     self preLoadAction.
  4551     self preLoadAction.
  4552 
  4552 
  4553     meOrMySecondIncarnation := self.
  4553     meOrMySecondIncarnation := self.
  4554 
  4554 
  4555     Class withoutUpdatingChangesDo:[
  4555     Class withoutUpdatingChangesDo:[
  4556         self activityNotification:'Loading prerequisities'.
  4556 	self activityNotification:'Loading prerequisities'.
  4557         self loadPreRequisitesAsAutoloaded:asAutoloaded.
  4557 	self loadPreRequisitesAsAutoloaded:asAutoloaded.
  4558 
  4558 
  4559         self checkPrerequisitesForLoading.
  4559 	self checkPrerequisitesForLoading.
  4560 
  4560 
  4561         asAutoloaded ifFalse:[
  4561 	asAutoloaded ifFalse:[
  4562             self loadClassLibrary.
  4562 	    self loadClassLibrary.
  4563             "/ could have overloaded my first incarnation
  4563 	    "/ could have overloaded my first incarnation
  4564             meOrMySecondIncarnation := (Smalltalk at:(self name)) ? self.
  4564 	    meOrMySecondIncarnation := (Smalltalk at:(self name)) ? self.
  4565             meOrMySecondIncarnation ~~ self ifTrue:[
  4565 	    meOrMySecondIncarnation ~~ self ifTrue:[
  4566                 meOrMySecondIncarnation fetchSlotsFrom:self.
  4566 		meOrMySecondIncarnation fetchSlotsFrom:self.
  4567             ].
  4567 	    ].
  4568         ].
  4568 	].
  4569 
  4569 
  4570         self hasAllExtensionsLoaded ifFalse:[
  4570 	self hasAllExtensionsLoaded ifFalse:[
  4571             self activityNotification:'Loading extensions'.
  4571 	    self activityNotification:'Loading extensions'.
  4572             newStuffHasBeenLoaded := newStuffHasBeenLoaded | meOrMySecondIncarnation loadExtensions.
  4572 	    newStuffHasBeenLoaded := newStuffHasBeenLoaded | meOrMySecondIncarnation loadExtensions.
  4573         ].
  4573 	].
  4574         self hasAllClassesLoaded ifFalse:[
  4574 	self hasAllClassesLoaded ifFalse:[
  4575             self activityNotification:'Loading classes'.
  4575 	    self activityNotification:'Loading classes'.
  4576             newStuffHasBeenLoaded := newStuffHasBeenLoaded | (meOrMySecondIncarnation loadAllClassesAsAutoloaded:asAutoloaded).
  4576 	    newStuffHasBeenLoaded := newStuffHasBeenLoaded | (meOrMySecondIncarnation loadAllClassesAsAutoloaded:asAutoloaded).
  4577         ].
  4577 	].
  4578 "/ no, don't load subProjects here - will lead to a recursion, which leads
  4578 "/ no, don't load subProjects here - will lead to a recursion, which leads
  4579 "/ to some classes being loaded from source (soap)
  4579 "/ to some classes being loaded from source (soap)
  4580         self activityNotification:'Loading sub projects'.
  4580 	self activityNotification:'Loading sub projects'.
  4581         meOrMySecondIncarnation loadSubProjectsAsAutoloaded:asAutoloaded.
  4581 	meOrMySecondIncarnation loadSubProjectsAsAutoloaded:asAutoloaded.
  4582     ].
  4582     ].
  4583     self activityNotification:('Executing post-load action for %1' bindWith:self package).
  4583     self activityNotification:('Executing post-load action for %1' bindWith:self package).
  4584 
  4584 
  4585     "/ mhmh - already done for dll-loaded packages
  4585     "/ mhmh - already done for dll-loaded packages
  4586     "/ meOrMySecondIncarnation initializeAllClasses.
  4586     "/ meOrMySecondIncarnation initializeAllClasses.
  4587     meOrMySecondIncarnation postLoadAction.
  4587     meOrMySecondIncarnation postLoadAction.
  4588 
  4588 
  4589     meOrMySecondIncarnation projectIsLoaded:true.
  4589     meOrMySecondIncarnation projectIsLoaded:true.
  4590     meOrMySecondIncarnation ~~ self ifTrue:[
  4590     meOrMySecondIncarnation ~~ self ifTrue:[
  4591         self projectIsLoaded:true.
  4591 	self projectIsLoaded:true.
  4592     ].
  4592     ].
  4593 
  4593 
  4594     self activityNotification:('Done (%1).' bindWith:self package).
  4594     self activityNotification:('Done (%1).' bindWith:self package).
  4595     ^ newStuffHasBeenLoaded
  4595     ^ newStuffHasBeenLoaded
  4596 
  4596 
  4652      and cached for future use"
  4652      and cached for future use"
  4653 
  4653 
  4654     |abbrevs|
  4654     |abbrevs|
  4655 
  4655 
  4656     AccessLock critical:[
  4656     AccessLock critical:[
  4657         |mustRead file|
  4657 	|mustRead file|
  4658 
  4658 
  4659         AbbrevDictionary isNil ifTrue:[
  4659 	AbbrevDictionary isNil ifTrue:[
  4660             AbbrevDictionary := WeakIdentityDictionary new.
  4660 	    AbbrevDictionary := WeakIdentityDictionary new.
  4661         ].
  4661 	].
  4662 
  4662 
  4663         mustRead := false.
  4663 	mustRead := false.
  4664         abbrevs := AbbrevDictionary at:self ifAbsent:[ mustRead := true. Dictionary new ].
  4664 	abbrevs := AbbrevDictionary at:self ifAbsent:[ mustRead := true. Dictionary new ].
  4665 
  4665 
  4666         mustRead ifTrue:[
  4666 	mustRead ifTrue:[
  4667             file := self packageDirectory / 'abbrev.stc'.
  4667 	    file := self packageDirectory / 'abbrev.stc'.
  4668             file exists ifTrue: [
  4668 	    file exists ifTrue: [
  4669                 file readingFileDo:[:stream |
  4669 		file readingFileDo:[:stream |
  4670                     Smalltalk
  4670 		    Smalltalk
  4671                         withAbbreviationsFromStream:stream
  4671 			withAbbreviationsFromStream:stream
  4672                         do:[:nm :fn :pkg :cat :sz|
  4672 			do:[:nm :fn :pkg :cat :sz|
  4673                             abbrevs at: nm put: (AbbrevEntry new className:nm fileName:fn category:cat numClassInstVars:sz)
  4673 			    abbrevs at: nm put: (AbbrevEntry new className:nm fileName:fn category:cat numClassInstVars:sz)
  4674                         ]
  4674 			]
  4675                 ]
  4675 		]
  4676             ].
  4676 	    ].
  4677         ].
  4677 	].
  4678     ].
  4678     ].
  4679     
  4679 
  4680     ^abbrevs
  4680     ^abbrevs
  4681 
  4681 
  4682     "Created: / 06-03-2011 / 18:25:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  4682     "Created: / 06-03-2011 / 18:25:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  4683     "Modified: / 18-08-2011 / 14:24:15 / cg"
  4683     "Modified: / 18-08-2011 / 14:24:15 / cg"
  4684 !
  4684 !
  5549 loadClass: className asAutoloaded: asAutoloaded language: lang
  5549 loadClass: className asAutoloaded: asAutoloaded language: lang
  5550     | packageDir classFile entry category numClassInstVars cls|
  5550     | packageDir classFile entry category numClassInstVars cls|
  5551 
  5551 
  5552     "Handle smalltalk classes specially to provide backward compatibility"
  5552     "Handle smalltalk classes specially to provide backward compatibility"
  5553     lang isSmalltalk ifTrue:[
  5553     lang isSmalltalk ifTrue:[
  5554         entry := self abbrevs at: className ifAbsent:[nil].
  5554 	entry := self abbrevs at: className ifAbsent:[nil].
  5555 
  5555 
  5556         asAutoloaded ifTrue:[
  5556 	asAutoloaded ifTrue:[
  5557             category := entry isNil ifTrue:[#autoloaded] ifFalse:[entry category].
  5557 	    category := entry isNil ifTrue:[#autoloaded] ifFalse:[entry category].
  5558             numClassInstVars := entry isNil ifTrue:[0] ifFalse:[entry numClassInstVars].
  5558 	    numClassInstVars := entry isNil ifTrue:[0] ifFalse:[entry numClassInstVars].
  5559             cls := Smalltalk
  5559 	    cls := Smalltalk
  5560                 installAutoloadedClassNamed: className
  5560 		installAutoloadedClassNamed: className
  5561                 category: category
  5561 		category: category
  5562                 package: self package
  5562 		package: self package
  5563                 revision: nil
  5563 		revision: nil
  5564                 numClassInstVars:numClassInstVars.
  5564 		numClassInstVars:numClassInstVars.
  5565             entry notNil ifTrue:[
  5565 	    entry notNil ifTrue:[
  5566                 cls setClassFilename:(entry fileName,'.st').
  5566 		cls setClassFilename:(entry fileName,'.st').
  5567             ].
  5567 	    ].
  5568             ^ cls.
  5568 	    ^ cls.
  5569         ].
  5569 	].
  5570         ^ Smalltalk
  5570 	^ Smalltalk
  5571             fileInClass:className
  5571 	    fileInClass:className
  5572             package:self package
  5572 	    package:self package
  5573             initialize:false
  5573 	    initialize:false
  5574             lazy:false
  5574 	    lazy:false
  5575             silent:true
  5575 	    silent:true
  5576     ].
  5576     ].
  5577 
  5577 
  5578     "For non-smalltalk language do"
  5578     "For non-smalltalk language do"
  5579     asAutoloaded ifTrue:[^self error:'Only Smalltalk classes may be autoloaded (yet)'].
  5579     asAutoloaded ifTrue:[^self error:'Only Smalltalk classes may be autoloaded (yet)'].
  5580 
  5580 
  5959 
  5959 
  5960     "my classes are required"
  5960     "my classes are required"
  5961     requiredClasses := (self searchForClassesWithProject: packageId) asSet.
  5961     requiredClasses := (self searchForClassesWithProject: packageId) asSet.
  5962 
  5962 
  5963     withSubProjectsBoolean ifTrue:[
  5963     withSubProjectsBoolean ifTrue:[
  5964         "my subproject's classes are required"
  5964 	"my subproject's classes are required"
  5965         self subProjects do:[:eachProjectName |
  5965 	self subProjects do:[:eachProjectName |
  5966             requiredClasses addAll: (self searchForClassesWithProject:eachProjectName asSymbol)
  5966 	    requiredClasses addAll: (self searchForClassesWithProject:eachProjectName asSymbol)
  5967         ].
  5967 	].
  5968     ].
  5968     ].
  5969 
  5969 
  5970     "all superclasses of my classes and my subProject's classes are required"
  5970     "all superclasses of my classes and my subProject's classes are required"
  5971     requiredClasses do:[:cls |
  5971     requiredClasses do:[:cls |
  5972         cls allSuperclassesDo:[:eachSuperclass |
  5972 	cls allSuperclassesDo:[:eachSuperclass |
  5973             (usedClassesWithReasons at: eachSuperclass ifAbsentPut:[OrderedSet new])
  5973 	    (usedClassesWithReasons at: eachSuperclass ifAbsentPut:[OrderedSet new])
  5974                 add: (eachSuperclass name, ' - superclass of ', cls name).
  5974 		add: (eachSuperclass name, ' - superclass of ', cls name).
  5975         ]
  5975 	]
  5976     ].
  5976     ].
  5977 
  5977 
  5978     "all classes referenced by my classes or my subproject's classes
  5978     "all classes referenced by my classes or my subproject's classes
  5979      are required. But:
  5979      are required. But:
  5980          only search for locals refered to by my methods (assuming that superclasses'
  5980 	 only search for locals refered to by my methods (assuming that superclasses'
  5981          prerequisites are specified in their package)."
  5981 	 prerequisites are specified in their package)."
  5982 
  5982 
  5983     self addReferencesToClassesFromGlobalsIn:requiredClasses to:usedClassesWithReasons.
  5983     self addReferencesToClassesFromGlobalsIn:requiredClasses to:usedClassesWithReasons.
  5984     self addReferencesToClassesFromGlobalsInMethods:(self searchForExtensionsWithProject:self package) to:usedClassesWithReasons.
  5984     self addReferencesToClassesFromGlobalsInMethods:(self searchForExtensionsWithProject:self package) to:usedClassesWithReasons.
  5985 
  5985 
  5986     "all classes for which I define extensions are required"
  5986     "all classes for which I define extensions are required"
  5987     self allExtensionClasses do:[:eachExtendedClass |
  5987     self allExtensionClasses do:[:eachExtendedClass |
  5988         (usedClassesWithReasons at:eachExtendedClass ifAbsentPut:[OrderedSet new])
  5988 	(usedClassesWithReasons at:eachExtendedClass ifAbsentPut:[OrderedSet new])
  5989             add: (eachExtendedClass name, ' - extended').
  5989 	    add: (eachExtendedClass name, ' - extended').
  5990         eachExtendedClass allSuperclassesDo:[:eachSuperclass |
  5990 	eachExtendedClass allSuperclassesDo:[:eachSuperclass |
  5991             (usedClassesWithReasons at: eachSuperclass ifAbsentPut:[OrderedSet new])
  5991 	    (usedClassesWithReasons at: eachSuperclass ifAbsentPut:[OrderedSet new])
  5992                 add: (eachSuperclass name, ' - superclass of extended ', eachExtendedClass name).
  5992 		add: (eachSuperclass name, ' - superclass of extended ', eachExtendedClass name).
  5993         ]
  5993 	]
  5994     ].
  5994     ].
  5995 
  5995 
  5996     "don't put classes from subProjects into the required list"
  5996     "don't put classes from subProjects into the required list"
  5997     ignoredPackages := (self siblingsAreSubProjects
  5997     ignoredPackages := (self siblingsAreSubProjects
  5998                                 ifTrue:[ self searchForSiblingProjects ]
  5998 				ifTrue:[ self searchForSiblingProjects ]
  5999                                 ifFalse:[ self searchForSubProjects ]) asSet.
  5999 				ifFalse:[ self searchForSubProjects ]) asSet.
  6000 
  6000 
  6001     ignoredPackages add:self package.
  6001     ignoredPackages add:self package.
  6002     ignoredPackages add:PackageId noProjectID.
  6002     ignoredPackages add:PackageId noProjectID.
  6003 
  6003 
  6004     "now map classes to packages and collect the reasons"
  6004     "now map classes to packages and collect the reasons"
  6005     requiredPackageReasons := Dictionary new.
  6005     requiredPackageReasons := Dictionary new.
  6006     usedClassesWithReasons keysAndValuesDo:[:usedClass :reasonsPerClass | |usedClassPackage|
  6006     usedClassesWithReasons keysAndValuesDo:[:usedClass :reasonsPerClass | |usedClassPackage|
  6007         usedClassPackage := usedClass package.
  6007 	usedClassPackage := usedClass package.
  6008         (ignoredPackages includes:usedClassPackage) ifFalse:[
  6008 	(ignoredPackages includes:usedClassPackage) ifFalse:[
  6009             (requiredPackageReasons at:usedClassPackage ifAbsentPut:[OrderedSet new])
  6009 	    (requiredPackageReasons at:usedClassPackage ifAbsentPut:[OrderedSet new])
  6010                             addAll:reasonsPerClass.
  6010 			    addAll:reasonsPerClass.
  6011         ].
  6011 	].
  6012     ].
  6012     ].
  6013 
  6013 
  6014     ^ requiredPackageReasons
  6014     ^ requiredPackageReasons
  6015 
  6015 
  6016     "
  6016     "
  6172     |classes|
  6172     |classes|
  6173 
  6173 
  6174     classes := IdentitySet new.
  6174     classes := IdentitySet new.
  6175 
  6175 
  6176     self extensionMethodNames pairWiseDo:[:className :selector |
  6176     self extensionMethodNames pairWiseDo:[:className :selector |
  6177         |mthdCls extendedClass|
  6177 	|mthdCls extendedClass|
  6178 
  6178 
  6179         mthdCls := Smalltalk classNamed:className.
  6179 	mthdCls := Smalltalk classNamed:className.
  6180         (mthdCls notNil and:[mthdCls isLoaded]) ifTrue:[
  6180 	(mthdCls notNil and:[mthdCls isLoaded]) ifTrue:[
  6181             extendedClass := mthdCls theNonMetaclass.
  6181 	    extendedClass := mthdCls theNonMetaclass.
  6182             (classes includes:extendedClass) ifFalse:[
  6182 	    (classes includes:extendedClass) ifFalse:[
  6183                 withSuperclassesBoolean ifTrue:[
  6183 		withSuperclassesBoolean ifTrue:[
  6184                     extendedClass withAllSuperclassesDo:[:eachClass |
  6184 		    extendedClass withAllSuperclassesDo:[:eachClass |
  6185                         classes add:eachClass.
  6185 			classes add:eachClass.
  6186                     ].
  6186 		    ].
  6187                 ] ifFalse:[
  6187 		] ifFalse:[
  6188                     classes add:extendedClass.
  6188 		    classes add:extendedClass.
  6189                 ].
  6189 		].
  6190             ].
  6190 	    ].
  6191         ].
  6191 	].
  6192     ].
  6192     ].
  6193     ^ classes.
  6193     ^ classes.
  6194 
  6194 
  6195     "
  6195     "
  6196         stx_libboss extensionClasses
  6196 	stx_libboss extensionClasses
  6197     "
  6197     "
  6198 
  6198 
  6199     "Created: / 06-09-2011 / 10:17:06 / cg"
  6199     "Created: / 06-09-2011 / 10:17:06 / cg"
  6200 !
  6200 !
  6201 
  6201 
  6219     "answer the set of packages, which are extended by this package"
  6219     "answer the set of packages, which are extended by this package"
  6220 
  6220 
  6221     ^ self allExtensionClasses collect:[:eachClass| eachClass package]
  6221     ^ self allExtensionClasses collect:[:eachClass| eachClass package]
  6222 
  6222 
  6223     "
  6223     "
  6224         stx_libboss extensionPackages
  6224 	stx_libboss extensionPackages
  6225     "
  6225     "
  6226 
  6226 
  6227     "Modified: / 06-09-2011 / 10:20:47 / cg"
  6227     "Modified: / 06-09-2011 / 10:20:47 / cg"
  6228 !
  6228 !
  6229 
  6229 
  6392 validateDescription
  6392 validateDescription
  6393     |emptyProjects nonProjects emptyOrNonProjects classesInImage classesInDescription|
  6393     |emptyProjects nonProjects emptyOrNonProjects classesInImage classesInDescription|
  6394 
  6394 
  6395     emptyProjects := Set withAll:self subProjects.
  6395     emptyProjects := Set withAll:self subProjects.
  6396     Smalltalk allClassesDo:[:cls |
  6396     Smalltalk allClassesDo:[:cls |
  6397         emptyProjects remove:(cls package) ifAbsent:[].
  6397 	emptyProjects remove:(cls package) ifAbsent:[].
  6398     ].
  6398     ].
  6399     nonProjects := self subProjects select:[:p |
  6399     nonProjects := self subProjects select:[:p |
  6400                     (ProjectDefinition definitionClassForPackage: p) isNil
  6400 		    (ProjectDefinition definitionClassForPackage: p) isNil
  6401                    ].
  6401 		   ].
  6402 
  6402 
  6403     emptyOrNonProjects := Set withAll:emptyProjects.
  6403     emptyOrNonProjects := Set withAll:emptyProjects.
  6404     emptyOrNonProjects addAll:nonProjects.
  6404     emptyOrNonProjects addAll:nonProjects.
  6405 
  6405 
  6406     emptyOrNonProjects notEmpty ifTrue:[
  6406     emptyOrNonProjects notEmpty ifTrue:[
  6407         (Dialog
  6407 	(Dialog
  6408             confirm:('The following projects are non-existent, empty or without description:\\    '
  6408 	    confirm:('The following projects are non-existent, empty or without description:\\    '
  6409                     , ((emptyOrNonProjects
  6409 		    , ((emptyOrNonProjects
  6410                             asSortedCollection
  6410 			    asSortedCollection
  6411                                 collect:[:p | p allBold])
  6411 				collect:[:p | p allBold])
  6412                                 asStringWith:'\    ')
  6412 				asStringWith:'\    ')
  6413                     , '\\Continue ?') withCRs
  6413 		    , '\\Continue ?') withCRs
  6414             yesLabel:'OK' noLabel:'Cancel')
  6414 	    yesLabel:'OK' noLabel:'Cancel')
  6415         ifFalse:[
  6415 	ifFalse:[
  6416             AbortSignal raise
  6416 	    AbortSignal raise
  6417         ].
  6417 	].
  6418     ].
  6418     ].
  6419 
  6419 
  6420     classesInImage := Smalltalk allClasses select:[:cls | cls package = package].
  6420     classesInImage := Smalltalk allClasses select:[:cls | cls package = self package].
  6421     classesInDescription := self classes asIdentitySet.
  6421     classesInDescription := self classes asIdentitySet.
  6422     classesInImage ~= classesInDescription ifTrue:[
  6422     classesInImage ~= classesInDescription ifTrue:[
  6423         Dialog warn:'The set of classes in the image is different from the listed classes in the project definition'
  6423 	Dialog warn:'The set of classes in the image is different from the listed classes in the project definition'
  6424     ].
  6424     ].
  6425 
  6425 
  6426     "
  6426     "
  6427      squeak_vmMaker validateDescription
  6427      squeak_vmMaker validateDescription
  6428     "
  6428     "
  6475 
  6475 
  6476 className
  6476 className
  6477     ^ className
  6477     ^ className
  6478 !
  6478 !
  6479 
  6479 
  6480 className:classNameArg fileName:fileNameArg category:categoryArg numClassInstVars:numClassInstVarsArg 
  6480 className:classNameArg fileName:fileNameArg category:categoryArg numClassInstVars:numClassInstVarsArg
  6481     className := classNameArg.
  6481     className := classNameArg.
  6482     fileName := fileNameArg.
  6482     fileName := fileNameArg.
  6483     category := categoryArg.
  6483     category := categoryArg.
  6484     numClassInstVars := numClassInstVarsArg.
  6484     numClassInstVars := numClassInstVarsArg.
  6485 
  6485 
  6497 ! !
  6497 ! !
  6498 
  6498 
  6499 !ProjectDefinition class methodsFor:'documentation'!
  6499 !ProjectDefinition class methodsFor:'documentation'!
  6500 
  6500 
  6501 version
  6501 version
  6502     ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.356 2011-09-14 13:39:47 cg Exp $'
  6502     ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.357 2011-09-14 13:48:16 cg Exp $'
  6503 !
  6503 !
  6504 
  6504 
  6505 version_CVS
  6505 version_CVS
  6506     ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.356 2011-09-14 13:39:47 cg Exp $'
  6506     ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.357 2011-09-14 13:48:16 cg Exp $'
  6507 !
  6507 !
  6508 
  6508 
  6509 version_SVN
  6509 version_SVN
  6510     ^ '§ Id: ProjectDefinition.st 10645 2011-06-09 15:28:45Z vranyj1  §'
  6510     ^ '§ Id: ProjectDefinition.st 10645 2011-06-09 15:28:45Z vranyj1  §'
  6511 ! !
  6511 ! !