author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Fri, 12 Jul 2013 17:47:21 +0100 | |
changeset 335 | 7e19ab19148b |
parent 302 | e078bdcef149 |
child 348 | a9647072025f |
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 |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
302
diff
changeset
|
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 |
|
23 |
packageClassesChanged packageExtensionsChanged extensionMethods' |
|
24 |
classVariableNames:'' |
|
25 |
poolDictionaries:'' |
|
26 |
category:'SCM-Common-StX-Tasks' |
|
27 |
! |
|
28 |
||
29 |
!SCMAbstractFileoutLikeTask class methodsFor:'documentation'! |
|
30 |
||
31 |
copyright |
|
32 |
" |
|
335
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
302
diff
changeset
|
33 |
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
|
34 |
Copyright (C) 2012-2013 Jan Vrany |
44 | 35 |
|
335
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
302
diff
changeset
|
36 |
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
|
37 |
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
|
38 |
License as published by the Free Software Foundation; either |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
302
diff
changeset
|
39 |
version 2.1 of the License. |
44 | 40 |
|
335
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
302
diff
changeset
|
41 |
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
|
42 |
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
|
43 |
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
|
44 |
Lesser General Public License for more details. |
44 | 45 |
|
335
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
302
diff
changeset
|
46 |
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
|
47 |
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
|
48 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
44 | 49 |
" |
50 |
! ! |
|
51 |
||
52 |
!SCMAbstractFileoutLikeTask methodsFor:'accessing'! |
|
53 |
||
54 |
extensionMethods |
|
55 |
^ extensionMethods |
|
56 |
! |
|
57 |
||
58 |
extensionMethods:aCollection"of Methods" |
|
59 |
||
60 |
extensionMethods := aCollection. |
|
61 |
||
62 |
"Modified: / 14-05-2009 / 13:38:15 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
63 |
! |
|
64 |
||
65 |
filesToGenerate |
|
66 |
^ self packageDefinition fileNamesToGenerate keys |
|
67 |
||
68 |
" |
|
69 |
SVN::CommitTask new |
|
70 |
package: #stx:libsvn; |
|
71 |
buildSupportFiles" |
|
72 |
||
73 |
"Created: / 27-11-2009 / 11:29:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
74 |
"Modified: / 17-11-2010 / 14:08:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
75 |
! |
|
76 |
||
77 |
packageDefinition |
|
78 |
||
79 |
^self package definition |
|
80 |
||
81 |
"Created: / 27-11-2009 / 11:27:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
82 |
! |
|
83 |
||
84 |
suppresBuildSupportFiles |
|
85 |
^ suppresBuildSupportFiles |
|
86 |
! |
|
87 |
||
88 |
suppresBuildSupportFiles:something |
|
89 |
suppresBuildSupportFiles := something. |
|
90 |
! |
|
91 |
||
92 |
suppressClasses |
|
93 |
^ suppressClasses |
|
94 |
! |
|
95 |
||
96 |
suppressClasses:aBoolean |
|
97 |
suppressClasses := aBoolean. |
|
98 |
! |
|
99 |
||
100 |
suppressExtensions |
|
101 |
^ suppressExtensions |
|
102 |
! |
|
103 |
||
104 |
suppressExtensions:aBoolean |
|
105 |
suppressExtensions := aBoolean. |
|
106 |
! ! |
|
107 |
||
108 |
!SCMAbstractFileoutLikeTask methodsFor:'executing - private'! |
|
109 |
||
110 |
doAddNewContainers |
|
53
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
111 |
| wcroot containers | |
44 | 112 |
|
113 |
ActivityNotification notify:'Adding new containers'. |
|
53
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
114 |
containers := |
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
115 |
self isSelectiveFileoutTask |
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
116 |
ifTrue:[#()] |
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
117 |
ifFalse:[self containersToFileOut]. |
117
3014c22e2eab
Refactoring (part 1): SCMPackageModel>>workingCopy renamed to temporaryWorkingCopy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
118 |
wcroot := self temporaryWorkingCopyRoot. |
53
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
119 |
|
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
120 |
containers do:[:nm| |
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
121 |
| entry | |
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
122 |
|
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
123 |
entry := wcroot / nm. |
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
124 |
entry track. |
44 | 125 |
] |
126 |
||
127 |
"Created: / 11-04-2008 / 10:58:53 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
128 |
"Modified: / 19-08-2009 / 14:00:26 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
53
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
129 |
"Modified: / 15-11-2012 / 00:14:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
44 | 130 |
! |
131 |
||
132 |
doCompileCopyrightMethods |
|
133 |
| klasses source | |
|
134 |
||
135 |
(self packageDefinition class includesSelector: #copyright) ifFalse:[^self]. |
|
136 |
ActivityNotification notify:'Compiling #copyright methods...'. |
|
137 |
klasses := self classesToFileOut asArray. |
|
138 |
source := (self packageDefinition class compiledMethodAt: #copyright) source. |
|
139 |
||
140 |
klasses |
|
141 |
withIndexDo:[:cls :index | |
|
142 |
|metaCls| |
|
143 |
metaCls := cls theMetaclass. |
|
144 |
(((metaCls includesSelector:#copyright) not) and:[metaCls programmingLanguage isSmalltalk]) |
|
145 |
ifTrue:[ |
|
146 |
metaCls compile:source classified:'documentation'. |
|
147 |
(metaCls compiledMethodAt:#copyright) |
|
131
8986734fe8e2
Bugfix in SCMAbstractFileoutLikeTask>>doCompileCopyrightMethods
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
122
diff
changeset
|
148 |
setPackage:self package name asSymbol |
44 | 149 |
]. |
302
e078bdcef149
Fixes for Smalltalk/X 6.2.2 (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
271
diff
changeset
|
150 |
ProgressNotification newException |
e078bdcef149
Fixes for Smalltalk/X 6.2.2 (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
271
diff
changeset
|
151 |
messageText: ('Compiling %1 (%2)' bindWith:#copyright |
e078bdcef149
Fixes for Smalltalk/X 6.2.2 (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
271
diff
changeset
|
152 |
with:cls nameWithoutPrefix); |
e078bdcef149
Fixes for Smalltalk/X 6.2.2 (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
271
diff
changeset
|
153 |
parameter: (100 / klasses size) * index; |
e078bdcef149
Fixes for Smalltalk/X 6.2.2 (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
271
diff
changeset
|
154 |
raiseRequest. |
e078bdcef149
Fixes for Smalltalk/X 6.2.2 (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
271
diff
changeset
|
155 |
|
44 | 156 |
] |
157 |
||
158 |
"Modified: / 16-08-2009 / 12:59:50 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
159 |
"Created: / 08-04-2010 / 14:31:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
302
e078bdcef149
Fixes for Smalltalk/X 6.2.2 (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
271
diff
changeset
|
160 |
"Modified: / 30-06-2013 / 12:44:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
44 | 161 |
! |
162 |
||
163 |
doCompileVersionMethods |
|
164 |
|klasses versionMethodName| |
|
165 |
||
166 |
versionMethodName := self package manager nameOfVersionMethodInClasses. |
|
167 |
ActivityNotification notify:'Compiling #version methods...'. |
|
168 |
klasses := self classesToFileOut asArray. |
|
169 |
klasses |
|
170 |
withIndexDo:[:cls :index | |
|
171 |
|metaCls| |
|
172 |
||
173 |
metaCls := cls theMetaclass. |
|
174 |
((metaCls includesSelector:versionMethodName) not |
|
53
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
175 |
"JV@2012-11-14: libsvn did this check, however, it is not valid for |
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
176 |
SCMs that does not expand keywords. I disable it, but kept as comment |
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
177 |
as I do not remember why it was good for..." |
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
178 |
"or:[ ((cls perform:versionMethodName asSymbol) startsWith:'$Id') not ]") |
44 | 179 |
ifTrue:[ |
180 |
metaCls compile:(metaCls |
|
181 |
versionMethodTemplateForSourceCodeManager:self package manager) |
|
182 |
classified:'documentation'. |
|
183 |
(metaCls compiledMethodAt:versionMethodName) |
|
184 |
setPackage:self package name asSymbol |
|
185 |
]. |
|
186 |
self package manager utilities ensureCorrectVersionMethodsInClass: cls usingManager: self package manager. |
|
302
e078bdcef149
Fixes for Smalltalk/X 6.2.2 (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
271
diff
changeset
|
187 |
^ ProgressNotification newException |
e078bdcef149
Fixes for Smalltalk/X 6.2.2 (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
271
diff
changeset
|
188 |
messageText: ('Compiling %1 (%2)' bindWith:versionMethodName |
e078bdcef149
Fixes for Smalltalk/X 6.2.2 (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
271
diff
changeset
|
189 |
with:cls nameWithoutPrefix); |
e078bdcef149
Fixes for Smalltalk/X 6.2.2 (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
271
diff
changeset
|
190 |
parameter: (100 / klasses size) * index; |
e078bdcef149
Fixes for Smalltalk/X 6.2.2 (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
271
diff
changeset
|
191 |
raiseRequest |
44 | 192 |
]. |
193 |
||
194 |
self extensionMethodsToFileOut notEmpty ifTrue:[ |
|
195 |
| def | |
|
196 |
||
197 |
"TODO: Not programming language aware..." |
|
198 |
((def := self packageDefinition) class includesSelector: self package manager nameOfVersionMethodForExtensions) ifFalse:[ |
|
199 |
def class |
|
200 |
compile: |
|
201 |
(self package manager versionMethodTemplateForSmalltalkFor:self package manager nameOfVersionMethodForExtensions) |
|
202 |
classified: #documentation. |
|
203 |
(def class compiledMethodAt:self package manager nameOfVersionMethodForExtensions) |
|
70
3faeae24a513
fix in SCMAbstractFileoutLikeTask>>doCompileVersionMethods
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
53
diff
changeset
|
204 |
setPackage:self package name asSymbol |
44 | 205 |
|
206 |
] |
|
207 |
] |
|
208 |
||
209 |
"Created: / 28-05-2008 / 07:43:43 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
210 |
"Modified: / 16-08-2009 / 12:59:50 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
211 |
"Modified: / 07-07-2011 / 20:15:21 / jv" |
|
302
e078bdcef149
Fixes for Smalltalk/X 6.2.2 (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
271
diff
changeset
|
212 |
"Modified: / 30-06-2013 / 12:43:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
44 | 213 |
! |
214 |
||
122
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
215 |
doFileOut |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
216 |
"Fileouts everything to the working copy" |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
217 |
|
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
218 |
self |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
219 |
doUpdateBuildSupportFiles; |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
220 |
doRenameContainers; |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
221 |
doFileOutPackageClasses; |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
222 |
doFileOutPackageExtensions; |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
223 |
doAddNewContainers; |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
224 |
doRemoveOldContainers. |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
225 |
|
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
226 |
"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
|
227 |
"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
|
228 |
! |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
229 |
|
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
230 |
doFileOutAll |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
231 |
|
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
232 |
self |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
233 |
doUpdateCode; |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
234 |
doFileOut. |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
235 |
|
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
236 |
"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
|
237 |
"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
|
238 |
! |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
239 |
|
44 | 240 |
doFileOutPackageClasses |
241 |
|klasses| |
|
242 |
||
243 |
suppressClasses == true ifTrue:[^self]. |
|
244 |
||
245 |
ActivityNotification notify:'Filing out package classes'. |
|
246 |
klasses := self classesToFileOut asArray. |
|
247 |
klasses |
|
248 |
withIndexDo:[:cls :index | |
|
249 |
|clsStream| |
|
302
e078bdcef149
Fixes for Smalltalk/X 6.2.2 (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
271
diff
changeset
|
250 |
ProgressNotification newException |
e078bdcef149
Fixes for Smalltalk/X 6.2.2 (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
271
diff
changeset
|
251 |
messageText: 'Filing out ' , cls nameWithoutPrefix; |
e078bdcef149
Fixes for Smalltalk/X 6.2.2 (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
271
diff
changeset
|
252 |
parameter: (100 / klasses size) * index; |
e078bdcef149
Fixes for Smalltalk/X 6.2.2 (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
271
diff
changeset
|
253 |
raiseRequest. |
44 | 254 |
|
302
e078bdcef149
Fixes for Smalltalk/X 6.2.2 (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
271
diff
changeset
|
255 |
(self shouldFileOutClass:cls) ifTrue:[self package fileOutClass: cls] |
e078bdcef149
Fixes for Smalltalk/X 6.2.2 (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
271
diff
changeset
|
256 |
]. |
44 | 257 |
|
258 |
"Created: / 11-04-2008 / 10:58:16 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
259 |
"Modified: / 19-08-2009 / 13:44:00 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
302
e078bdcef149
Fixes for Smalltalk/X 6.2.2 (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
271
diff
changeset
|
260 |
"Modified: / 30-06-2013 / 00:16:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
44 | 261 |
! |
262 |
||
263 |
doFileOutPackageExtensions |
|
264 |
||
265 |
suppressExtensions == true ifTrue:[^self]. |
|
266 |
||
267 |
self extensionMethodsToFileOut isEmpty ifTrue:[^self]. |
|
268 |
self package fileOutExtensions: self extensionMethodsToFileOut |
|
269 |
||
270 |
"Modified: / 07-04-2008 / 08:37:25 / janfrog" |
|
271 |
"Created: / 11-04-2008 / 10:58:36 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
272 |
"Modified: / 14-05-2009 / 13:37:40 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
273 |
"Modified: / 07-10-2012 / 10:56:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
274 |
! |
|
275 |
||
276 |
doInitStateVariables |
|
277 |
packageClassesChanged := self package classesHasChanged. |
|
278 |
packageExtensionsChanged := self package extensionsHasChanged. |
|
279 |
||
280 |
"Created: / 17-06-2009 / 10:17:04 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
281 |
"Modified: / 13-08-2009 / 10:18:37 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
282 |
"Modified: / 06-10-2012 / 23:28:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
283 |
! |
|
284 |
||
285 |
doRemoveOldContainers |
|
53
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
286 |
| wcroot containers containersToKeep containersToDelete | |
44 | 287 |
|
288 |
self isSelectiveFileoutTask ifTrue:[ |
|
289 |
^ self |
|
290 |
]. |
|
291 |
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
|
292 |
wcroot := package temporaryWorkingCopyRoot. |
53
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
293 |
containers := self package containers. |
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
294 |
containersToKeep := self package containersToKeep. |
44 | 295 |
containersToDelete := containers \ containersToKeep. |
53
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
296 |
containersToDelete do:[:nm| |
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
297 |
| entry | |
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
298 |
|
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
299 |
entry := wcroot / nm. |
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
300 |
entry remove |
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
301 |
] |
44 | 302 |
|
303 |
"Created: / 11-04-2008 / 11:00:27 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
304 |
"Modified: / 19-08-2009 / 15:03:51 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
53
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
305 |
"Modified: / 15-11-2012 / 00:54:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
44 | 306 |
! |
307 |
||
308 |
doRenameContainerForClassNamed: new using: renames language: lang |
|
309 |
||
53
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
310 |
| wcroot old oldC oldE newC newE | |
44 | 311 |
old := renames at: new. |
312 |
(renames includesKey: old) ifTrue:[ |
|
313 |
self doRenameContainerForClassNamed: old using: renames language: lang. |
|
314 |
]. |
|
117
3014c22e2eab
Refactoring (part 1): SCMPackageModel>>workingCopy renamed to temporaryWorkingCopy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
315 |
wcroot := package temporaryWorkingCopyRoot. |
81
eeb86ad71bc3
Fixed all references to libsvn classes. Added SCMCompatModeQuery.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
70
diff
changeset
|
316 |
oldC := self package containerNameForClassNamed: old language: lang . |
eeb86ad71bc3
Fixed all references to libsvn classes. Added SCMCompatModeQuery.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
70
diff
changeset
|
317 |
newC := self package containerNameForClassNamed: new language: lang . |
89
874f18be0cbd
Fixed renaming of class containers.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
81
diff
changeset
|
318 |
(oldE := wcroot / oldC) exists ifTrue:[ |
44 | 319 |
packageClassesChanged := true. |
53
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
320 |
newE := wcroot / newC. |
89
874f18be0cbd
Fixed renaming of class containers.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
81
diff
changeset
|
321 |
oldE moveTo: newE. |
44 | 322 |
]. |
323 |
||
324 |
"Created: / 11-04-2008 / 11:00:27 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
325 |
"Modified: / 19-08-2009 / 15:03:51 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
326 |
"Created: / 06-08-2011 / 21:33:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
89
874f18be0cbd
Fixed renaming of class containers.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
81
diff
changeset
|
327 |
"Modified: / 21-11-2012 / 00:43:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
44 | 328 |
! |
329 |
||
330 |
doRenameContainers |
|
331 |
||
332 |
| renames | |
|
333 |
renames := Dictionary new. |
|
334 |
ChangeSet current do: |
|
335 |
[:chg| |
|
336 |
chg isClassRenameChange ifTrue:[ |
|
337 |
renames at: chg className put: chg oldName. |
|
338 |
]]. |
|
339 |
self classesToFileOut do:[:cls| |
|
340 |
(renames includesKey: cls name) ifTrue:[ |
|
341 |
self doRenameContainerForClassNamed: cls name using: renames language: cls programmingLanguage. |
|
342 |
] |
|
343 |
] |
|
344 |
||
345 |
"Created: / 11-04-2008 / 11:00:27 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
346 |
"Modified: / 19-08-2009 / 15:03:51 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
347 |
"Created: / 06-08-2011 / 21:13:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
348 |
! |
|
349 |
||
350 |
doUpdateBuildSupportFiles |
|
351 |
|pkgDef| |
|
352 |
||
353 |
suppresBuildSupportFiles == true ifTrue:[ |
|
354 |
^self. |
|
355 |
]. |
|
356 |
||
357 |
pkgDef := self package definition. |
|
358 |
||
359 |
(self isSelectiveFileoutTask and:[packageClassesChanged not and:[(classes includes: pkgDef) not]]) ifTrue:[ |
|
360 |
^self. |
|
361 |
]. |
|
362 |
||
363 |
ActivityNotification notify:'Updating build files'. |
|
364 |
"First, generate files into a temporary files - so originals |
|
365 |
are not destroyed when something goes wrong." |
|
366 |
self filesToGenerate do:[:supportFileName | |
|
367 |
| supportFile | |
|
368 |
||
117
3014c22e2eab
Refactoring (part 1): SCMPackageModel>>workingCopy renamed to temporaryWorkingCopy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
369 |
supportFile := self temporaryWorkingCopyRoot / (supportFileName , '.tmp'). |
44 | 370 |
(packageClassesChanged or:[ supportFile exists not ]) ifTrue:[ |
371 |
ActivityNotification notify:'Updating ' , supportFileName. |
|
372 |
supportFile directory exists ifFalse: [supportFile directory makeDirectory]. |
|
373 |
supportFile writingFileDo:[:s| |
|
374 |
s nextPutAll:(self for: pkgDef generateFile:supportFileName) |
|
375 |
] |
|
376 |
] |
|
377 |
]. |
|
378 |
"Now, copy them over the old files" |
|
379 |
self filesToGenerate do:[:supportFileName | |
|
380 |
| supportFile supportFileTmp | |
|
381 |
||
117
3014c22e2eab
Refactoring (part 1): SCMPackageModel>>workingCopy renamed to temporaryWorkingCopy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
382 |
supportFile := package temporaryWorkingCopyRoot / supportFileName. |
3014c22e2eab
Refactoring (part 1): SCMPackageModel>>workingCopy renamed to temporaryWorkingCopy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
383 |
supportFileTmp := package temporaryWorkingCopyRoot / (supportFileName , '.tmp'). |
44 | 384 |
|
53
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
385 |
supportFileTmp moveTo: supportFile. |
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
386 |
supportFile track. |
44 | 387 |
]. |
388 |
||
389 |
"Created: / 20-06-2009 / 16:01:16 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
390 |
"Modified: / 21-06-2009 / 15:18:17 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
171
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
131
diff
changeset
|
391 |
"Modified: / 12-01-2013 / 13:54:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
44 | 392 |
! |
393 |
||
122
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
394 |
doUpdateCode |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
395 |
"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
|
396 |
|
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
397 |
self |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
398 |
doInitStateVariables; |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
399 |
doCompileVersionMethods; |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
400 |
doCompileCopyrightMethods; |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
401 |
doUpdateProjectDefinition. |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
402 |
|
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
403 |
"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
|
404 |
! |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
405 |
|
44 | 406 |
doUpdateProjectDefinition |
271
b0f2a22871b6
Care for class removal and superclass/pool change.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
268
diff
changeset
|
407 |
| prjClass classesSpec classNamesAndAttributesMap | |
44 | 408 |
|
409 |
(packageClassesChanged | packageExtensionsChanged) ifFalse:[ |
|
410 |
^ self |
|
411 |
]. |
|
412 |
ActivityNotification notify:'Updating project definition'. |
|
268
ceb9b128eeba
Fix in SCMAbstractFileoutLikeTask>>#doUpdateProjectDefinition.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
184
diff
changeset
|
413 |
prjClass := ProjectDefinition definitionClassForPackage:self 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
|
414 |
|
b0f2a22871b6
Care for class removal and superclass/pool change.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
268
diff
changeset
|
415 |
"/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
|
416 |
classNamesAndAttributesMap := Dictionary new. |
b0f2a22871b6
Care for class removal and superclass/pool change.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
268
diff
changeset
|
417 |
prjClass classNamesAndAttributes do:[:nameOrPair | |
b0f2a22871b6
Care for class removal and superclass/pool change.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
268
diff
changeset
|
418 |
nameOrPair isArray |
b0f2a22871b6
Care for class removal and superclass/pool change.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
268
diff
changeset
|
419 |
ifTrue:[classNamesAndAttributesMap at: nameOrPair first put: nameOrPair] |
b0f2a22871b6
Care for class removal and superclass/pool change.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
268
diff
changeset
|
420 |
ifFalse:[classNamesAndAttributesMap at: nameOrPair put: (Array with: nameOrPair)] |
b0f2a22871b6
Care for class removal and superclass/pool change.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
268
diff
changeset
|
421 |
]. |
b0f2a22871b6
Care for class removal and superclass/pool change.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
268
diff
changeset
|
422 |
classesSpec := prjClass searchForClasses collect:[:cls| |
b0f2a22871b6
Care for class removal and superclass/pool change.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
268
diff
changeset
|
423 |
classNamesAndAttributesMap at: cls name ifAbsent:[Array with: cls name] |
b0f2a22871b6
Care for class removal and superclass/pool change.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
268
diff
changeset
|
424 |
]. |
b0f2a22871b6
Care for class removal and superclass/pool change.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
268
diff
changeset
|
425 |
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
|
426 |
|
b0f2a22871b6
Care for class removal and superclass/pool change.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
268
diff
changeset
|
427 |
|
b0f2a22871b6
Care for class removal and superclass/pool change.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
268
diff
changeset
|
428 |
"/Now do standard update |
b0f2a22871b6
Care for class removal and superclass/pool change.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
268
diff
changeset
|
429 |
Class packageQuerySignal answer:prjClass package do:[ |
b0f2a22871b6
Care for class removal and superclass/pool change.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
268
diff
changeset
|
430 |
prjClass theNonMetaclass |
b0f2a22871b6
Care for class removal and superclass/pool change.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
268
diff
changeset
|
431 |
forEachContentsMethodsCodeToCompileDo:[:code :category | |
b0f2a22871b6
Care for class removal and superclass/pool change.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
268
diff
changeset
|
432 |
(code startsWith: 'excludedFromPreRequisites') |
b0f2a22871b6
Care for class removal and superclass/pool change.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
268
diff
changeset
|
433 |
ifFalse:[prjClass theMetaclass compile:code classified:category] |
b0f2a22871b6
Care for class removal and superclass/pool change.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
268
diff
changeset
|
434 |
] |
b0f2a22871b6
Care for class removal and superclass/pool change.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
268
diff
changeset
|
435 |
"/ignoreOldEntries: false |
b0f2a22871b6
Care for class removal and superclass/pool change.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
268
diff
changeset
|
436 |
ignoreOldDefinition: false |
b0f2a22871b6
Care for class removal and superclass/pool change.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
268
diff
changeset
|
437 |
] |
44 | 438 |
|
439 |
"Created: / 11-04-2008 / 11:01:06 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
440 |
"Modified: / 13-08-2009 / 09:13:14 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
271
b0f2a22871b6
Care for class removal and superclass/pool change.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
268
diff
changeset
|
441 |
"Modified: / 19-03-2013 / 10:35:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
44 | 442 |
! ! |
443 |
||
444 |
!SCMAbstractFileoutLikeTask methodsFor:'private'! |
|
445 |
||
446 |
classesToFileOut |
|
447 |
||
448 |
suppressClasses == true ifTrue:[^#()]. |
|
449 |
||
450 |
^ self package classesFiltered: |
|
451 |
[:class | |
|
452 |
class isLoaded and: [ classes isNil or: [ classes includes: class ] ] ] |
|
453 |
||
454 |
"Created: / 23-03-2009 / 12:08:24 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
455 |
"Modified: / 11-06-2009 / 18:17:38 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
456 |
"Modified: / 06-10-2012 / 23:28:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
457 |
! |
|
458 |
||
459 |
containersToFileOut |
|
460 |
| containers extensions | |
|
461 |
||
462 |
containers := self classesToFileOut |
|
463 |
collect: [:class | package containerNameForClass: class ]. |
|
464 |
(extensions := self extensionMethodsToFileOut) notEmpty ifTrue: |
|
465 |
[| languages | |
|
466 |
languages := (extensions collect:[:each|each programmingLanguage]) asSet. |
|
467 |
languages do: |
|
468 |
[:lang|containers add: (package containerNameForExtensions: lang)]]. |
|
469 |
^ containers |
|
470 |
||
471 |
"Created: / 14-05-2009 / 11:35:05 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
472 |
"Modified: / 07-10-2012 / 10:57:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
473 |
! |
|
474 |
||
475 |
extensionMethodsToFileOut |
|
476 |
^ self package extensionsFiltered: |
|
477 |
[:mth | |
|
478 |
extensionMethods isNil or: [ extensionMethods includes: mth ] ] |
|
479 |
||
480 |
"Created: / 14-05-2009 / 11:32:01 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
481 |
"Modified: / 06-10-2012 / 23:28:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
482 |
! |
|
483 |
||
484 |
for: def generateFile: file |
|
485 |
||
486 |
| contents savedClassFilenames | |
|
487 |
||
488 |
||
489 |
file ~= 'abbrev.stc' ifTrue:[^def generateFile: file]. |
|
490 |
||
491 |
"Yet another kludge to trick Smalltalk>>fileNameForClass:, sigh" |
|
492 |
||
493 |
savedClassFilenames := Dictionary new. |
|
494 |
(def searchForClasses reject:[:e|e owningClass notNil]) do: |
|
495 |
[:cls| |
|
496 |
savedClassFilenames |
|
497 |
at: cls |
|
498 |
put: cls getClassFilename. |
|
81
eeb86ad71bc3
Fixed all references to libsvn classes. Added SCMCompatModeQuery.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
70
diff
changeset
|
499 |
cls setClassFilename: (self package containerNameForClass: cls)]. |
44 | 500 |
contents := def generateFile: file. |
501 |
savedClassFilenames keysAndValuesDo: |
|
502 |
[:cls :classFileName| |
|
503 |
cls setClassFilename: classFileName]. |
|
504 |
^contents |
|
81
eeb86ad71bc3
Fixed all references to libsvn classes. Added SCMCompatModeQuery.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
70
diff
changeset
|
505 |
|
eeb86ad71bc3
Fixed all references to libsvn classes. Added SCMCompatModeQuery.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
70
diff
changeset
|
506 |
"Modified: / 19-11-2012 / 23:01:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
44 | 507 |
! |
508 |
||
509 |
shouldFileOutClass: class |
|
510 |
||
511 |
"Do not fileout autoloaded classes, |
|
512 |
they are untouched" |
|
513 |
class isLoaded ifFalse:[^false]. |
|
514 |
||
515 |
class theNonMetaclass |
|
516 |
methodsDo:[:mth|(self shouldFileOutMethod: mth) ifTrue:[^true]]. |
|
184
e31e5bc69918
Bugfix in SCMAbstractFileoutLikeTask>>#shouldFileOutClass: care about removed methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
171
diff
changeset
|
517 |
|
44 | 518 |
class theMetaclass |
519 |
methodsDo:[:mth|(self shouldFileOutMethod: mth) ifTrue:[^true]]. |
|
184
e31e5bc69918
Bugfix in SCMAbstractFileoutLikeTask>>#shouldFileOutClass: care about removed methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
171
diff
changeset
|
520 |
|
44 | 521 |
class privateClasses |
522 |
do:[:cls|(self shouldFileOutClass: cls) ifTrue:[^true]]. |
|
184
e31e5bc69918
Bugfix in SCMAbstractFileoutLikeTask>>#shouldFileOutClass: care about removed methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
171
diff
changeset
|
523 |
|
e31e5bc69918
Bugfix in SCMAbstractFileoutLikeTask>>#shouldFileOutClass: care about removed methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
171
diff
changeset
|
524 |
(ChangeSet current includesChangeForClass:class) ifTrue:[ ^ true ]. |
e31e5bc69918
Bugfix in SCMAbstractFileoutLikeTask>>#shouldFileOutClass: care about removed methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
171
diff
changeset
|
525 |
|
44 | 526 |
^false |
527 |
||
528 |
" |
|
529 |
CommitTask basicNew |
|
530 |
package: #'stx:libsvn'; |
|
531 |
shouldFileOutClass: CommitTask |
|
532 |
||
533 |
CommitTask basicNew |
|
534 |
package: #'stx:libbasic'; |
|
535 |
shouldFileOutClass: Object |
|
536 |
" |
|
537 |
||
538 |
"Created: / 24-06-2009 / 19:04:48 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
539 |
"Modified: / 19-08-2009 / 13:54:39 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
184
e31e5bc69918
Bugfix in SCMAbstractFileoutLikeTask>>#shouldFileOutClass: care about removed methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
171
diff
changeset
|
540 |
"Modified: / 21-01-2013 / 19:35:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
44 | 541 |
! |
542 |
||
543 |
shouldFileOutMethod: mth |
|
544 |
||
53
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
545 |
^mth package = package name and: |
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
546 |
[mth getSourcePosition isNil] |
44 | 547 |
|
548 |
"Created: / 24-06-2009 / 19:07:27 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
53
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
549 |
"Modified (comment): / 15-11-2012 / 00:36:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
44 | 550 |
! ! |
551 |
||
552 |
!SCMAbstractFileoutLikeTask methodsFor:'queries'! |
|
553 |
||
554 |
isSelectiveFileoutTask |
|
555 |
^ classes notNil or: [ extensionMethods notNil ] |
|
556 |
||
557 |
"Created: / 14-05-2009 / 13:24:52 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
558 |
! ! |
|
559 |
||
560 |
!SCMAbstractFileoutLikeTask class methodsFor:'documentation'! |
|
561 |
||
562 |
version_GIT |
|
563 |
"Never, ever change this method. Ask JV or CG why" |
|
564 |
^thisContext method mclass theNonMetaclass instVarNamed: #revision |
|
565 |
! |
|
566 |
||
53
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
567 |
version_HG |
114
8b27cb46af9a
version_HG changed to return String.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
89
diff
changeset
|
568 |
|
8b27cb46af9a
version_HG changed to return String.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
89
diff
changeset
|
569 |
^ '$Changeset: <not expanded> $' |
53
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
570 |
! |
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
571 |
|
44 | 572 |
version_SVN |
70
3faeae24a513
fix in SCMAbstractFileoutLikeTask>>doCompileVersionMethods
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
53
diff
changeset
|
573 |
^ '§Id:: §' |
44 | 574 |
! ! |
335
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
302
diff
changeset
|
575 |