ProjectDefinition.st
changeset 12740 a035bfe4af1a
parent 12739 c6bb8e98674b
child 12741 2e5f250f5426
equal deleted inserted replaced
12739:c6bb8e98674b 12740:a035bfe4af1a
    10  hereby transferred.
    10  hereby transferred.
    11 "
    11 "
    12 "{ Package: 'stx:libbasic' }"
    12 "{ Package: 'stx:libbasic' }"
    13 
    13 
    14 Object subclass:#ProjectDefinition
    14 Object subclass:#ProjectDefinition
    15 	instanceVariableNames:''
    15         instanceVariableNames:''
    16 	classVariableNames:'LibraryType GUIApplicationType NonGUIApplicationType
    16         classVariableNames:'LibraryType GUIApplicationType NonGUIApplicationType
    17 		PackagesBeingLoaded Verbose'
    17                 PackagesBeingLoaded Verbose'
    18 	poolDictionaries:''
    18         poolDictionaries:''
    19 	category:'System-Support-Projects'
    19         category:'System-Support-Projects'
    20 !
    20 !
    21 
    21 
    22 ProjectDefinition class instanceVariableNames:'safeForOverwrittenMethods extensionOverwriteInfo projectIsLoaded'
    22 ProjectDefinition class instanceVariableNames:'safeForOverwrittenMethods extensionOverwriteInfo projectIsLoaded'
    23 
    23 
    24 "
    24 "
   988 !ProjectDefinition class methodsFor:'accessing - svn'!
   988 !ProjectDefinition class methodsFor:'accessing - svn'!
   989 
   989 
   990 svnRevision
   990 svnRevision
   991 
   991 
   992     "
   992     "
   993 	Answers SVN revision of given package. The revision is computed
   993         Answers SVN revision of given package. The revision is computed
   994 	as follows:
   994         as follows:
   995 	1) Look at package directory if there is .svn administration
   995         1) Look at package directory if there is .svn administration
   996 	   directory. If so, uses SVN to obtain SVN revision & return
   996            directory. If so, uses SVN to obtain SVN revision & return
   997 	2) If svnRevisionNr return non-nil, use that as SVN revision & return
   997         2) If svnRevisionNr return non-nil, use that as SVN revision & return
   998 	3) If everything fails, compute maximum from all revision of all
   998         3) If everything fails, compute maximum from all revision of all
   999 	   classes & extensions
   999            classes & extensions
  1000     "
  1000     "
  1001     | pkgDir revNr |
  1001     | pkgDir revNr |
  1002 
  1002 
  1003     "1)"
  1003     "1)"
  1004     pkgDir := self packageDirectory.
  1004     pkgDir := self packageDirectory.
  1005     (pkgDir notNil and: [pkgDir exists and: [(pkgDir / '.svn') exists]]) ifTrue:
  1005     (pkgDir notNil and: [pkgDir exists and: [(pkgDir / '.svn') exists]]) ifTrue:
  1006 	[[revNr := (SVN::InfoCommand new
  1006         [[revNr := (SVN::InfoCommand new
  1007 		    workingCopy: (SVN::WorkingCopy branch: (SVN::Branch new) path: pkgDir);
  1007                     workingCopy: (SVN::WorkingCopy branch: (SVN::Branch new) path: pkgDir);
  1008 		    execute) anyOne revision]
  1008                     execute) anyOne revision]
  1009 			value
  1009                         value
  1010 			"/on: Error do: [revNr := nil]
  1010                         "/on: Error do: [revNr := nil]
  1011 			].
  1011                         ].
  1012     revNr ifNotNil:[^SVN::Revision number:revNr].
  1012     revNr ifNotNil:[^SVN::Revision number:revNr].
  1013     "2)"
  1013     "2)"
  1014     "We have to explicitly check for existence of svnRevisionNr,
  1014     "We have to explicitly check for existence of svnRevisionNr,
  1015      because we don't want to invoke inherited method"
  1015      because we don't want to invoke inherited method"
  1016     (self class methodDictionary includesKey: #svnRevisionNr)
  1016     (self class methodDictionary includesKey: #svnRevisionNr)
  1017 	ifTrue:[revNr := self perform:#svnRevisionNr].
  1017         ifTrue:[revNr := self perform:#svnRevisionNr].
  1018     revNr ifNotNil:[^SVN::Revision number:(revNr asString select:[:e|e isDigit])].
  1018     revNr ifNotNil:[^SVN::Revision number:(revNr asString select:[:e|e isDigit])].
  1019 
  1019 
  1020     "3)"
  1020     "3)"
  1021     revNr := (self searchForClassesWithProject: self package)
  1021     revNr := (self searchForClassesWithProject: self package)
  1022 		inject: 0
  1022                 inject: 0
  1023 		into:
  1023                 into:
  1024 		    [:rev :cls|
  1024                     [:rev :cls|
  1025 		    rev max: (cls revision ? '0') asNumber].
  1025                     rev max: (cls revision ? '0') asNumber].
  1026     ^revNr ~= 0
  1026     ^revNr ~= 0
  1027 	ifTrue: [SVN::Revision number:revNr]
  1027         ifTrue: [SVN::Revision number:revNr]
  1028 	ifFalse:[SVN::Revision head]
  1028         ifFalse:[SVN::Revision head]
  1029 
  1029 
  1030     "
  1030     "
  1031 	stx_libbasic svnRevision
  1031         stx_libbasic svnRevision
  1032 	stx_goodies_libsvn svnRevision
  1032         stx_goodies_libsvn svnRevision
  1033 	stx_goodies_libsvn revision
  1033         stx_goodies_libsvn revision
  1034 
  1034 
  1035     "
  1035     "
  1036 
  1036 
  1037     "Created: / 15-06-2009 / 11:54:33 / Jan Vrany <vranyj1@fel.cvut.cz>"
  1037     "Created: / 15-06-2009 / 11:54:33 / Jan Vrany <vranyj1@fel.cvut.cz>"
  1038     "Modified: / 22-08-2009 / 09:06:29 / Jan Vrany <vranyj1@fel.cvut.cz>"
  1038     "Modified: / 22-08-2009 / 09:06:29 / Jan Vrany <vranyj1@fel.cvut.cz>"
  1586     "Created: / 18-08-2006 / 16:14:19 / cg"
  1586     "Created: / 18-08-2006 / 16:14:19 / cg"
  1587 !
  1587 !
  1588 
  1588 
  1589 svnRevisionNr_code: revisionNrOrNil
  1589 svnRevisionNr_code: revisionNrOrNil
  1590     ^ String streamContents:[:s |
  1590     ^ String streamContents:[:s |
  1591 	s nextPutLine:'svnRevisionNr'.
  1591         s nextPutLine:'svnRevisionNr'.
  1592 	s nextPutLine:'    "Return a SVN revision number of myself.'.
  1592         s nextPutLine:'    "Return a SVN revision number of myself.'.
  1593 	s nextPutLine:'     This number is updated after a commit"'.
  1593         s nextPutLine:'     This number is updated after a commit"'.
  1594 	s cr;
  1594         s cr;
  1595 	nextPutLine:'    ^ "$SVN-Revision:"''', revisionNrOrNil printString , '''"$"'.
  1595         nextPutLine:'    ^ "$SVN-Revision:"''', revisionNrOrNil printString , '''"$"'.
  1596     ].
  1596     ].
  1597 
  1597 
  1598     "
  1598     "
  1599      self svnRevisionNr_code
  1599      self svnRevisionNr_code
  1600      stx_libbasic3 svnRevisionNr_code
  1600      stx_libbasic3 svnRevisionNr_code
  1887 additionalRulesSvn_make_dot_proto
  1887 additionalRulesSvn_make_dot_proto
  1888 
  1888 
  1889     (self class includesSelector: #svnRevisionNr) ifFalse:[^''].
  1889     (self class includesSelector: #svnRevisionNr) ifFalse:[^''].
  1890 
  1890 
  1891     ^ String streamContents:
  1891     ^ String streamContents:
  1892 	[:s|s
  1892         [:s|s
  1893 	nextPutLine:'update-svn-revision:';
  1893         nextPutLine:'update-svn-revision:';
  1894 	tab; nextPutLine: 'sed -i -e "s/\"\$$SVN\-Revision:\".*\"\$$\"/\"\$$SVN-Revision:\"''$(shell svnversion -n)''\"\$$\"/g" \';
  1894         tab; nextPutLine: 'sed -i -e "s/\"\$$SVN\-Revision:\".*\"\$$\"/\"\$$SVN-Revision:\"''$(shell svnversion -n)''\"\$$\"/g" \';
  1895 	tab; tab; nextPutLine: (self name , '.st');
  1895         tab; tab; nextPutLine: (self name , '.st');
  1896 	nextPutLine: '.PHONY: update-svn-revision']
  1896         nextPutLine: '.PHONY: update-svn-revision']
  1897 
  1897 
  1898     "Created: / 24-06-2009 / 21:33:32 / Jan Vrany <vranyj1@fel.cvut.cz>"
  1898     "Created: / 24-06-2009 / 21:33:32 / Jan Vrany <vranyj1@fel.cvut.cz>"
  1899 !
  1899 !
  1900 
  1900 
  1901 additionalRules_bc_dot_mak
  1901 additionalRules_bc_dot_mak
  2859     "Created: / 19-09-2006 / 22:47:43 / cg"
  2859     "Created: / 19-09-2006 / 22:47:43 / cg"
  2860 !
  2860 !
  2861 
  2861 
  2862 make_dot_proto_mappings
  2862 make_dot_proto_mappings
  2863     ^ Dictionary new
  2863     ^ Dictionary new
  2864 	at: 'TAB' put: ( Character tab asString );
  2864         at: 'TAB' put: ( Character tab asString );
  2865 	at: 'TOP' put: ( self pathToTop_unix );
  2865         at: 'TOP' put: ( self pathToTop_unix );
  2866 	at: 'LIBRARY_NAME' put: ( self libraryName );
  2866         at: 'LIBRARY_NAME' put: ( self libraryName );
  2867 	at: 'SUBDIRECTORIES' put: (self generateSubDirectories);
  2867         at: 'SUBDIRECTORIES' put: (self generateSubDirectories);
  2868 	at: 'LOCAL_INCLUDES' put: (self generateLocalIncludes_unix);
  2868         at: 'LOCAL_INCLUDES' put: (self generateLocalIncludes_unix);
  2869 	at: 'LOCAL_DEFINES' put: self localDefines_unix;
  2869         at: 'LOCAL_DEFINES' put: self localDefines_unix;
  2870 	at: 'GLOBAL_DEFINES' put: self globalDefines_unix;
  2870         at: 'GLOBAL_DEFINES' put: self globalDefines_unix;
  2871 	at: 'COMMONSYMFLAG' put: (self commonSymbolsFlag);
  2871         at: 'COMMONSYMFLAG' put: (self commonSymbolsFlag);
  2872 	at: 'HEADEROUTPUTARG' put: (self headerFileOutputArg);
  2872         at: 'HEADEROUTPUTARG' put: (self headerFileOutputArg);
  2873 	at: 'PRIMARY_TARGET' put: (self primaryTarget_make_dot_proto);
  2873         at: 'PRIMARY_TARGET' put: (self primaryTarget_make_dot_proto);
  2874 	at: 'ADDITIONAL_DEFINITIONS' put: (self additionalDefinitions_make_dot_proto);
  2874         at: 'ADDITIONAL_DEFINITIONS' put: (self additionalDefinitions_make_dot_proto);
  2875 	at: 'ADDITIONAL_RULES' put: (self additionalRules_make_dot_proto);
  2875         at: 'ADDITIONAL_RULES' put: (self additionalRules_make_dot_proto);
  2876 	at: 'ADDITIONAL_RULES_SVN' put: (self additionalRulesSvn_make_dot_proto);
  2876         at: 'ADDITIONAL_RULES_SVN' put: (self additionalRulesSvn_make_dot_proto);
  2877 	at: 'ADDITIONAL_TARGETS' put: (self additionalTargets_make_dot_proto);
  2877         at: 'ADDITIONAL_TARGETS' put: (self additionalTargets_make_dot_proto);
  2878 	at: 'ADDITIONAL_TARGETS_SVN' put: (self additionalTargetsSvn_make_dot_proto);
  2878         at: 'ADDITIONAL_TARGETS_SVN' put: (self additionalTargetsSvn_make_dot_proto);
  2879 	at: 'ADDITIONAL_LINK_LIBRARIES' put: (self additionalLinkLibraries_make_dot_proto);
  2879         at: 'ADDITIONAL_LINK_LIBRARIES' put: (self additionalLinkLibraries_make_dot_proto);
  2880 	at: 'ADDITIONAL_SHARED_LINK_LIBRARIES' put: (self additionalSharedLinkLibraries_make_dot_proto);
  2880         at: 'ADDITIONAL_SHARED_LINK_LIBRARIES' put: (self additionalSharedLinkLibraries_make_dot_proto);
  2881 	at: 'DEPENDENCIES' put: (self generateDependencies_unix);
  2881         at: 'DEPENDENCIES' put: (self generateDependencies_unix);
  2882 	at: 'MODULE' put: ( self module );
  2882         at: 'MODULE' put: ( self module );
  2883 	at: 'MODULE_DIRECTORY' put: ( self moduleDirectory );
  2883         at: 'MODULE_DIRECTORY' put: ( self moduleDirectory );
  2884 	at: 'MODULE_PATH' put: ( self moduleDirectory );
  2884         at: 'MODULE_PATH' put: ( self moduleDirectory );
  2885 	at: 'MAKE_PREREQUISITES' put: (self generateRequiredMakePrerequisites_make_dot_proto);
  2885         at: 'MAKE_PREREQUISITES' put: (self generateRequiredMakePrerequisites_make_dot_proto);
  2886 	yourself
  2886         yourself
  2887 
  2887 
  2888     "Created: / 09-08-2006 / 11:20:45 / fm"
  2888     "Created: / 09-08-2006 / 11:20:45 / fm"
  2889     "Modified: / 09-08-2006 / 16:44:48 / fm"
  2889     "Modified: / 09-08-2006 / 16:44:48 / fm"
  2890     "Modified: / 14-09-2006 / 18:57:52 / cg"
  2890     "Modified: / 14-09-2006 / 18:57:52 / cg"
  2891     "Modified: / 24-06-2009 / 21:50:13 / Jan Vrany <vranyj1@fel.cvut.cz>"
  2891     "Modified: / 24-06-2009 / 21:50:13 / Jan Vrany <vranyj1@fel.cvut.cz>"
  4605      Answer true, if classes have been loaded"
  4605      Answer true, if classes have been loaded"
  4606 
  4606 
  4607     |classNamesToLoad classNamesToAutoload hasClassesToLoad loadedClasses platformName
  4607     |classNamesToLoad classNamesToAutoload hasClassesToLoad loadedClasses platformName
  4608      classesWhichFailedToLoad|
  4608      classesWhichFailedToLoad|
  4609 
  4609 
  4610     Transcript showCR:('  %1: filing in classes individually...' bindWith:self name).
       
  4611 
       
  4612     platformName := OperatingSystem platformName.
  4610     platformName := OperatingSystem platformName.
  4613     classNamesToLoad := OrderedCollection new.
  4611     classNamesToLoad := OrderedCollection new.
  4614     classNamesToAutoload := OrderedCollection new.
  4612     classNamesToAutoload := OrderedCollection new.
  4615 
  4613 
  4616     hasClassesToLoad := false.
  4614     hasClassesToLoad := false.
  4633             ].
  4631             ].
  4634         ].
  4632         ].
  4635     ].
  4633     ].
  4636 
  4634 
  4637     hasClassesToLoad ifTrue:[
  4635     hasClassesToLoad ifTrue:[
       
  4636         Transcript showCR:('  %1: filing in missing classes individually...' bindWith:self name).
       
  4637 
  4638         loadedClasses := OrderedCollection new.
  4638         loadedClasses := OrderedCollection new.
  4639 
  4639 
  4640         self packageDirectory isNil ifTrue:[
  4640         self packageDirectory isNil ifTrue:[
  4641             self 
  4641             self 
  4642                 error:(self name,'[error] cannot install because packageDirectory is unknown')
  4642                 error:(self name,'[error] cannot install because packageDirectory is unknown')
  5311 ! !
  5311 ! !
  5312 
  5312 
  5313 !ProjectDefinition class methodsFor:'documentation'!
  5313 !ProjectDefinition class methodsFor:'documentation'!
  5314 
  5314 
  5315 version
  5315 version
  5316     ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.303 2010-02-26 13:41:05 cg Exp $'
  5316     ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.304 2010-02-26 13:44:41 cg Exp $'
  5317 !
  5317 !
  5318 
  5318 
  5319 version_CVS
  5319 version_CVS
  5320     ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.303 2010-02-26 13:41:05 cg Exp $'
  5320     ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.304 2010-02-26 13:44:41 cg Exp $'
  5321 ! !
  5321 ! !
  5322 
  5322 
  5323 ProjectDefinition initialize!
  5323 ProjectDefinition initialize!