ProjectDefinition.st
changeset 23866 75b931b9ed4e
parent 23865 6dacda4be899
child 24342 e1077b14f110
equal deleted inserted replaced
23865:6dacda4be899 23866:75b931b9ed4e
     1 "{ Encoding: utf8 }"
       
     2 
       
     3 "
     1 "
     4  COPYRIGHT (c) 2006 by eXept Software AG
     2  COPYRIGHT (c) 2006 by eXept Software AG
     5 	      All Rights Reserved
     3 	      All Rights Reserved
     6 
     4 
     7  This software is furnished under a license and may be used
     5  This software is furnished under a license and may be used
   212 
   210 
   213 "
   211 "
   214 ! !
   212 ! !
   215 
   213 
   216 !ProjectDefinition class methodsFor:'instance creation'!
   214 !ProjectDefinition class methodsFor:'instance creation'!
       
   215 
       
   216 definitionClassForMonticelloPackage:aMonicelloPackagename
       
   217     ^ self definitionClassForMonticelloPackage:aMonicelloPackagename createIfAbsent:false
       
   218 
       
   219     "
       
   220      self definitionClassForMonticelloPackage:'foobar'
       
   221     "
       
   222 !
       
   223 
       
   224 definitionClassForMonticelloPackage:aMonicelloPackagename createIfAbsent:createIfAbsent
       
   225     ^ self allSubclasses
       
   226         detect:[:eachProjectDefinition |
       
   227             eachProjectDefinition monticelloPackageName = aMonicelloPackagename ]
       
   228         ifNone:[
       
   229             |dfn squeakPackageInfo|
       
   230 
       
   231             createIfAbsent ifTrue:[
       
   232                 dfn := ApplicationDefinition
       
   233                     definitionClassForPackage:'mc:',aMonicelloPackagename createIfAbsent:true projectType:GUIApplicationType.
       
   234 
       
   235                 "/ if the squeak-stuff is loaded, use it.
       
   236                 PackageInfo notNil ifTrue:[
       
   237                     squeakPackageInfo := PackageInfo allSubclasses
       
   238                                             detect:[:pi | pi new packageName = aMonicelloPackagename] ifNone:nil.
       
   239                 ].
       
   240 
       
   241                 squeakPackageInfo notNil ifTrue:[
       
   242                     dfn classNames:(squeakPackageInfo new classes collect:[:each | each name]).
       
   243                 ].
       
   244             ] ifFalse:[
       
   245                 nil
       
   246             ]
       
   247         ]
       
   248 
       
   249     "
       
   250      self definitionClassForMonticelloPackage:'foobar'
       
   251      self definitionClassForMonticelloPackage:'foobar' createIfAbsent:true
       
   252     "
       
   253 
       
   254     "Modified: / 30-10-2010 / 00:26:07 / cg"
       
   255 !
   217 
   256 
   218 definitionClassForPackage:aPackageID
   257 definitionClassForPackage:aPackageID
   219     "given a packageID (such as 'stx:libfoo/bar'), lookup the corresponding peoject definition class.
   258     "given a packageID (such as 'stx:libfoo/bar'), lookup the corresponding peoject definition class.
   220      Return it, or nil if not present"
   259      Return it, or nil if not present"
   221 
   260 
   937 
   976 
   938     "Created: / 28-06-2013 / 02:14:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   977     "Created: / 28-06-2013 / 02:14:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   939     "Modified (comment): / 28-06-2013 / 11:25:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   978     "Modified (comment): / 28-06-2013 / 11:25:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   940 ! !
   979 ! !
   941 
   980 
   942 
   981 !ProjectDefinition class methodsFor:'accessing - hg'!
       
   982 
       
   983 hgBinaryRevision
       
   984 
       
   985     "
       
   986     Answers Mercurial revision from which the package was compiled.
       
   987     If no binary revision is available, returns nil."
       
   988 
       
   989 
       
   990     | revInfo |
       
   991 
       
   992     self binaryRevisionString notNil ifTrue:[
       
   993         revInfo := HGRevisionInfo readFrom: self binaryRevisionString onError:[nil].
       
   994         revInfo notNil ifTrue:[
       
   995             ^revInfo changesetId
       
   996         ].
       
   997     ].
       
   998     ^nil
       
   999 
       
  1000 
       
  1001     "
       
  1002         stx_libbasic hgBinaryRevision
       
  1003         stx_libsvn hgBinaryRevision
       
  1004         stx_libscm_mercurial hgBinaryRevision
       
  1005 
       
  1006     "
       
  1007 
       
  1008     "Created: / 20-11-2012 / 23:58:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  1009 !
       
  1010 
       
  1011 hgLogicalRevision
       
  1012 
       
  1013     "
       
  1014     Answers Mercurial revision on which is this package based on logically.
       
  1015 
       
  1016     Revision is computed as follows:
       
  1017         1) Look, if receiver's version_HG method has a (hidden) annotation HGRevision:, 
       
  1018            if so, return its value.
       
  1019         2) If receiver's binary revision is not nil, return it.
       
  1020         3) Look into a package directory and if there is a Mercurial repository,
       
  1021            return working copy's revision"
       
  1022 
       
  1023     | versionMethod versionAnnotation revInfo pkgDir repoDir repo |
       
  1024 
       
  1025     "1 --- "
       
  1026 
       
  1027     versionMethod := self class compiledMethodAt: HGSourceCodeManager nameOfVersionMethodInClasses.
       
  1028     versionMethod notNil ifTrue:[
       
  1029         versionAnnotation := versionMethod annotationAt: #HGRevision:.
       
  1030         versionAnnotation notNil ifTrue:[
       
  1031             ^versionAnnotation revision
       
  1032         ].
       
  1033     ] ifFalse:[
       
  1034         HGSourceCodeManager compileVersionMethod:HGSourceCodeManager nameOfVersionMethodInClasses of:self for:'$Changeset: <not expanded> $'.
       
  1035         versionMethod := self class compiledMethodAt: HGSourceCodeManager nameOfVersionMethodInClasses.
       
  1036     ].
       
  1037     
       
  1038     "2 --- "
       
  1039     self binaryRevisionString notNil ifTrue:[
       
  1040         revInfo := HGRevisionInfo readFrom: self binaryRevisionString onError:[nil].
       
  1041         revInfo notNil ifTrue:[
       
  1042             ^revInfo changesetId
       
  1043         ].
       
  1044     ].
       
  1045 
       
  1046     "3 --- "
       
  1047     pkgDir := Smalltalk getPackageDirectoryForPackage: self package.
       
  1048     pkgDir notNil ifTrue:[
       
  1049         repoDir := HGRepository discover: pkgDir.
       
  1050         repoDir notNil ifTrue:[
       
  1051             | id |
       
  1052 
       
  1053             repo := HGRepository on: repoDir.
       
  1054             id := repo workingCopy changeset id.
       
  1055             versionMethod annotateWith: (HGRevisionAnnotation revision: id).
       
  1056             ^id
       
  1057         ]
       
  1058     ].
       
  1059 
       
  1060     "4 --- "
       
  1061     self breakPoint: #jv.
       
  1062     ^nil
       
  1063 
       
  1064 
       
  1065     "
       
  1066         stx_libbasic hgLogicalRevision
       
  1067         stx_libsvn hgLogicalRevision
       
  1068         stx_libscm_mercurial hgLogicalRevision
       
  1069 
       
  1070     "
       
  1071 
       
  1072     "Created: / 20-11-2012 / 23:54:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  1073     "Modified: / 14-01-2013 / 13:42:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  1074 !
       
  1075 
       
  1076 hgLogicalRevision: anHGChangesetId
       
  1077     "
       
  1078     Set Mercurial revision on which is this package based on logically.
       
  1079     To be called only from Mercurial support upon commit from image.
       
  1080     "
       
  1081 
       
  1082     | versionMethod |
       
  1083 
       
  1084     versionMethod := self class compiledMethodAt: HGSourceCodeManager nameOfVersionMethodInClasses.
       
  1085     versionMethod isNil ifTrue:[ 
       
  1086         self class compile:(self class 
       
  1087                                     versionMethodTemplateForSourceCodeManager:HGSourceCodeManager)
       
  1088                                     classified:'documentation'.
       
  1089         versionMethod := self class compiledMethodAt:HGSourceCodeManager nameOfVersionMethodInClasses.
       
  1090         versionMethod setPackage:self package.
       
  1091     ].
       
  1092     versionMethod annotateWith: 
       
  1093         (HGRevisionAnnotation revision: anHGChangesetId)
       
  1094 
       
  1095     "Created: / 20-02-2014 / 00:06:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  1096     "Modified: / 27-02-2014 / 22:16:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  1097 ! !
       
  1098 
       
  1099 !ProjectDefinition class methodsFor:'accessing - hg - settings'!
       
  1100 
       
  1101 hgEnsureCopyrightMethod
       
  1102     "If true, then #copyright method is automatically compiled in each class
       
  1103      (but iff project definition defines it)
       
  1104 
       
  1105      Default is true (compile such method) but if the repository is mirror of CVS and
       
  1106      you want to merge back to CVS at some point, you may want to not compile them
       
  1107      to keep changes against CVS minimal"
       
  1108 
       
  1109     ^true "default"
       
  1110 
       
  1111     "Created: / 09-10-2013 / 11:48:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  1112 !
       
  1113 
       
  1114 hgEnsureVersion_HGMethod
       
  1115     "If true, then #version_HG method is automatically compiled in each class.
       
  1116 
       
  1117      Default is true (compile such method) but if the repository is mirror of CVS and
       
  1118      you want to merge back to CVS at some point, you may want to not compile them
       
  1119      to keep changes against CVS minimal. 
       
  1120 
       
  1121      If false, version_HG is compiled only in classes that has been modified
       
  1122      and commited.
       
  1123 
       
  1124      Note that Mercurial can live without them
       
  1125      just fine"
       
  1126 
       
  1127     ^true "default"
       
  1128 
       
  1129     "Created: / 09-10-2013 / 11:50:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  1130 !
       
  1131 
       
  1132 hgRemoveContainesForDeletedClasses
       
  1133     "If true, then containers for removed classes are __AUTOMATICALLY__ removed from the
       
  1134      repositoru. If false, obsolete containes are kept.
       
  1135 
       
  1136      Default is true (remove obsolete containers) but if the repository is mirror of CVS and
       
  1137      you want to merge back to CVS at some point, you may want to return false to avoid deletions
       
  1138      of obsolete files. Usefull when branching off an old CVS repo with loads of mess."
       
  1139 
       
  1140     ^true "default"
       
  1141 
       
  1142     "Created: / 21-05-2013 / 16:44:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  1143 ! !
   943 
  1144 
   944 !ProjectDefinition class methodsFor:'accessing - packaging'!
  1145 !ProjectDefinition class methodsFor:'accessing - packaging'!
   945 
  1146 
   946 classNames:aCollectionOfClassNames
  1147 classNames:aCollectionOfClassNames
   947     "set the set of classes"
  1148     "set the set of classes"
  2440     "/ intentionally left blank, to be redefined by subclasses (i.e. real projects)
  2641     "/ intentionally left blank, to be redefined by subclasses (i.e. real projects)
  2441 
  2642 
  2442     "Modified: / 17-08-2006 / 19:59:26 / cg"
  2643     "Modified: / 17-08-2006 / 19:59:26 / cg"
  2443 ! !
  2644 ! !
  2444 
  2645 
       
  2646 !ProjectDefinition class methodsFor:'description - actions - hg'!
       
  2647 
       
  2648 hgPostLoad
       
  2649     "possibly update an version_HG"
       
  2650 
       
  2651     <postLoad>
       
  2652 
       
  2653     | dir repo versionMethod |
       
  2654 
       
  2655     HGRepository notNil ifTrue:[
       
  2656         self binaryRevisionString isNil ifTrue:[
       
  2657             dir := Smalltalk getPackageDirectoryForPackage: self package.
       
  2658             dir notNil ifTrue:[  
       
  2659                 dir := HGRepository discover: dir.
       
  2660                 dir notNil ifTrue:[
       
  2661                     repo := HGRepository on: dir.
       
  2662                     versionMethod := HGSourceCodeManager ensureVersionMethodInClass: self package: self package.
       
  2663                     versionMethod annotateWith: 
       
  2664                         (HGRevisionAnnotation revision: repo workingCopy changesetId)
       
  2665                 ].
       
  2666             ]
       
  2667         ].
       
  2668     ].
       
  2669 
       
  2670     "Created: / 26-11-2012 / 13:06:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  2671     "Modified: / 07-02-2014 / 10:59:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  2672 ! !
  2445 
  2673 
  2446 !ProjectDefinition class methodsFor:'description - compilation'!
  2674 !ProjectDefinition class methodsFor:'description - compilation'!
  2447 
  2675 
  2448 additionalBaseAddressDefinition_bc_dot_mak
  2676 additionalBaseAddressDefinition_bc_dot_mak
  2449     "allows for a base-address definition to be added to the bc.mak file.
  2677     "allows for a base-address definition to be added to the bc.mak file.
  2961     ^ #()
  3189     ^ #()
  2962 
  3190 
  2963     "Created: / 23-01-2007 / 19:08:27 / cg"
  3191     "Created: / 23-01-2007 / 19:08:27 / cg"
  2964 ! !
  3192 ! !
  2965 
  3193 
       
  3194 !ProjectDefinition class methodsFor:'description - java'!
       
  3195 
       
  3196 javaBundle
       
  3197     "Defines a Java code bundle provided by this package.
       
  3198      Used by STX:LIBJAVA"
       
  3199 
       
  3200     ^nil
       
  3201 
       
  3202     "Created: / 15-01-2013 / 16:49:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  3203 !
       
  3204 
       
  3205 javaClassPath
       
  3206     | bundle |
       
  3207 
       
  3208     bundle := self javaBundle.
       
  3209     ^ bundle notNil ifTrue:[ bundle classPath ] ifFalse: [ #() ]
       
  3210 
       
  3211     "Created: / 13-12-2011 / 23:48:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  3212     "Modified: / 21-01-2015 / 11:11:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  3213 !
       
  3214 
       
  3215 javaSourcePath
       
  3216     | bundle |
       
  3217 
       
  3218     bundle := self javaBundle.
       
  3219     ^ bundle notNil ifTrue:[ bundle sourcePath ] ifFalse: [ #() ]
       
  3220 
       
  3221     "Created: / 13-12-2011 / 23:49:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  3222     "Modified: / 21-01-2015 / 11:11:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  3223 ! !
       
  3224 
  2966 !ProjectDefinition class methodsFor:'description - project information'!
  3225 !ProjectDefinition class methodsFor:'description - project information'!
  2967 
  3226 
  2968 applicationAdditionalIconFileNames
  3227 applicationAdditionalIconFileNames
  2969     "Return the icon-filenames for additional icons of the application
  3228     "Return the icon-filenames for additional icons of the application
  2970     (empty collection if there are none)"
  3229     (empty collection if there are none)"
  3828      stx_projects_smalltalk generate_builder_baseline_dot_rbspec
  4087      stx_projects_smalltalk generate_builder_baseline_dot_rbspec
  3829 
  4088 
  3830     "
  4089     "
  3831 
  4090 
  3832     "Created: / 24-02-2011 / 11:38:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  4091     "Created: / 24-02-2011 / 11:38:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  4092 !
       
  4093 
       
  4094 generate_java_build_auto_dot_xml
       
  4095     <file: 'java/build.auto.xml' overwrite: true>
       
  4096 
       
  4097     self javaBundle isNil ifTrue:[ ^ nil ].
       
  4098     ^self
       
  4099 	replaceMappings: self java_build_auto_dot_xml_mappings
       
  4100 	in:              self java_build_auto_dot_xml
       
  4101 
       
  4102     "
       
  4103     stx_libjava_tools generate_java_build_auto_dot_xml
       
  4104     stx_libjava_experiments generate_java_build_auto_dot_xml
       
  4105 
       
  4106     "
       
  4107 
       
  4108     "Created: / 18-01-2015 / 07:32:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  4109     "Modified: / 19-01-2015 / 16:55:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  4110 !
       
  4111 
       
  4112 generate_java_build_dot_xml
       
  4113     <file: 'java/build.xml' overwrite: false>
       
  4114 
       
  4115     self javaBundle isNil ifTrue:[ ^ nil ].
       
  4116     ^self
       
  4117 	replaceMappings: self java_build_dot_xml_mappings
       
  4118 	in:              self java_build_dot_xml
       
  4119 
       
  4120     "
       
  4121     stx_libjava_tools generate_java_build_auto_dot_xml
       
  4122     stx_libjava_experiments generate_java_build_auto_dot_xml
       
  4123 
       
  4124     "
       
  4125 
       
  4126     "Created: / 19-01-2015 / 07:37:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  4127     "Modified: / 19-01-2015 / 16:32:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3833 !
  4128 !
  3834 
  4129 
  3835 generate_lccmake_dot_mak
  4130 generate_lccmake_dot_mak
  3836 
  4131 
  3837     ^self replaceMappings: self bmake_dot_mak_mappings
  4132     ^self replaceMappings: self bmake_dot_mak_mappings
  4178 	at: 'MODULE_DIRECTORY' put: ( self moduleDirectory );           "/ always unix format
  4473 	at: 'MODULE_DIRECTORY' put: ( self moduleDirectory );           "/ always unix format
  4179 	at: 'MODULE_PATH' put: ( 'depends-on-file(unix vs. win32)' );   "/ must be in specific mapping
  4474 	at: 'MODULE_PATH' put: ( 'depends-on-file(unix vs. win32)' );   "/ must be in specific mapping
  4180 	yourself
  4475 	yourself
  4181 
  4476 
  4182     "Created: / 04-09-2012 / 13:04:26 / cg"
  4477     "Created: / 04-09-2012 / 13:04:26 / cg"
       
  4478 !
       
  4479 
       
  4480 java_build_auto_dot_xml_mappings
       
  4481     ^ self common_mappings
       
  4482 	at: 'TOP' put: (self pathToTopWithSeparator:'/');
       
  4483 	at: 'PACKAGE_SLASHED' put:  (self package copyReplaceAll: $: with: $/);
       
  4484 	at: 'PACKAGE_DOTTED' put: ((self package copyReplaceAll: $: with: $/) replaceAll: $/ with: $.);
       
  4485 	at: 'BUILD_PREREQS_CLASSPATH_REFS'  put: (self generateJavaBuildPrereqsClasspathRefs);
       
  4486 	at: 'BUILD_PREREQS_CLASSPATH_PATHS' put: (self generateJavaBuildPrereqsClasspathPaths);
       
  4487 	at: 'BUILD_PREREQS'                 put: (self generateJavaBuildPrereqs);
       
  4488 	yourself
       
  4489 
       
  4490     "Created: / 18-01-2015 / 07:32:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  4491     "Modified: / 19-01-2015 / 07:21:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  4492 !
       
  4493 
       
  4494 java_build_dot_xml_mappings
       
  4495     ^ self common_mappings
       
  4496 	at: 'TOP' put: (self pathToTopWithSeparator:'/');
       
  4497 	at: 'PACKAGE_SLASHED' put:  (self package copyReplaceAll: $: with: $/);
       
  4498 	at: 'PACKAGE_DOTTED' put: ((self package copyReplaceAll: $: with: $/) replaceAll: $/ with: $.);
       
  4499 	yourself
       
  4500 
       
  4501     "Created: / 19-01-2015 / 07:37:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  4183 !
  4502 !
  4184 
  4503 
  4185 make_dot_proto_mappings
  4504 make_dot_proto_mappings
  4186     ^ self common_mappings
  4505     ^ self common_mappings
  4187 	at: 'MODULE' put: ( self module );
  4506 	at: 'MODULE' put: ( self module );
  5079     "generate submake-calls for visual-C"
  5398     "generate submake-calls for visual-C"
  5080 
  5399 
  5081     ^ self subProjectMakeCallsUsing:'call vcmake %1 %2'.
  5400     ^ self subProjectMakeCallsUsing:'call vcmake %1 %2'.
  5082 ! !
  5401 ! !
  5083 
  5402 
       
  5403 !ProjectDefinition class methodsFor:'file mappings support-Java'!
       
  5404 
       
  5405 generateJavaBuildPrereqs
       
  5406     ^ self generateJavaBuildPrereqsUsingTemplate:
       
  5407 
       
  5408 '    <target name="prereqs.%(PREREQ_PACKAGE_DOTTED)" extensionOf="prereqs.main">
       
  5409 	<ant antfile="${TOP}/../%(PREREQ_PACKAGE_SLASHED)/java/build.xml"
       
  5410 	     target="${ant.project.invoked-targets}"
       
  5411 	     inheritAll="false"
       
  5412 	     useNativeBasedir="true"/>
       
  5413     </target>
       
  5414 '
       
  5415 
       
  5416     "Created: / 18-01-2015 / 07:40:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  5417     "Modified: / 19-01-2015 / 07:27:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  5418 !
       
  5419 
       
  5420 generateJavaBuildPrereqsClasspathPaths
       
  5421     ^ self generateJavaBuildPrereqsUsingTemplate:
       
  5422 
       
  5423 '    <path id="build.classpath.prereqs.%(PREREQ_PACKAGE_DOTTED)">
       
  5424 	<pathelement path="${TOP}/../%(PREREQ_PACKAGE_SLASHED)/java/bin"/>
       
  5425 	<fileset dir="${TOP}/../%(PREREQ_PACKAGE_SLASHED)/java/libs" includes="*.jar"/>
       
  5426     </path>
       
  5427 '
       
  5428 
       
  5429     "Created: / 18-01-2015 / 07:40:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  5430     "Modified: / 19-01-2015 / 07:27:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  5431 !
       
  5432 
       
  5433 generateJavaBuildPrereqsClasspathRefs
       
  5434     ^ self generateJavaBuildPrereqsUsingTemplate:
       
  5435 
       
  5436 '       <path refid="build.classpath.prereqs.%(PREREQ_PACKAGE_DOTTED)"/>
       
  5437 '
       
  5438 
       
  5439     "Created: / 18-01-2015 / 07:40:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  5440 !
       
  5441 
       
  5442 generateJavaBuildPrereqsUsingTemplate: template
       
  5443     | mappings |
       
  5444 
       
  5445     mappings := Dictionary new.
       
  5446     mappings at: 'PACKAGE_SLASHED' put:  (self package copyReplaceAll: $: with: $/).
       
  5447     mappings at: 'PACKAGE_DOTTED' put: ((self package copyReplaceAll: $: with: $/) replaceAll: $/ with: $.).
       
  5448 
       
  5449     ^ String streamContents:[ :s |
       
  5450 	((self preRequisitesFor: self package) asArray sort) do:[:each |
       
  5451 	    | def |
       
  5452 
       
  5453 	    def := ProjectDefinition definitionClassForPackage: each createIfAbsent: false.
       
  5454 	    def javaBundle notNil ifTrue: [
       
  5455 		mappings at: 'PREREQ_PACKAGE_SLASHED' put:  (each copyReplaceAll: $: with: $/).
       
  5456 		mappings at: 'PREREQ_PACKAGE_DOTTED' put: ((each copyReplaceAll: $: with: $/) replaceAll: $/ with: $.).
       
  5457 		s nextPutAll: (template expandPlaceholdersWith: mappings)
       
  5458 	    ]
       
  5459 	].
       
  5460     ]
       
  5461 
       
  5462     "Created: / 18-01-2015 / 07:43:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  5463     "Modified: / 19-01-2015 / 07:29:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  5464 ! !
       
  5465 
  5084 !ProjectDefinition class methodsFor:'file templates'!
  5466 !ProjectDefinition class methodsFor:'file templates'!
  5085 
  5467 
  5086 autopackage_default_dot_apspec
  5468 autopackage_default_dot_apspec
  5087     "for linux's autopackage"
  5469     "for linux's autopackage"
  5088 
  5470 
  5265     ^ MacPlistXMLCoder encode:plist
  5647     ^ MacPlistXMLCoder encode:plist
  5266 
  5648 
  5267     "
  5649     "
  5268      exept_expecco_application info_dot_plist
  5650      exept_expecco_application info_dot_plist
  5269     "
  5651     "
       
  5652 !
       
  5653 
       
  5654 java_build_auto_dot_xml
       
  5655     "Template for java/build.auto.xml"
       
  5656 ^ '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
       
  5657 <!!-- This file has been generated by STX:LIBJAVA. Do not edit!! Edit build.xml instead -->
       
  5658 <project>
       
  5659     <property name="TOP" value="../%(TOP)" />
       
  5660     <import file="${TOP}/libjava/java/build.common.xml"/>
       
  5661 
       
  5662     <path id="build.classpath.prereqs">
       
  5663 %(BUILD_PREREQS_CLASSPATH_REFS)
       
  5664     </path>
       
  5665 
       
  5666 %(BUILD_PREREQS_CLASSPATH_PATHS)
       
  5667 
       
  5668 %(BUILD_PREREQS)
       
  5669 
       
  5670 </project>
       
  5671 '
       
  5672 
       
  5673     "Created: / 18-01-2015 / 07:32:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  5674     "Modified: / 19-01-2015 / 07:23:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  5675 !
       
  5676 
       
  5677 java_build_dot_xml
       
  5678     "Template for java/build.xml"
       
  5679 ^ '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
       
  5680 <project name="%(PACKAGE_DITTED)" default="compile" basedir=".">
       
  5681     <import file="build.auto.xml"/>
       
  5682     <!!-- Put custom build code here, this file is never overwritten by Smalltalk/X -->
       
  5683 </project>
       
  5684 '
       
  5685 
       
  5686     "Created: / 19-01-2015 / 07:35:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  5270 !
  5687 !
  5271 
  5688 
  5272 lccmake_dot_mak
  5689 lccmake_dot_mak
  5273     "the template code for the lccmake.bat file"
  5690     "the template code for the lccmake.bat file"
  5274 
  5691 
  5798     ^ true
  6215     ^ true
  5799 
  6216 
  5800     "Modified: / 20-11-2012 / 23:06:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  6217     "Modified: / 20-11-2012 / 23:06:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  5801 ! !
  6218 ! !
  5802 
  6219 
       
  6220 !ProjectDefinition class methodsFor:'misc ui support'!
       
  6221 
       
  6222 iconInBrowserSymbol
       
  6223     "the browser will use this as index into the toolbariconlibrary"
       
  6224 
       
  6225     <resource: #programImage>
       
  6226 
       
  6227     self theNonMetaclass isApplicationDefinition ifTrue:[
       
  6228         self theNonMetaclass isGUIApplication ifTrue:[
       
  6229             ^ #guiApplicationDefinitionClassIcon
       
  6230         ].
       
  6231         ^ #applicationDefinitionClassIcon
       
  6232     ].
       
  6233     ^ super iconInBrowserSymbol
       
  6234 ! !
  5803 
  6235 
  5804 !ProjectDefinition class methodsFor:'private'!
  6236 !ProjectDefinition class methodsFor:'private'!
  5805 
  6237 
  5806 abbrevs
  6238 abbrevs
  5807     "return a dictionary containing my abbreviations;
  6239     "return a dictionary containing my abbreviations;
  8137 projectType
  8569 projectType
  8138     ^ self subclassResponsibility
  8570     ^ self subclassResponsibility
  8139 !
  8571 !
  8140 
  8572 
  8141 reasonForNotSupportedOnPlatform
  8573 reasonForNotSupportedOnPlatform
  8142     "answer false, if this package is not suitable for
  8574     "answer a reason string, why the package is not supported on this platform
  8143      the current platform. The default here returns true.
  8575      (if it is not, i.e. if supportedByPlatform returns false)"
  8144      Only to be redefined in packages which are definitely not valid
  8576 
  8145      for the given platform. For example, the OLE package is only
  8577     ^ 'not supported by this OS-platform'
  8146      usable under windows"
       
  8147 
       
  8148     self preRequisites do:[:eachProjectDefinitionClassNameSymbol|
       
  8149         |cls|
       
  8150         cls := self definitionClassForPackage:eachProjectDefinitionClassNameSymbol.
       
  8151         cls isNil ifTrue:[
       
  8152             ^ 'Prerequisite package "', eachProjectDefinitionClassNameSymbol, '" is missing'.
       
  8153         ].
       
  8154         cls supportedOnPlatform ifFalse:[
       
  8155             ^ 'Prerequisite package "', eachProjectDefinitionClassNameSymbol, '" is not supported: ', cls reasonForNotSupportedOnPlatform.
       
  8156         ].
       
  8157     ].
       
  8158     ^ ''.
       
  8159 
  8578 
  8160     "Created: / 07-02-2019 / 14:21:54 / Claus Gittinger"
  8579     "Created: / 07-02-2019 / 14:21:54 / Claus Gittinger"
  8161     "Modified: / 12-03-2019 / 15:26:07 / Stefan Vogel"
       
  8162 !
  8580 !
  8163 
  8581 
  8164 supportedOnPlatform
  8582 supportedOnPlatform
  8165     "answer false, if this package is not suitable for
  8583     "answer false, if this package is not suitable for
  8166      the current platform. The default here returns true.
  8584      the current platform. The default here returns true.
  8167      Only to be redefined in packages which are definitely not valid
  8585      Only to be redefined in packages which are definitely not valid
  8168      for the given platform. For example, the OLE package is only
  8586      for the given platform. For example, the OLE package is only
  8169      usable under windows"
  8587      usable under windows"
  8170 
  8588 
  8171     self preRequisites do:[:eachProjectDefinitionClassNameSymbol|
  8589     ^ true
  8172         |cls|
       
  8173         cls := self definitionClassForPackage:eachProjectDefinitionClassNameSymbol.
       
  8174         cls isNil ifTrue:[
       
  8175             ^ false.    "prerequisite project is missing"
       
  8176         ].
       
  8177         cls supportedOnPlatform ifFalse:[
       
  8178             ^ false.
       
  8179         ].
       
  8180     ].
       
  8181     ^ true.
       
  8182 
       
  8183     "Modified: / 12-03-2019 / 15:26:00 / Stefan Vogel"
       
  8184 !
  8590 !
  8185 
  8591 
  8186 whoReferences:aPackageString
  8592 whoReferences:aPackageString
  8187     "answer, which package references directly or indirectly a package defined by aPackageString"
  8593     "answer, which package references directly or indirectly a package defined by aPackageString"
  8188 
  8594 
  8473 
  8879 
  8474     "Created: / 23-08-2006 / 15:17:46 / cg"
  8880     "Created: / 23-08-2006 / 15:17:46 / cg"
  8475     "Modified: / 20-09-2006 / 15:00:00 / cg"
  8881     "Modified: / 20-09-2006 / 15:00:00 / cg"
  8476 !
  8882 !
  8477 
  8883 
       
  8884 isPluginDefinition
       
  8885     ^ false
       
  8886 !
       
  8887 
  8478 isProjectDefinition
  8888 isProjectDefinition
  8479     "concrete i.e. not abstract"
  8889     "concrete i.e. not abstract"
  8480 
  8890 
  8481     ^ self isAbstract not
  8891     ^ self isAbstract not
  8482 
  8892