757
|
1 |
"
|
|
2 |
Copyright (c) 2007-2010 Jan Vrany
|
|
3 |
Copyright (c) 2009-2010 eXept Software AG
|
|
4 |
|
|
5 |
Permission is hereby granted, free of charge, to any person
|
|
6 |
obtaining a copy of this software and associated documentation
|
|
7 |
files (the 'Software'), to deal in the Software without
|
|
8 |
restriction, including without limitation the rights to use,
|
|
9 |
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10 |
copies of the Software, and to permit persons to whom the
|
|
11 |
Software is furnished to do so, subject to the following
|
|
12 |
conditions:
|
|
13 |
|
|
14 |
The above copyright notice and this permission notice shall be
|
|
15 |
included in all copies or substantial portions of the Software.
|
|
16 |
|
|
17 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
18 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
19 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
20 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
21 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
22 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
23 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
24 |
OTHER DEALINGS IN THE SOFTWARE.
|
|
25 |
"
|
409
|
26 |
"{ Package: 'stx:libsvn' }"
|
55
|
27 |
|
|
28 |
"{ NameSpace: SVN }"
|
|
29 |
|
492
|
30 |
Task subclass:#FileoutLikeTask
|
250
|
31 |
instanceVariableNames:'packageClassesChanged packageExtensionsChanged extensionMethods'
|
55
|
32 |
classVariableNames:''
|
|
33 |
poolDictionaries:''
|
|
34 |
category:'SVN-Tasks'
|
|
35 |
!
|
|
36 |
|
757
|
37 |
!FileoutLikeTask class methodsFor:'documentation'!
|
|
38 |
|
|
39 |
copyright
|
|
40 |
"
|
|
41 |
Copyright (c) 2007-2010 Jan Vrany
|
|
42 |
Copyright (c) 2009-2010 eXept Software AG
|
|
43 |
|
|
44 |
Permission is hereby granted, free of charge, to any person
|
|
45 |
obtaining a copy of this software and associated documentation
|
|
46 |
files (the 'Software'), to deal in the Software without
|
|
47 |
restriction, including without limitation the rights to use,
|
|
48 |
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
49 |
copies of the Software, and to permit persons to whom the
|
|
50 |
Software is furnished to do so, subject to the following
|
|
51 |
conditions:
|
|
52 |
|
|
53 |
The above copyright notice and this permission notice shall be
|
|
54 |
included in all copies or substantial portions of the Software.
|
|
55 |
|
|
56 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
57 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
58 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
59 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
60 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
61 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
62 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
63 |
OTHER DEALINGS IN THE SOFTWARE.
|
|
64 |
|
|
65 |
"
|
|
66 |
! !
|
55
|
67 |
|
250
|
68 |
!FileoutLikeTask methodsFor:'accessing'!
|
|
69 |
|
|
70 |
extensionMethods
|
|
71 |
^ extensionMethods
|
|
72 |
!
|
|
73 |
|
|
74 |
extensionMethods:aCollection"of Methods"
|
|
75 |
|
|
76 |
extensionMethods := aCollection.
|
|
77 |
|
|
78 |
"Modified: / 14-05-2009 / 13:38:15 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
757
|
79 |
!
|
|
80 |
|
|
81 |
filesToGenerate
|
|
82 |
^ self packageDefinition fileNamesToGenerate keys
|
|
83 |
|
|
84 |
"
|
|
85 |
SVN::CommitTask new
|
|
86 |
package: #stx:libsvn;
|
|
87 |
buildSupportFiles"
|
|
88 |
|
|
89 |
"Created: / 27-11-2009 / 11:29:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
90 |
"Modified: / 17-11-2010 / 14:08:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
91 |
!
|
|
92 |
|
|
93 |
packageDefinition
|
|
94 |
|
|
95 |
^self workingCopy packageDefinition
|
|
96 |
|
|
97 |
"Created: / 27-11-2009 / 11:27:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
250
|
98 |
! !
|
|
99 |
|
55
|
100 |
!FileoutLikeTask methodsFor:'executing - private'!
|
|
101 |
|
|
102 |
doAddNewContainers
|
757
|
103 |
|filesAndDirsToAdd filesToAdd containers|
|
55
|
104 |
|
757
|
105 |
ActivityNotification notify:'Adding new containers'.
|
|
106 |
containers := self isSelectiveFileoutTask ifTrue:[
|
|
107 |
#()
|
|
108 |
] ifFalse:[
|
|
109 |
self containersToFileOut
|
|
110 |
].
|
|
111 |
filesAndDirsToAdd := ((StatusCommand new)
|
|
112 |
workingCopy:self workingCopy;
|
|
113 |
paths:containers;
|
|
114 |
execute)
|
|
115 |
select:[:wcEntry | wcEntry status isUnversioned ]
|
|
116 |
thenCollect:[:wcEntry | wcEntry path ].
|
|
117 |
filesToAdd := filesAndDirsToAdd select:
|
|
118 |
[:fname|(workingCopy path / fname) isDirectory not].
|
|
119 |
filesAndDirsToAdd isEmpty ifFalse:[
|
|
120 |
packageClassesChanged := true.
|
|
121 |
(AddCommand new)
|
|
122 |
workingCopy:self workingCopy;
|
|
123 |
paths:filesAndDirsToAdd;
|
|
124 |
execute.
|
|
125 |
].
|
|
126 |
filesToAdd isEmpty ifFalse:[
|
|
127 |
(PropsetCommand new)
|
|
128 |
workingCopy:self workingCopy;
|
|
129 |
name:'svn:keywords';
|
|
130 |
value:'Id HeadURL';
|
|
131 |
paths:filesToAdd;
|
|
132 |
execute.
|
|
133 |
(PropsetCommand new)
|
|
134 |
workingCopy:self workingCopy;
|
|
135 |
name:'svn:eol-style';
|
|
136 |
value:'LF';
|
|
137 |
paths:filesToAdd;
|
|
138 |
execute
|
|
139 |
]
|
55
|
140 |
|
|
141 |
"Created: / 11-04-2008 / 10:58:53 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
142 |
"Modified: / 19-08-2009 / 14:00:26 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
757
|
143 |
"Modified: / 08-08-2011 / 14:32:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
144 |
!
|
|
145 |
|
|
146 |
doCompileCopyrightMethods
|
|
147 |
| klasses source |
|
|
148 |
|
|
149 |
(self packageDefinition class includesSelector: #copyright) ifFalse:[^self].
|
|
150 |
ActivityNotification notify:'Compiling #copyright methods...'.
|
|
151 |
klasses := self classesToFileOut asArray.
|
|
152 |
source := (self packageDefinition class compiledMethodAt: #copyright) source.
|
|
153 |
|
|
154 |
klasses
|
|
155 |
withIndexDo:[:cls :index |
|
|
156 |
|metaCls|
|
|
157 |
metaCls := cls theMetaclass.
|
|
158 |
(((metaCls includesSelector:#copyright) not) and:[metaCls programmingLanguage isSmalltalk])
|
|
159 |
ifTrue:[
|
|
160 |
metaCls compile:source classified:'documentation'.
|
|
161 |
(metaCls compiledMethodAt:#copyright)
|
|
162 |
setPackage:self package asSymbol
|
|
163 |
].
|
|
164 |
ProgressNotification
|
|
165 |
notify:('Compiling %1 (%2)' bindWith:#copyright
|
|
166 |
with:cls nameWithoutPrefix)
|
|
167 |
progress:(klasses size / 100) * index.
|
|
168 |
]
|
|
169 |
|
|
170 |
"Modified: / 16-08-2009 / 12:59:50 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
171 |
"Created: / 08-04-2010 / 14:31:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
55
|
172 |
!
|
|
173 |
|
|
174 |
doCompileVersionMethods
|
757
|
175 |
|klasses versionMethodName|
|
55
|
176 |
|
|
177 |
versionMethodName := SVNSourceCodeManager nameOfVersionMethodInClasses.
|
757
|
178 |
ActivityNotification notify:'Compiling #version methods...'.
|
55
|
179 |
klasses := self classesToFileOut asArray.
|
757
|
180 |
klasses
|
|
181 |
withIndexDo:[:cls :index |
|
|
182 |
|metaCls|
|
55
|
183 |
|
757
|
184 |
metaCls := cls theMetaclass.
|
|
185 |
((metaCls includesSelector:versionMethodName) not
|
|
186 |
or:[ ((cls perform:versionMethodName asSymbol) startsWith:'$Id') not ])
|
|
187 |
ifTrue:[
|
|
188 |
metaCls compile:(metaCls
|
|
189 |
versionMethodTemplateForSourceCodeManager:SVNSourceCodeManager)
|
|
190 |
classified:'documentation'.
|
|
191 |
(metaCls compiledMethodAt:versionMethodName)
|
|
192 |
setPackage:self package asSymbol
|
|
193 |
].
|
|
194 |
SourceCodeManagerUtilities ensureCorrectVersionMethodsInClass: cls using: SVNSourceCodeManager.
|
|
195 |
ProgressNotification
|
|
196 |
notify:('Compiling %1 (%2)' bindWith:versionMethodName
|
|
197 |
with:cls nameWithoutPrefix)
|
|
198 |
progress:(klasses size / 100) * index.
|
|
199 |
]
|
55
|
200 |
|
|
201 |
"Created: / 28-05-2008 / 07:43:43 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
202 |
"Modified: / 16-08-2009 / 12:59:50 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
757
|
203 |
"Modified: / 24-11-2009 / 12:48:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
204 |
"Modified: / 07-07-2011 / 20:15:21 / jv"
|
55
|
205 |
!
|
|
206 |
|
|
207 |
doFileOutAll
|
|
208 |
|
|
209 |
self
|
757
|
210 |
doInitStateVariables;
|
|
211 |
doUpdateProjectDefinition;
|
|
212 |
doUpdateBuildSupportFiles;
|
|
213 |
doCompileVersionMethods;
|
|
214 |
doCompileCopyrightMethods;
|
|
215 |
doCompileSvnRevisionNrMethod:false;
|
|
216 |
doCompileSvnRepositoryUrlStringMethod;
|
|
217 |
doRenameContainers;
|
|
218 |
doFileOutPackageClasses;
|
|
219 |
doFileOutPackageExtensions;
|
|
220 |
doAddNewContainers;
|
|
221 |
doRemoveOldContainers.
|
55
|
222 |
|
|
223 |
"Created: / 17-08-2009 / 18:28:18 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
757
|
224 |
"Modified: / 06-08-2011 / 20:48:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
55
|
225 |
!
|
|
226 |
|
|
227 |
doFileOutPackageClasses
|
757
|
228 |
|klasses|
|
55
|
229 |
|
757
|
230 |
ActivityNotification notify:'Filing out package classes'.
|
|
231 |
klasses := self classesToFileOut asArray.
|
|
232 |
klasses
|
|
233 |
withIndexDo:[:cls :index |
|
|
234 |
|clsStream|
|
|
235 |
|
|
236 |
ProgressNotification notify:'Filing out ' , cls nameWithoutPrefix
|
|
237 |
progress:(100 / klasses size) * index.
|
|
238 |
(self shouldFileOutClass:cls) ifTrue:[self workingCopy fileOutClass: cls]]
|
55
|
239 |
|
|
240 |
"Created: / 11-04-2008 / 10:58:16 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
241 |
"Modified: / 19-08-2009 / 13:44:00 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
757
|
242 |
"Modified: / 30-12-2009 / 19:05:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
55
|
243 |
!
|
|
244 |
|
|
245 |
doFileOutPackageExtensions
|
|
246 |
|
757
|
247 |
self extensionMethodsToFileOut isEmpty ifTrue:[^self].
|
|
248 |
self workingCopy fileOutExtensions: self extensionMethodsToFileOut
|
55
|
249 |
|
|
250 |
"Modified: / 07-04-2008 / 08:37:25 / janfrog"
|
|
251 |
"Created: / 11-04-2008 / 10:58:36 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
252 |
"Modified: / 14-05-2009 / 13:37:40 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
757
|
253 |
"Modified: / 30-12-2009 / 19:06:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
55
|
254 |
!
|
|
255 |
|
|
256 |
doInitStateVariables
|
|
257 |
packageClassesChanged := self workingCopy packageClassesChanged.
|
|
258 |
packageExtensionsChanged := self workingCopy packageExtensionsChanged.
|
|
259 |
|
|
260 |
"Created: / 17-06-2009 / 10:17:04 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
261 |
"Modified: / 13-08-2009 / 10:18:37 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
262 |
!
|
|
263 |
|
|
264 |
doRemoveOldContainers
|
757
|
265 |
|containers containersToKeep containersToDelete|
|
55
|
266 |
|
757
|
267 |
self isSelectiveFileoutTask ifTrue:[
|
|
268 |
^ self
|
|
269 |
].
|
|
270 |
ActivityNotification notify:'Removing old containers'.
|
55
|
271 |
containers := self workingCopy containers.
|
|
272 |
containersToKeep := self workingCopy containersToKeep.
|
|
273 |
containersToDelete := containers \ containersToKeep.
|
757
|
274 |
containersToDelete isEmpty ifFalse:[
|
|
275 |
packageClassesChanged := true.
|
|
276 |
(DeleteCommand new)
|
|
277 |
workingCopy:self workingCopy;
|
|
278 |
paths:containersToDelete;
|
|
279 |
execute
|
|
280 |
].
|
|
281 |
|
|
282 |
"Created: / 11-04-2008 / 11:00:27 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
283 |
"Modified: / 19-08-2009 / 15:03:51 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
284 |
"Modified: / 08-08-2011 / 14:33:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
285 |
!
|
|
286 |
|
|
287 |
doRenameContainerForClassNamed: new using: renames language: lang
|
|
288 |
|
|
289 |
| old oldC newC |
|
|
290 |
old := renames at: new.
|
|
291 |
(renames includesKey: old) ifTrue:[
|
|
292 |
self doRenameContainerForClassNamed: old using: renames language: lang.
|
|
293 |
].
|
|
294 |
oldC := (SVN::Repository containerNameWithoutSuffixForClassNamed: old) , '.' , lang sourceFileSuffix.
|
|
295 |
newC := (SVN::Repository containerNameWithoutSuffixForClassNamed: new) , '.' , lang sourceFileSuffix.
|
|
296 |
(workingCopy containerFilenameFor: oldC) exists ifTrue:[
|
|
297 |
packageClassesChanged := true.
|
|
298 |
MoveCommand new
|
|
299 |
workingCopy: workingCopy;
|
|
300 |
src: oldC;
|
|
301 |
dst: newC;
|
|
302 |
execute.
|
|
303 |
].
|
55
|
304 |
|
|
305 |
"Created: / 11-04-2008 / 11:00:27 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
306 |
"Modified: / 19-08-2009 / 15:03:51 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
757
|
307 |
"Created: / 06-08-2011 / 21:33:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
308 |
!
|
|
309 |
|
|
310 |
doRenameContainers
|
|
311 |
|
|
312 |
| renames |
|
|
313 |
renames := Dictionary new.
|
|
314 |
ChangeSet current do:
|
|
315 |
[:chg|
|
|
316 |
chg isClassRenameChange ifTrue:[
|
|
317 |
renames at: chg className put: chg oldName.
|
|
318 |
]].
|
|
319 |
self classesToFileOut do:[:cls|
|
|
320 |
(renames includesKey: cls name) ifTrue:[
|
|
321 |
self doRenameContainerForClassNamed: cls name using: renames language: cls programmingLanguage.
|
|
322 |
]
|
|
323 |
]
|
|
324 |
|
|
325 |
"Created: / 11-04-2008 / 11:00:27 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
326 |
"Modified: / 19-08-2009 / 15:03:51 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
327 |
"Created: / 06-08-2011 / 21:13:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
55
|
328 |
!
|
|
329 |
|
|
330 |
doUpdateBuildSupportFiles
|
757
|
331 |
|pkgDef|
|
55
|
332 |
|
757
|
333 |
ActivityNotification notify:'Updating build files'.
|
55
|
334 |
pkgDef := self workingCopy packageDefinition.
|
757
|
335 |
self filesToGenerate do:[:supportFileName |
|
|
336 |
|supportFile stream|
|
|
337 |
|
|
338 |
supportFile := workingCopy path / supportFileName.
|
|
339 |
(packageClassesChanged or:[ supportFile exists not ]) ifTrue:[
|
|
340 |
ActivityNotification notify:'Updating ' , supportFileName.
|
|
341 |
[
|
|
342 |
supportFile directory exists ifFalse:
|
|
343 |
[supportFile directory makeDirectory].
|
|
344 |
stream := supportFile writeStream.
|
|
345 |
stream nextPutAll:(self for: pkgDef generateFile:supportFileName)
|
|
346 |
] ensure:[ stream ifNotNil:[ stream close ] ]
|
|
347 |
]
|
|
348 |
].
|
55
|
349 |
|
|
350 |
"Created: / 20-06-2009 / 16:01:16 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
351 |
"Modified: / 21-06-2009 / 15:18:17 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
757
|
352 |
"Modified: / 03-02-2011 / 08:45:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
55
|
353 |
!
|
|
354 |
|
|
355 |
doUpdateProjectDefinition
|
|
356 |
|prjClass|
|
|
357 |
|
757
|
358 |
(packageClassesChanged | packageExtensionsChanged) ifFalse:[
|
|
359 |
^ self
|
|
360 |
].
|
|
361 |
ActivityNotification notify:'Updating project definition'.
|
|
362 |
prjClass := Smalltalk
|
|
363 |
at:(ProjectDefinition initialClassNameForDefinitionOf:self package)
|
|
364 |
asSymbol.
|
|
365 |
prjClass
|
|
366 |
ifNotNil:[
|
|
367 |
Class packageQuerySignal answer:prjClass package
|
|
368 |
do:[
|
|
369 |
prjClass theNonMetaclass
|
|
370 |
forEachContentsMethodsCodeToCompileDo:[:code :category |
|
|
371 |
(code startsWith: 'excludedFromPreRequisites')
|
|
372 |
ifFalse:[prjClass theMetaclass compile:code classified:category]
|
|
373 |
]
|
|
374 |
ignoreOldEntries: true
|
|
375 |
ignoreOldDefinition: false
|
|
376 |
]
|
|
377 |
]
|
55
|
378 |
|
|
379 |
"Created: / 11-04-2008 / 11:01:06 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
380 |
"Modified: / 13-08-2009 / 09:13:14 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
757
|
381 |
"Modified: / 09-07-2010 / 14:13:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
55
|
382 |
! !
|
|
383 |
|
|
384 |
!FileoutLikeTask methodsFor:'private'!
|
|
385 |
|
|
386 |
classesToFileOut
|
492
|
387 |
^ self workingCopy packageClassesFiltered:
|
|
388 |
[:class |
|
|
389 |
class isLoaded and: [ classes isNil or: [ classes includes: class ] ] ]
|
55
|
390 |
|
|
391 |
"Created: / 23-03-2009 / 12:08:24 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
392 |
"Modified: / 11-06-2009 / 18:17:38 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
393 |
!
|
|
394 |
|
|
395 |
containersToFileOut
|
757
|
396 |
| containers extensions |
|
55
|
397 |
|
492
|
398 |
containers := self classesToFileOut
|
757
|
399 |
collect: [:class | self repository containerNameForClass: class ].
|
|
400 |
(extensions := self extensionMethodsToFileOut) notEmpty ifTrue:
|
|
401 |
[| languages |
|
|
402 |
languages := (extensions collect:[:each|each programmingLanguage]) asSet.
|
|
403 |
languages do:
|
|
404 |
[:lang|containers add: (Repository containerNameForExtensions: lang)]].
|
55
|
405 |
^ containers
|
|
406 |
|
|
407 |
"Created: / 14-05-2009 / 11:35:05 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
757
|
408 |
"Modified: / 30-12-2009 / 22:05:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
55
|
409 |
!
|
|
410 |
|
|
411 |
extensionMethodsToFileOut
|
492
|
412 |
^ self workingCopy packageExtensionsFiltered:
|
|
413 |
[:mth |
|
|
414 |
extensionMethods isNil or: [ extensionMethods includes: mth ] ]
|
55
|
415 |
|
|
416 |
"Created: / 14-05-2009 / 11:32:01 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
417 |
!
|
|
418 |
|
757
|
419 |
for: def generateFile: file
|
|
420 |
|
|
421 |
| contents savedClassFilenames |
|
|
422 |
|
|
423 |
|
|
424 |
file ~= 'abbrev.stc' ifTrue:[^def generateFile: file].
|
|
425 |
|
|
426 |
"Yet another kludge to trick Smalltalk>>fileNameForClass:, sigh"
|
|
427 |
|
|
428 |
savedClassFilenames := Dictionary new.
|
|
429 |
(def searchForClasses reject:[:e|e owningClass notNil]) do:
|
|
430 |
[:cls|
|
|
431 |
savedClassFilenames
|
|
432 |
at: cls
|
|
433 |
put: cls getClassFilename.
|
|
434 |
cls setClassFilename: (SVN::Repository containerNameForClass: cls)].
|
|
435 |
contents := def generateFile: file.
|
|
436 |
savedClassFilenames keysAndValuesDo:
|
|
437 |
[:cls :classFileName|
|
|
438 |
cls setClassFilename: classFileName].
|
|
439 |
^contents
|
|
440 |
!
|
|
441 |
|
55
|
442 |
shouldFileOutClass: class
|
|
443 |
|
492
|
444 |
"Do not fileout autoloaded classes,
|
55
|
445 |
they are untouched"
|
|
446 |
class isLoaded ifFalse:[^false].
|
|
447 |
|
492
|
448 |
class theNonMetaclass
|
757
|
449 |
methodsDo:[:mth|(self shouldFileOutMethod: mth) ifTrue:[^true]].
|
492
|
450 |
class theMetaclass
|
757
|
451 |
methodsDo:[:mth|(self shouldFileOutMethod: mth) ifTrue:[^true]].
|
|
452 |
class privateClasses
|
|
453 |
do:[:cls|(self shouldFileOutClass: cls) ifTrue:[^true]].
|
55
|
454 |
^false
|
|
455 |
|
|
456 |
"
|
757
|
457 |
CommitTask basicNew
|
|
458 |
package: #'stx:libsvn';
|
|
459 |
shouldFileOutClass: CommitTask
|
55
|
460 |
|
757
|
461 |
CommitTask basicNew
|
|
462 |
package: #'stx:libbasic';
|
|
463 |
shouldFileOutClass: Object
|
55
|
464 |
"
|
|
465 |
|
|
466 |
"Created: / 24-06-2009 / 19:04:48 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
467 |
"Modified: / 19-08-2009 / 13:54:39 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
757
|
468 |
"Modified: / 10-12-2010 / 00:22:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
55
|
469 |
!
|
|
470 |
|
|
471 |
shouldFileOutMethod: mth
|
|
472 |
|
|
473 |
^mth package = package and:
|
492
|
474 |
[mth getSourcePosition isNil]
|
55
|
475 |
|
|
476 |
"
|
492
|
477 |
CommitTask basicNew
|
757
|
478 |
package: #'stx:libsvn';
|
492
|
479 |
shouldFileOutMethod: (CommitTask >> #shouldFileOutMethod:)
|
55
|
480 |
|
492
|
481 |
CommitTask basicNew
|
|
482 |
package: #'stx:libbasic';
|
|
483 |
shouldFileOutMethod: (Object >> #yourself)
|
55
|
484 |
"
|
|
485 |
|
|
486 |
"Created: / 24-06-2009 / 19:07:27 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
487 |
! !
|
|
488 |
|
|
489 |
!FileoutLikeTask methodsFor:'queries'!
|
|
490 |
|
|
491 |
isSelectiveFileoutTask
|
|
492 |
^ classes notNil or: [ extensionMethods notNil ]
|
|
493 |
|
|
494 |
"Created: / 14-05-2009 / 13:24:52 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
495 |
! !
|
|
496 |
|
|
497 |
!FileoutLikeTask class methodsFor:'documentation'!
|
|
498 |
|
|
499 |
version
|
|
500 |
^ '$Header$'
|
226
|
501 |
!
|
|
502 |
|
|
503 |
version_CVS
|
|
504 |
^ '$Header$'
|
|
505 |
!
|
|
506 |
|
|
507 |
version_SVN
|
757
|
508 |
|
|
509 |
^ '§Id: SVN__FileoutLikeTask.st 360 2011-08-06 22:39:24Z vranyj1 §'
|
|
510 |
|
55
|
511 |
! !
|