author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Thu, 01 May 2014 10:22:04 +0100 | |
changeset 426 | 1933163ba3bb |
parent 394 | 1f009c523329 |
child 454 | d17370e0936e |
permissions | -rw-r--r-- |
44 | 1 |
" |
335
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
302
diff
changeset
|
2 |
stx:libscm - a new source code management library for Smalltalk/X |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
302
diff
changeset
|
3 |
Copyright (C) 2012-2013 Jan Vrany |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
302
diff
changeset
|
4 |
|
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
302
diff
changeset
|
5 |
This library is free software; you can redistribute it and/or |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
302
diff
changeset
|
6 |
modify it under the terms of the GNU Lesser General Public |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
302
diff
changeset
|
7 |
License as published by the Free Software Foundation; either |
394 | 8 |
version 2.1 of the License. |
44 | 9 |
|
335
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
302
diff
changeset
|
10 |
This library is distributed in the hope that it will be useful, |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
302
diff
changeset
|
11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
302
diff
changeset
|
12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
302
diff
changeset
|
13 |
Lesser General Public License for more details. |
44 | 14 |
|
335
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
302
diff
changeset
|
15 |
You should have received a copy of the GNU Lesser General Public |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
302
diff
changeset
|
16 |
License along with this library; if not, write to the Free Software |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
302
diff
changeset
|
17 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
44 | 18 |
" |
19 |
"{ Package: 'stx:libscm/common' }" |
|
20 |
||
21 |
SCMAbstractTask subclass:#SCMAbstractFileoutLikeTask |
|
22 |
instanceVariableNames:'suppressClasses suppressExtensions suppresBuildSupportFiles |
|
348
a9647072025f
More support for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
23 |
packageClassesChanged packageExtensionsChanged extensionMethods |
a9647072025f
More support for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
24 |
fileout2codeMap' |
44 | 25 |
classVariableNames:'' |
26 |
poolDictionaries:'' |
|
27 |
category:'SCM-Common-StX-Tasks' |
|
28 |
! |
|
29 |
||
30 |
!SCMAbstractFileoutLikeTask class methodsFor:'documentation'! |
|
31 |
||
32 |
copyright |
|
33 |
" |
|
335
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
302
diff
changeset
|
34 |
stx:libscm - a new source code management library for Smalltalk/X |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
302
diff
changeset
|
35 |
Copyright (C) 2012-2013 Jan Vrany |
44 | 36 |
|
335
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
302
diff
changeset
|
37 |
This library is free software; you can redistribute it and/or |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
302
diff
changeset
|
38 |
modify it under the terms of the GNU Lesser General Public |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
302
diff
changeset
|
39 |
License as published by the Free Software Foundation; either |
394 | 40 |
version 2.1 of the License. |
44 | 41 |
|
335
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
302
diff
changeset
|
42 |
This library is distributed in the hope that it will be useful, |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
302
diff
changeset
|
43 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
302
diff
changeset
|
44 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
302
diff
changeset
|
45 |
Lesser General Public License for more details. |
44 | 46 |
|
335
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
302
diff
changeset
|
47 |
You should have received a copy of the GNU Lesser General Public |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
302
diff
changeset
|
48 |
License along with this library; if not, write to the Free Software |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
302
diff
changeset
|
49 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
44 | 50 |
" |
51 |
! ! |
|
52 |
||
53 |
!SCMAbstractFileoutLikeTask methodsFor:'accessing'! |
|
54 |
||
55 |
extensionMethods |
|
56 |
^ extensionMethods |
|
57 |
! |
|
58 |
||
59 |
extensionMethods:aCollection"of Methods" |
|
60 |
||
61 |
extensionMethods := aCollection. |
|
62 |
||
63 |
"Modified: / 14-05-2009 / 13:38:15 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
64 |
! |
|
65 |
||
66 |
filesToGenerate |
|
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
67 |
self error: 'Should not be sent'. |
44 | 68 |
^ self packageDefinition fileNamesToGenerate keys |
69 |
||
70 |
" |
|
394 | 71 |
SVN::CommitTask new |
72 |
package: #stx:libsvn; |
|
73 |
buildSupportFiles" |
|
44 | 74 |
|
75 |
"Created: / 27-11-2009 / 11:29:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
76 |
"Modified: / 22-02-2014 / 22:31:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
77 |
! |
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
78 |
|
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
79 |
filesToGenerateFor: package |
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
80 |
^ package definition fileNamesToGenerate keys |
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
81 |
|
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
82 |
" |
394 | 83 |
SVN::CommitTask new |
84 |
package: #stx:libsvn; |
|
85 |
buildSupportFiles" |
|
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
86 |
|
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
87 |
"Created: / 22-02-2014 / 22:31:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
44 | 88 |
! |
89 |
||
90 |
packageDefinition |
|
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
91 |
self error: 'Should not be sent'. |
44 | 92 |
^self package definition |
93 |
||
94 |
"Created: / 27-11-2009 / 11:27:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
95 |
"Modified: / 21-02-2014 / 22:53:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
44 | 96 |
! |
97 |
||
98 |
suppresBuildSupportFiles |
|
99 |
^ suppresBuildSupportFiles |
|
100 |
! |
|
101 |
||
102 |
suppresBuildSupportFiles:something |
|
103 |
suppresBuildSupportFiles := something. |
|
104 |
! |
|
105 |
||
106 |
suppressClasses |
|
107 |
^ suppressClasses |
|
108 |
! |
|
109 |
||
110 |
suppressClasses:aBoolean |
|
111 |
suppressClasses := aBoolean. |
|
112 |
! |
|
113 |
||
114 |
suppressExtensions |
|
115 |
^ suppressExtensions |
|
116 |
! |
|
117 |
||
118 |
suppressExtensions:aBoolean |
|
119 |
suppressExtensions := aBoolean. |
|
120 |
! ! |
|
121 |
||
122 |
!SCMAbstractFileoutLikeTask methodsFor:'executing - private'! |
|
123 |
||
124 |
doAddNewContainers |
|
387
ebec1ef28839
Added notion if 'virtual' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
381
diff
changeset
|
125 |
packages do:[:each | each isVirtual ifFalse: [ self doAddNewContainersFor: each ] ] |
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
126 |
|
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
127 |
"Created: / 11-04-2008 / 10:58:53 / Jan Vrany <vranyj1@fel.cvut.cz>" |
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
128 |
"Modified: / 19-08-2009 / 14:00:26 / Jan Vrany <vranyj1@fel.cvut.cz>" |
387
ebec1ef28839
Added notion if 'virtual' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
381
diff
changeset
|
129 |
"Modified: / 27-02-2014 / 22:55:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
130 |
! |
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
131 |
|
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
132 |
doAddNewContainersFor: package |
53
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
133 |
| wcroot containers | |
44 | 134 |
|
135 |
ActivityNotification notify:'Adding new containers'. |
|
394 | 136 |
containers := |
137 |
self isSelectiveFileoutTask |
|
138 |
ifTrue:[#()] |
|
139 |
ifFalse:[self containersToFileOutFor: package]. |
|
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
140 |
wcroot := package temporaryWorkingCopyRoot. |
53
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
141 |
containers do:[:nm| |
394 | 142 |
| entry | |
53
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
143 |
|
394 | 144 |
entry := wcroot / nm. |
145 |
entry track. |
|
44 | 146 |
] |
147 |
||
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
148 |
"Created: / 22-02-2014 / 22:49:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
44 | 149 |
! |
150 |
||
151 |
doCompileCopyrightMethods |
|
387
ebec1ef28839
Added notion if 'virtual' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
381
diff
changeset
|
152 |
packages do:[:each | each isVirtual ifFalse: [ self doCompileCopyrightMethodsFor: each ] ] |
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
153 |
|
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
154 |
"Modified: / 16-08-2009 / 12:59:50 / Jan Vrany <vranyj1@fel.cvut.cz>" |
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
155 |
"Created: / 08-04-2010 / 14:31:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
387
ebec1ef28839
Added notion if 'virtual' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
381
diff
changeset
|
156 |
"Modified: / 27-02-2014 / 22:55:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
157 |
! |
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
158 |
|
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
159 |
doCompileCopyrightMethodsFor: package |
44 | 160 |
| klasses source | |
161 |
||
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
162 |
(package definition class includesSelector: #copyright) ifFalse:[^self]. |
44 | 163 |
ActivityNotification notify:'Compiling #copyright methods...'. |
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
164 |
klasses := (self classesToFileOutFor: package) asArray. |
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
165 |
source := (package definition class compiledMethodAt: #copyright) source. |
44 | 166 |
|
394 | 167 |
klasses |
168 |
withIndexDo:[:cls :index | |
|
169 |
|metaCls| |
|
170 |
metaCls := cls theMetaclass. |
|
171 |
(((metaCls includesSelector:#copyright) not) and:[metaCls programmingLanguage isSmalltalk]) |
|
172 |
ifTrue:[ |
|
173 |
metaCls compile:source classified:'documentation'. |
|
174 |
(metaCls compiledMethodAt:#copyright) |
|
175 |
setPackage:package name asSymbol |
|
176 |
]. |
|
177 |
ProgressNotification newException |
|
178 |
messageText: ('Compiling %1 (%2)' bindWith:#copyright |
|
179 |
with:cls nameWithoutPrefix); |
|
180 |
parameter: (100 / klasses size) * index; |
|
181 |
raiseRequest. |
|
182 |
] |
|
44 | 183 |
|
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
184 |
"Created: / 21-02-2014 / 22:59:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
44 | 185 |
! |
186 |
||
187 |
doCompileVersionMethods |
|
387
ebec1ef28839
Added notion if 'virtual' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
381
diff
changeset
|
188 |
packages do:[:each | |
394 | 189 |
each isVirtual ifFalse: [ |
190 |
| klasses | |
|
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
191 |
|
394 | 192 |
klasses := self classesToFileOutFor: each. |
193 |
self doCompileVersionMethodsFor: each in: klasses asArray. |
|
194 |
] |
|
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
195 |
]. |
353
456532e0478c
Added more support for HG mirrors of CVS repos.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
348
diff
changeset
|
196 |
|
456532e0478c
Added more support for HG mirrors of CVS repos.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
348
diff
changeset
|
197 |
"Created: / 09-10-2013 / 11:57:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
387
ebec1ef28839
Added notion if 'virtual' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
381
diff
changeset
|
198 |
"Modified: / 27-02-2014 / 22:55:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
353
456532e0478c
Added more support for HG mirrors of CVS repos.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
348
diff
changeset
|
199 |
! |
456532e0478c
Added more support for HG mirrors of CVS repos.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
348
diff
changeset
|
200 |
|
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
201 |
doCompileVersionMethodsFor: package in: klasses |
353
456532e0478c
Added more support for HG mirrors of CVS repos.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
348
diff
changeset
|
202 |
| versionMethodName| |
44 | 203 |
|
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
204 |
versionMethodName := package manager nameOfVersionMethodInClasses. |
44 | 205 |
ActivityNotification notify:'Compiling #version methods...'. |
394 | 206 |
klasses |
207 |
withIndexDo:[:cls :index | |
|
208 |
|metaCls| |
|
44 | 209 |
|
394 | 210 |
metaCls := cls theMetaclass. |
211 |
((metaCls includesSelector:versionMethodName) not |
|
212 |
"JV@2012-11-14: libsvn did this check, however, it is not valid for |
|
213 |
SCMs that does not expand keywords. I disable it, but kept as comment |
|
214 |
as I do not remember why it was good for..." |
|
215 |
"or:[ ((cls perform:versionMethodName asSymbol) startsWith:'$Id') not ]") |
|
216 |
ifTrue:[ |
|
217 |
metaCls compile:(metaCls |
|
218 |
versionMethodTemplateForSourceCodeManager:package manager) |
|
219 |
classified:'documentation'. |
|
220 |
(metaCls compiledMethodAt:versionMethodName) |
|
221 |
setPackage:package name asSymbol |
|
222 |
]. |
|
223 |
package manager utilities ensureCorrectVersionMethodsInClass: cls usingManager: package manager. |
|
224 |
^ ProgressNotification newException |
|
225 |
messageText: ('Compiling %1 (%2)' bindWith:versionMethodName |
|
226 |
with:cls nameWithoutPrefix); |
|
227 |
parameter: (100 / klasses size) * index; |
|
228 |
raiseRequest |
|
229 |
]. |
|
44 | 230 |
|
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
231 |
(self extensionMethodsToFileOutFor: package) notEmpty ifTrue:[ |
394 | 232 |
| def | |
44 | 233 |
|
394 | 234 |
"TODO: Not programming language aware..." |
235 |
((def := package definition) class includesSelector: package manager nameOfVersionMethodForExtensions) ifFalse:[ |
|
236 |
def class |
|
237 |
compile: |
|
238 |
(package manager versionMethodTemplateForSmalltalkFor:package manager nameOfVersionMethodForExtensions) |
|
239 |
classified: #documentation. |
|
240 |
(def class compiledMethodAt:package manager nameOfVersionMethodForExtensions) |
|
241 |
setPackage:package name asSymbol |
|
44 | 242 |
|
394 | 243 |
] |
44 | 244 |
] |
245 |
||
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
246 |
"Created: / 21-02-2014 / 23:01:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
44 | 247 |
! |
248 |
||
122
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
249 |
doFileOut |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
250 |
"Fileouts everything to the working copy" |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
251 |
|
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
252 |
self |
394 | 253 |
doUpdateBuildSupportFiles; |
254 |
doRenameContainers; |
|
255 |
doFileOutPackageClasses; |
|
256 |
doFileOutPackageExtensions; |
|
257 |
doAddNewContainers; |
|
258 |
doRemoveOldContainers. |
|
122
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
259 |
|
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
260 |
"Created: / 10-05-2012 / 17:05:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
261 |
"Modified: / 21-11-2012 / 00:43:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
262 |
! |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
263 |
|
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
264 |
doFileOutAll |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
265 |
|
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
266 |
self |
394 | 267 |
doUpdateCode; |
268 |
doFileOut. |
|
122
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
269 |
|
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
270 |
"Created: / 17-08-2009 / 18:28:18 / Jan Vrany <vranyj1@fel.cvut.cz>" |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
271 |
"Modified: / 10-05-2012 / 17:06:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
272 |
! |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
273 |
|
44 | 274 |
doFileOutPackageClasses |
387
ebec1ef28839
Added notion if 'virtual' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
381
diff
changeset
|
275 |
packages do:[:each | each isVirtual ifFalse: [ self doFileOutPackageClassesFor: each ] ]. |
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
276 |
|
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
277 |
"Created: / 11-04-2008 / 10:58:16 / Jan Vrany <vranyj1@fel.cvut.cz>" |
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
278 |
"Modified: / 19-08-2009 / 13:44:00 / Jan Vrany <vranyj1@fel.cvut.cz>" |
387
ebec1ef28839
Added notion if 'virtual' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
381
diff
changeset
|
279 |
"Modified: / 27-02-2014 / 22:55:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
280 |
! |
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
281 |
|
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
282 |
doFileOutPackageClassesFor: package |
44 | 283 |
|klasses| |
284 |
||
285 |
suppressClasses == true ifTrue:[^self]. |
|
286 |
||
287 |
ActivityNotification notify:'Filing out package classes'. |
|
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
288 |
klasses := (self classesToFileOutFor: package) asArray. |
394 | 289 |
klasses |
290 |
withIndexDo:[:cls :index | |
|
291 |
|clsStream| |
|
292 |
ProgressNotification newException |
|
293 |
messageText: 'Filing out ' , cls nameWithoutPrefix; |
|
294 |
parameter: (100 / klasses size) * index; |
|
295 |
raiseRequest. |
|
44 | 296 |
|
394 | 297 |
(self shouldFileOutClass:cls) ifTrue:[package fileOutClass: cls] |
298 |
]. |
|
44 | 299 |
|
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
300 |
"Created: / 21-02-2014 / 23:09:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
44 | 301 |
! |
302 |
||
303 |
doFileOutPackageExtensions |
|
387
ebec1ef28839
Added notion if 'virtual' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
381
diff
changeset
|
304 |
packages do:[:each | each isVirtual ifFalse: [ self doFileOutPackageExtensionsFor: each ] ] |
44 | 305 |
|
306 |
"Modified: / 07-04-2008 / 08:37:25 / janfrog" |
|
307 |
"Created: / 11-04-2008 / 10:58:36 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
308 |
"Modified: / 14-05-2009 / 13:37:40 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
387
ebec1ef28839
Added notion if 'virtual' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
381
diff
changeset
|
309 |
"Modified: / 27-02-2014 / 22:55:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
310 |
! |
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
311 |
|
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
312 |
doFileOutPackageExtensionsFor: package |
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
313 |
| extensions | |
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
314 |
|
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
315 |
suppressExtensions == true ifTrue:[^self]. |
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
316 |
|
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
317 |
extensions := self extensionMethodsToFileOutFor: package. |
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
318 |
extensions notEmpty ifTrue:[ |
394 | 319 |
package fileOutExtensions: extensions. |
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
320 |
] |
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
321 |
|
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
322 |
"Created: / 21-02-2014 / 23:10:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
323 |
"Modified: / 22-02-2014 / 23:04:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
44 | 324 |
! |
325 |
||
326 |
doInitStateVariables |
|
387
ebec1ef28839
Added notion if 'virtual' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
381
diff
changeset
|
327 |
packageClassesChanged := packages contains:[:each| each isVirtual ifFalse: [ each classesHasChanged ] ] . |
ebec1ef28839
Added notion if 'virtual' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
381
diff
changeset
|
328 |
packageExtensionsChanged := packages contains:[:each| each isVirtual ifFalse: [ each extensionsHasChanged ] ]. |
44 | 329 |
|
330 |
"Created: / 17-06-2009 / 10:17:04 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
331 |
"Modified: / 13-08-2009 / 10:18:37 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
387
ebec1ef28839
Added notion if 'virtual' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
381
diff
changeset
|
332 |
"Modified: / 28-02-2014 / 09:52:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
44 | 333 |
! |
334 |
||
335 |
doRemoveOldContainers |
|
387
ebec1ef28839
Added notion if 'virtual' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
381
diff
changeset
|
336 |
packages do:[:each | each isVirtual ifFalse: [ self doRemoveOldContainersFor: each ] ] |
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
337 |
|
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
338 |
"Created: / 11-04-2008 / 11:00:27 / Jan Vrany <vranyj1@fel.cvut.cz>" |
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
339 |
"Modified: / 19-08-2009 / 15:03:51 / Jan Vrany <vranyj1@fel.cvut.cz>" |
387
ebec1ef28839
Added notion if 'virtual' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
381
diff
changeset
|
340 |
"Modified: / 27-02-2014 / 22:55:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
341 |
! |
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
342 |
|
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
343 |
doRemoveOldContainersFor: package |
53
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
344 |
| wcroot containers containersToKeep containersToDelete | |
44 | 345 |
|
346 |
self isSelectiveFileoutTask ifTrue:[ |
|
394 | 347 |
^ self |
44 | 348 |
]. |
349 |
ActivityNotification notify:'Removing old containers'. |
|
117
3014c22e2eab
Refactoring (part 1): SCMPackageModel>>workingCopy renamed to temporaryWorkingCopy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
350 |
wcroot := package temporaryWorkingCopyRoot. |
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
351 |
containers := package containers. |
362
a2b08403cfa8
Fix for issue #26: Java extension files are removed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
353
diff
changeset
|
352 |
|
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
353 |
containersToKeep := package containersToKeep. |
44 | 354 |
containersToDelete := containers \ containersToKeep. |
362
a2b08403cfa8
Fix for issue #26: Java extension files are removed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
353
diff
changeset
|
355 |
"/ Fix for issue #26: Java extension files are removed. |
a2b08403cfa8
Fix for issue #26: Java extension files are removed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
353
diff
changeset
|
356 |
"/ Filter out all Java extension containers which are for classes which |
a2b08403cfa8
Fix for issue #26: Java extension files are removed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
353
diff
changeset
|
357 |
"/ are currently not loaded. |
a2b08403cfa8
Fix for issue #26: Java extension files are removed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
353
diff
changeset
|
358 |
containersToDelete := containersToDelete reject:[:each | |
394 | 359 |
(each startsWith: 'java/extensions/') |
360 |
and:[ |
|
361 |
| nm | |
|
362
a2b08403cfa8
Fix for issue #26: Java extension files are removed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
353
diff
changeset
|
362 |
|
394 | 363 |
nm := each copyFrom:17 to: (each lastIndexOf: $.) - 1. |
364 |
(JavaVM registry classes contains: [:cls | cls binaryName = nm]) not. |
|
365 |
]. |
|
362
a2b08403cfa8
Fix for issue #26: Java extension files are removed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
353
diff
changeset
|
366 |
]. |
a2b08403cfa8
Fix for issue #26: Java extension files are removed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
353
diff
changeset
|
367 |
|
53
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
368 |
containersToDelete do:[:nm| |
394 | 369 |
| entry | |
53
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
370 |
|
394 | 371 |
entry := wcroot / nm. |
372 |
entry remove |
|
53
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
373 |
] |
44 | 374 |
|
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
375 |
"Created: / 21-02-2014 / 23:12:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
44 | 376 |
! |
377 |
||
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
378 |
doRenameContainerForClassNamed: new for: package using: renames language: lang |
44 | 379 |
|
391
f05648d15add
Fix for issue #18 - circular class renames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
380 |
| wcroot assoc old circular oldC oldE newC newE | |
f05648d15add
Fix for issue #18 - circular class renames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
381 |
assoc := renames detectLast:[:each | each key == new ] ifNone:[ ^ self ]. |
f05648d15add
Fix for issue #18 - circular class renames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
382 |
old := assoc value. |
f05648d15add
Fix for issue #18 - circular class renames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
383 |
renames remove: assoc. |
f05648d15add
Fix for issue #18 - circular class renames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
384 |
|
f05648d15add
Fix for issue #18 - circular class renames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
385 |
"/ Call recursively to process sequence of renames but not if |
f05648d15add
Fix for issue #18 - circular class renames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
386 |
"/ its a circular rename... |
f05648d15add
Fix for issue #18 - circular class renames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
387 |
circular := (renames contains:[:each | each value == new ]). |
f05648d15add
Fix for issue #18 - circular class renames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
388 |
circular ifTrue:[ ^ self ]. |
394 | 389 |
self doRenameContainerForClassNamed: old for: package using: renames language: lang. |
391
f05648d15add
Fix for issue #18 - circular class renames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
390 |
|
117
3014c22e2eab
Refactoring (part 1): SCMPackageModel>>workingCopy renamed to temporaryWorkingCopy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
391 |
wcroot := package temporaryWorkingCopyRoot. |
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
392 |
oldC := package containerNameForClassNamed: old language: lang . |
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
393 |
newC := package containerNameForClassNamed: new language: lang . |
89
874f18be0cbd
Fixed renaming of class containers.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
81
diff
changeset
|
394 |
(oldE := wcroot / oldC) exists ifTrue:[ |
394 | 395 |
packageClassesChanged := true. |
396 |
newE := wcroot / newC. |
|
397 |
oldE moveTo: newE. |
|
44 | 398 |
]. |
399 |
||
400 |
"Created: / 11-04-2008 / 11:00:27 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
401 |
"Modified: / 19-08-2009 / 15:03:51 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
402 |
"Created: / 06-08-2011 / 21:33:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
391
f05648d15add
Fix for issue #18 - circular class renames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
403 |
"Modified: / 05-03-2014 / 00:13:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
44 | 404 |
! |
405 |
||
406 |
doRenameContainers |
|
407 |
||
391
f05648d15add
Fix for issue #18 - circular class renames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
408 |
| renames names | |
f05648d15add
Fix for issue #18 - circular class renames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
409 |
renames := OrderedCollection new. |
f05648d15add
Fix for issue #18 - circular class renames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
410 |
names := OrderedCollection new. |
44 | 411 |
ChangeSet current do: |
394 | 412 |
[:chg| |
413 |
chg isClassRenameChange ifTrue:[ |
|
414 |
renames add: chg className -> chg oldName. |
|
415 |
names add: chg fullClassName. |
|
416 |
]]. |
|
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
417 |
packages do:[:each | |
394 | 418 |
each isVirtual ifFalse: [ |
419 |
(self classesToFileOutFor: each) do:[:cls| |
|
420 |
(names includes: cls name) ifTrue:[ |
|
421 |
self doRenameContainerForClassNamed: cls name for: each using: renames language: cls programmingLanguage. |
|
422 |
] |
|
423 |
] |
|
424 |
] |
|
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
425 |
]. |
44 | 426 |
|
427 |
"Created: / 11-04-2008 / 11:00:27 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
428 |
"Modified: / 19-08-2009 / 15:03:51 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
429 |
"Created: / 06-08-2011 / 21:13:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
387
ebec1ef28839
Added notion if 'virtual' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
381
diff
changeset
|
430 |
"Modified: / 27-02-2014 / 22:55:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
44 | 431 |
! |
432 |
||
433 |
doUpdateBuildSupportFiles |
|
387
ebec1ef28839
Added notion if 'virtual' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
381
diff
changeset
|
434 |
packages do:[:each | each isVirtual ifFalse: [ self doUpdateBuildSupportFilesFor: each ] ] |
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
435 |
|
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
436 |
"Created: / 20-06-2009 / 16:01:16 / Jan Vrany <vranyj1@fel.cvut.cz>" |
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
437 |
"Modified: / 21-06-2009 / 15:18:17 / Jan Vrany <vranyj1@fel.cvut.cz>" |
387
ebec1ef28839
Added notion if 'virtual' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
381
diff
changeset
|
438 |
"Modified: / 27-02-2014 / 22:56:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
439 |
! |
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
440 |
|
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
441 |
doUpdateBuildSupportFilesFor: package |
44 | 442 |
|pkgDef| |
443 |
||
444 |
suppresBuildSupportFiles == true ifTrue:[ |
|
394 | 445 |
^self. |
44 | 446 |
]. |
447 |
||
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
448 |
pkgDef := package definition. |
44 | 449 |
|
450 |
(self isSelectiveFileoutTask and:[packageClassesChanged not and:[(classes includes: pkgDef) not]]) ifTrue:[ |
|
394 | 451 |
^self. |
44 | 452 |
]. |
453 |
||
454 |
ActivityNotification notify:'Updating build files'. |
|
455 |
"First, generate files into a temporary files - so originals |
|
456 |
are not destroyed when something goes wrong." |
|
394 | 457 |
(self filesToGenerateFor: package) do:[:supportFileName | |
458 |
| supportFile | |
|
44 | 459 |
|
394 | 460 |
supportFile := package temporaryWorkingCopyRoot / (supportFileName , '.tmp'). |
461 |
(packageClassesChanged or:[ supportFile exists not ]) ifTrue:[ |
|
462 |
ActivityNotification notify:'Updating ' , supportFileName. |
|
463 |
supportFile directory exists ifFalse: [supportFile directory makeDirectory]. |
|
464 |
supportFile writingFileDo:[:s| |
|
465 |
s nextPutAll:(self for: package generateFile:supportFileName) |
|
466 |
] |
|
467 |
] |
|
44 | 468 |
]. |
469 |
"Now, copy them over the old files" |
|
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
470 |
(self filesToGenerateFor: package) do:[:supportFileName | |
394 | 471 |
| supportFile supportFileTmp | |
44 | 472 |
|
394 | 473 |
supportFile := package temporaryWorkingCopyRoot / supportFileName. |
474 |
supportFileTmp := package temporaryWorkingCopyRoot / (supportFileName , '.tmp'). |
|
44 | 475 |
|
394 | 476 |
supportFileTmp moveTo: supportFile. |
477 |
supportFile track. |
|
44 | 478 |
]. |
479 |
||
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
480 |
"Created: / 21-02-2014 / 23:16:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
481 |
"Modified: / 22-02-2014 / 22:47:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
44 | 482 |
! |
483 |
||
122
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
484 |
doUpdateCode |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
485 |
"Updates project definitions and compiles version/copyright methods" |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
486 |
|
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
487 |
self |
394 | 488 |
doInitStateVariables; |
489 |
doCompileVersionMethods; |
|
490 |
doCompileCopyrightMethods; |
|
491 |
doUpdateProjectDefinition. |
|
122
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
492 |
|
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
493 |
"Created: / 10-05-2012 / 17:04:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
494 |
! |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
495 |
|
44 | 496 |
doUpdateProjectDefinition |
387
ebec1ef28839
Added notion if 'virtual' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
381
diff
changeset
|
497 |
packages do:[:each | each isVirtual ifFalse: [ self doUpdateProjectDefinitionFor: each ] ] |
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
498 |
|
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
499 |
"Created: / 11-04-2008 / 11:01:06 / Jan Vrany <vranyj1@fel.cvut.cz>" |
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
500 |
"Modified: / 13-08-2009 / 09:13:14 / Jan Vrany <vranyj1@fel.cvut.cz>" |
387
ebec1ef28839
Added notion if 'virtual' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
381
diff
changeset
|
501 |
"Modified: / 27-02-2014 / 22:56:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
502 |
! |
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
503 |
|
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
504 |
doUpdateProjectDefinitionFor: package |
271
b0f2a22871b6
Care for class removal and superclass/pool change.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
268
diff
changeset
|
505 |
| prjClass classesSpec classNamesAndAttributesMap | |
44 | 506 |
|
507 |
(packageClassesChanged | packageExtensionsChanged) ifFalse:[ |
|
394 | 508 |
^ self |
44 | 509 |
]. |
510 |
ActivityNotification notify:'Updating project definition'. |
|
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
511 |
prjClass := ProjectDefinition definitionClassForPackage: package name createIfAbsent:true. |
271
b0f2a22871b6
Care for class removal and superclass/pool change.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
268
diff
changeset
|
512 |
|
b0f2a22871b6
Care for class removal and superclass/pool change.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
268
diff
changeset
|
513 |
"/Update classlist beforehand - to care about order and removals... |
b0f2a22871b6
Care for class removal and superclass/pool change.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
268
diff
changeset
|
514 |
classNamesAndAttributesMap := Dictionary new. |
b0f2a22871b6
Care for class removal and superclass/pool change.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
268
diff
changeset
|
515 |
prjClass classNamesAndAttributes do:[:nameOrPair | |
394 | 516 |
nameOrPair isArray |
517 |
ifTrue:[classNamesAndAttributesMap at: nameOrPair first put: nameOrPair] |
|
518 |
ifFalse:[classNamesAndAttributesMap at: nameOrPair put: (Array with: nameOrPair)] |
|
271
b0f2a22871b6
Care for class removal and superclass/pool change.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
268
diff
changeset
|
519 |
]. |
b0f2a22871b6
Care for class removal and superclass/pool change.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
268
diff
changeset
|
520 |
classesSpec := prjClass searchForClasses collect:[:cls| |
394 | 521 |
classNamesAndAttributesMap at: cls name ifAbsent:[Array with: cls name] |
271
b0f2a22871b6
Care for class removal and superclass/pool change.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
268
diff
changeset
|
522 |
]. |
b0f2a22871b6
Care for class removal and superclass/pool change.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
268
diff
changeset
|
523 |
prjClass classNamesAndAttributes:classesSpec usingCompiler:nil. |
b0f2a22871b6
Care for class removal and superclass/pool change.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
268
diff
changeset
|
524 |
|
b0f2a22871b6
Care for class removal and superclass/pool change.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
268
diff
changeset
|
525 |
|
b0f2a22871b6
Care for class removal and superclass/pool change.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
268
diff
changeset
|
526 |
"/Now do standard update |
b0f2a22871b6
Care for class removal and superclass/pool change.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
268
diff
changeset
|
527 |
Class packageQuerySignal answer:prjClass package do:[ |
394 | 528 |
prjClass theNonMetaclass |
529 |
forEachContentsMethodsCodeToCompileDo:[:code :category | |
|
530 |
(code startsWith: 'excludedFromPreRequisites') |
|
531 |
ifFalse:[prjClass theMetaclass compile:code classified:category] |
|
532 |
] |
|
533 |
"/ignoreOldEntries: false |
|
534 |
ignoreOldDefinition: false |
|
271
b0f2a22871b6
Care for class removal and superclass/pool change.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
268
diff
changeset
|
535 |
] |
44 | 536 |
|
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
537 |
"Created: / 21-02-2014 / 23:17:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
44 | 538 |
! ! |
539 |
||
540 |
!SCMAbstractFileoutLikeTask methodsFor:'private'! |
|
541 |
||
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
542 |
classesToFileOutFor: package |
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
543 |
|
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
544 |
suppressClasses == true ifTrue:[^#()]. |
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
545 |
|
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
546 |
^ package classesFiltered: |
394 | 547 |
[:class | |
548 |
class isLoaded and: [ classes isNil or: [ classes includes: class ] ] ] |
|
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
549 |
|
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
550 |
"Created: / 21-02-2014 / 22:59:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
551 |
"Modified: / 22-02-2014 / 22:19:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
44 | 552 |
! |
553 |
||
554 |
containersToFileOut |
|
426
1933163ba3bb
Fixed regression for selective class commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
394
diff
changeset
|
555 |
^ OrderedCollection streamContents: [ :s | |
1933163ba3bb
Fixed regression for selective class commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
394
diff
changeset
|
556 |
packages do:[:each | |
1933163ba3bb
Fixed regression for selective class commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
394
diff
changeset
|
557 |
each isVirtual ifFalse: [ |
1933163ba3bb
Fixed regression for selective class commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
394
diff
changeset
|
558 |
| containers | |
1933163ba3bb
Fixed regression for selective class commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
394
diff
changeset
|
559 |
containers := (self containersToFileOutFor: each) collect:[ :container | each repositoryRoot , Filename separator , container ]. |
1933163ba3bb
Fixed regression for selective class commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
394
diff
changeset
|
560 |
s nextPutAll: containers. |
1933163ba3bb
Fixed regression for selective class commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
394
diff
changeset
|
561 |
] |
1933163ba3bb
Fixed regression for selective class commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
394
diff
changeset
|
562 |
] |
1933163ba3bb
Fixed regression for selective class commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
394
diff
changeset
|
563 |
]. |
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
564 |
|
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
565 |
"Created: / 14-05-2009 / 11:35:05 / Jan Vrany <vranyj1@fel.cvut.cz>" |
426
1933163ba3bb
Fixed regression for selective class commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
394
diff
changeset
|
566 |
"Modified: / 01-05-2014 / 10:07:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
567 |
! |
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
568 |
|
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
569 |
containersToFileOutFor: package |
44 | 570 |
| containers extensions | |
571 |
||
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
572 |
containers := (self classesToFileOutFor: package) |
394 | 573 |
collect: [:class | package containerNameForClass: class ]. |
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
574 |
(extensions := (self extensionMethodsToFileOutFor: package)) notEmpty ifTrue:[ |
394 | 575 |
| languages extensionsNonJava extensionsJava | |
348
a9647072025f
More support for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
576 |
|
394 | 577 |
extensionsNonJava := extensions reject:[:m | m mclass programmingLanguage isJava]. |
578 |
extensionsJava := extensions select:[:m | m mclass programmingLanguage isJava]. |
|
579 |
languages := (extensionsNonJava collect:[:each|each programmingLanguage]) asSet. |
|
580 |
languages do: [:lang| containers add: (package containerNameForExtensions: lang)]. |
|
581 |
extensionsJava do:[:m | |
|
582 |
| container | |
|
348
a9647072025f
More support for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
583 |
|
394 | 584 |
container := package containerNameForExtensions: m programmingLanguage javaClass: m mclass. |
585 |
(containers includes: container) ifFalse:[ |
|
586 |
containers add: container |
|
587 |
]. |
|
588 |
]. |
|
348
a9647072025f
More support for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
589 |
]. |
44 | 590 |
^ containers |
591 |
||
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
592 |
"Created: / 22-02-2014 / 22:49:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
44 | 593 |
! |
594 |
||
595 |
extensionMethodsToFileOut |
|
394 | 596 |
self error: 'Should no longer be sent'. |
44 | 597 |
^ self package extensionsFiltered: |
394 | 598 |
[:mth | |
599 |
extensionMethods isNil or: [ extensionMethods includes: mth ] ] |
|
44 | 600 |
|
601 |
"Created: / 14-05-2009 / 11:32:01 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
602 |
"Modified: / 22-02-2014 / 22:19:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
44 | 603 |
! |
604 |
||
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
605 |
extensionMethodsToFileOutFor: package |
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
606 |
^package extensionsFiltered: |
394 | 607 |
[:mth | |
608 |
extensionMethods isNil or: [ extensionMethods includes: mth ] ] |
|
44 | 609 |
|
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
610 |
"Created: / 21-02-2014 / 23:03:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
611 |
"Modified: / 22-02-2014 / 22:20:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
612 |
! |
44 | 613 |
|
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
614 |
for: package generateFile: file |
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
615 |
| def contents savedClassFilenames | |
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
616 |
|
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
617 |
def := package definition. |
44 | 618 |
file ~= 'abbrev.stc' ifTrue:[^def generateFile: file]. |
619 |
||
620 |
"Yet another kludge to trick Smalltalk>>fileNameForClass:, sigh" |
|
621 |
savedClassFilenames := Dictionary new. |
|
622 |
(def searchForClasses reject:[:e|e owningClass notNil]) do: |
|
394 | 623 |
[:cls| |
624 |
savedClassFilenames |
|
625 |
at: cls |
|
626 |
put: cls getClassFilename. |
|
627 |
cls setClassFilename: (package containerNameForClass: cls)]. |
|
44 | 628 |
contents := def generateFile: file. |
629 |
savedClassFilenames keysAndValuesDo: |
|
394 | 630 |
[:cls :classFileName| |
631 |
cls setClassFilename: classFileName]. |
|
44 | 632 |
^contents |
81
eeb86ad71bc3
Fixed all references to libsvn classes. Added SCMCompatModeQuery.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
70
diff
changeset
|
633 |
|
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
362
diff
changeset
|
634 |
"Modified: / 22-02-2014 / 22:47:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
44 | 635 |
! |
636 |
||
637 |
shouldFileOutClass: class |
|
389
1e2e6ce45878
Added new warning to commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
387
diff
changeset
|
638 |
^ packages anySatisfy: |
394 | 639 |
[:p | p name = class package and:[ p hasChangesInClass: class ] ] |
44 | 640 |
|
641 |
"Created: / 24-06-2009 / 19:04:48 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
642 |
"Modified: / 19-08-2009 / 13:54:39 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
389
1e2e6ce45878
Added new warning to commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
387
diff
changeset
|
643 |
"Modified: / 03-03-2014 / 09:18:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
426
1933163ba3bb
Fixed regression for selective class commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
394
diff
changeset
|
644 |
! ! |
44 | 645 |
|
646 |
!SCMAbstractFileoutLikeTask methodsFor:'queries'! |
|
647 |
||
648 |
isSelectiveFileoutTask |
|
649 |
^ classes notNil or: [ extensionMethods notNil ] |
|
650 |
||
651 |
"Created: / 14-05-2009 / 13:24:52 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
652 |
! ! |
|
653 |
||
654 |
!SCMAbstractFileoutLikeTask class methodsFor:'documentation'! |
|
655 |
||
656 |
version_GIT |
|
657 |
"Never, ever change this method. Ask JV or CG why" |
|
658 |
^thisContext method mclass theNonMetaclass instVarNamed: #revision |
|
659 |
! |
|
660 |
||
53
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
661 |
version_HG |
114
8b27cb46af9a
version_HG changed to return String.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
89
diff
changeset
|
662 |
|
8b27cb46af9a
version_HG changed to return String.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
89
diff
changeset
|
663 |
^ '$Changeset: <not expanded> $' |
53
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
664 |
! |
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
665 |
|
44 | 666 |
version_SVN |
70
3faeae24a513
fix in SCMAbstractFileoutLikeTask>>doCompileVersionMethods
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
53
diff
changeset
|
667 |
^ '§Id:: §' |
44 | 668 |
! ! |
426
1933163ba3bb
Fixed regression for selective class commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
394
diff
changeset
|
669 |