author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Tue, 05 Feb 2013 15:24:24 +0100 | |
changeset 219 | 475366f8ba6f |
parent 171 | 771ae4f01925 |
child 282 | fb71143ed353 |
permissions | -rw-r--r-- |
44 | 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 |
" |
|
26 |
"{ Package: 'stx:libscm/common' }" |
|
27 |
||
28 |
Object subclass:#SCMAbstractTask |
|
171
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
29 |
instanceVariableNames:'package classes temporaryWorkingCopy' |
44 | 30 |
classVariableNames:'' |
31 |
poolDictionaries:'' |
|
32 |
category:'SCM-Common-StX-Tasks' |
|
33 |
! |
|
34 |
||
35 |
!SCMAbstractTask class methodsFor:'documentation'! |
|
36 |
||
37 |
copyright |
|
38 |
" |
|
39 |
Copyright (c) 2007-2010 Jan Vrany |
|
40 |
Copyright (c) 2009-2010 eXept Software AG |
|
41 |
||
42 |
Permission is hereby granted, free of charge, to any person |
|
43 |
obtaining a copy of this software and associated documentation |
|
44 |
files (the 'Software'), to deal in the Software without |
|
45 |
restriction, including without limitation the rights to use, |
|
46 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
47 |
copies of the Software, and to permit persons to whom the |
|
48 |
Software is furnished to do so, subject to the following |
|
49 |
conditions: |
|
50 |
||
51 |
The above copyright notice and this permission notice shall be |
|
52 |
included in all copies or substantial portions of the Software. |
|
53 |
||
54 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
55 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
56 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
57 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
58 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
59 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
60 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
61 |
OTHER DEALINGS IN THE SOFTWARE. |
|
62 |
||
63 |
" |
|
64 |
! ! |
|
65 |
||
66 |
!SCMAbstractTask methodsFor:'accessing'! |
|
67 |
||
68 |
branch |
|
69 |
||
70 |
^self workingCopy branch |
|
71 |
||
72 |
"Created: / 23-03-2009 / 17:16:14 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
73 |
! |
|
74 |
||
75 |
classes |
|
76 |
^ classes |
|
77 |
! |
|
78 |
||
79 |
classes:aCollection"<Collection[Class]>" |
|
80 |
||
81 |
self |
|
82 |
assert: (aCollection allSatisfy: [:e|e isBehavior]) |
|
83 |
message: 'All elements should be classes'. |
|
84 |
||
85 |
self |
|
86 |
assert: (aCollection allSatisfy: [:e|e package = package name]) |
|
87 |
message: 'All classes should belongs to my package (' , package name , ')'. |
|
88 |
||
89 |
classes := aCollection. |
|
90 |
||
91 |
"Modified: / 16-06-2009 / 20:56:53 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
92 |
"Modified: / 14-11-2012 / 00:38:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
93 |
! |
|
94 |
||
95 |
package |
|
96 |
^ package |
|
97 |
! |
|
98 |
||
171
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
99 |
package:aSCMAbstractPackageModel |
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
100 |
package := aSCMAbstractPackageModel. |
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
101 |
temporaryWorkingCopy := aSCMAbstractPackageModel temporaryWorkingCopy |
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
102 |
|
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
103 |
"Modified: / 11-01-2013 / 19:31:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
44 | 104 |
! |
105 |
||
106 |
repository |
|
107 |
||
108 |
^self workingCopy repository |
|
109 |
||
110 |
"Created: / 23-03-2009 / 11:24:36 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
53
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
111 |
! |
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
112 |
|
171
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
113 |
temporaryWorkingCopy |
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
114 |
^ temporaryWorkingCopy |
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
115 |
! |
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
116 |
|
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
117 |
temporaryWorkingCopy: wc |
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
118 |
temporaryWorkingCopy := wc |
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
119 |
|
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
120 |
"Created: / 12-01-2013 / 13:57:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
121 |
! |
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
122 |
|
117
3014c22e2eab
Refactoring (part 1): SCMPackageModel>>workingCopy renamed to temporaryWorkingCopy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
123 |
temporaryWorkingCopyRoot |
171
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
124 |
^package notNil ifTrue:[ |
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
125 |
package temporaryWorkingCopyRoot |
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
126 |
] ifFalse:[ |
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
127 |
temporaryWorkingCopy root |
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
128 |
] |
117
3014c22e2eab
Refactoring (part 1): SCMPackageModel>>workingCopy renamed to temporaryWorkingCopy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
129 |
|
3014c22e2eab
Refactoring (part 1): SCMPackageModel>>workingCopy renamed to temporaryWorkingCopy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
130 |
"Created: / 14-11-2012 / 23:51:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
171
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
131 |
"Modified: / 12-01-2013 / 13:55:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
117
3014c22e2eab
Refactoring (part 1): SCMPackageModel>>workingCopy renamed to temporaryWorkingCopy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
132 |
! |
3014c22e2eab
Refactoring (part 1): SCMPackageModel>>workingCopy renamed to temporaryWorkingCopy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
114
diff
changeset
|
133 |
|
53
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
134 |
workingCopy |
171
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
135 |
<resource: #obsolete> |
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
136 |
|
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
137 |
self breakPoint: #jv. |
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
138 |
^self temporaryWorkingCopy |
53
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
139 |
|
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
140 |
"Created: / 14-11-2012 / 23:51:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
171
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
141 |
"Modified: / 12-01-2013 / 13:57:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
142 |
! |
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
143 |
|
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
144 |
workingCopy: wc |
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
145 |
|
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
146 |
<resource: #obsolete> |
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
147 |
|
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
148 |
self breakPoint: #jv. |
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
149 |
self temporaryWorkingCopy: wc |
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
150 |
|
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
151 |
"Created: / 11-01-2013 / 19:34:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
152 |
"Modified: / 12-01-2013 / 13:57:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
153 |
! |
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
154 |
|
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
155 |
workingCopyRoot |
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
156 |
<resource: #obsolete> |
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
157 |
|
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
158 |
self breakPoint: #jv. |
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
159 |
^self temporaryWorkingCopyRoot |
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
160 |
|
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
161 |
"Created: / 11-01-2013 / 19:32:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
771ae4f01925
Changes to support standalone commit (without package model).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
162 |
"Modified: / 12-01-2013 / 13:56:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
44 | 163 |
! ! |
164 |
||
165 |
!SCMAbstractTask methodsFor:'executing'! |
|
166 |
||
167 |
do |
|
168 |
" |
|
169 |
Perform whole task |
|
170 |
" |
|
171 |
||
172 |
^ self subclassResponsibility |
|
173 |
||
174 |
"Modified: / 23-03-2009 / 11:16:11 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
175 |
! ! |
|
176 |
||
177 |
!SCMAbstractTask methodsFor:'executing - private'! |
|
178 |
||
179 |
do: aBlock |
|
180 |
||
81
eeb86ad71bc3
Fixed all references to libsvn classes. Added SCMCompatModeQuery.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
53
diff
changeset
|
181 |
^SCMCompatModeQuery |
130
6875875e23cb
Build files regenerated. SCMCompatModeQuery now returns a package for which non-compat mode should be used.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
182 |
answer: self package name |
44 | 183 |
do: aBlock |
184 |
||
185 |
"Created: / 15-07-2009 / 20:07:14 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
130
6875875e23cb
Build files regenerated. SCMCompatModeQuery now returns a package for which non-compat mode should be used.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
186 |
"Modified: / 04-12-2012 / 17:42:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
44 | 187 |
! |
188 |
||
189 |
doCompileSvnRepositoryUrlStringMethod |
|
190 |
|pkgDef revNr| |
|
191 |
||
192 |
ActivityNotification notify:'Compiling #svnRepositoryUrlString method'. |
|
193 |
pkgDef := self workingCopy packageDefinition. |
|
194 |
(pkgDef theMetaclass includesSelector:#svnRepositoryUrlString) not |
|
195 |
ifTrue:[ |
|
196 |
pkgDef theMetaclass compile:(pkgDef svnRepositoryUrlString_code) |
|
197 |
classified:'description - svn'. |
|
198 |
(pkgDef theMetaclass compiledMethodAt:#svnRepositoryUrlString) |
|
199 |
setPackage:self package asSymbol |
|
200 |
]. |
|
201 |
||
202 |
"Created: / 08-04-2011 / 15:58:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
203 |
! |
|
204 |
||
205 |
doCompileSvnRevisionNrMethod:compileRevision |
|
206 |
|pkgDef revNr| |
|
207 |
||
208 |
ActivityNotification notify:'Compiling #svnRevisionNr method'. |
|
209 |
pkgDef := self workingCopy packageDefinition. |
|
210 |
revNr := compileRevision ifTrue:[ |
|
211 |
pkgDef svnRevision number |
|
212 |
] ifFalse:[ nil ]. |
|
213 |
(revNr notNil |
|
214 |
or:[ (pkgDef theMetaclass includesSelector:#svnRevisionNr) not ]) |
|
215 |
ifTrue:[ |
|
216 |
pkgDef theMetaclass compile:(pkgDef svnRevisionNr_code:revNr) |
|
217 |
classified:'description - svn'. |
|
218 |
(pkgDef theMetaclass compiledMethodAt:#svnRevisionNr) |
|
219 |
setPackage:self package asSymbol |
|
220 |
]. |
|
221 |
||
222 |
"Created: / 16-06-2009 / 12:16:25 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
223 |
! ! |
|
224 |
||
225 |
!SCMAbstractTask methodsFor:'notification'! |
|
226 |
||
227 |
notify: aString |
|
228 |
||
229 |
self notify: aString progress: nil |
|
230 |
||
231 |
"Created: / 29-05-2009 / 16:51:13 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
232 |
! |
|
233 |
||
234 |
notify: aString progress: aNumberOrNil |
|
235 |
||
236 |
aNumberOrNil |
|
237 |
ifNil:[ActivityNotification notify: aString] |
|
238 |
ifNotNil:[ProgressNotification notify: aString progress: aNumberOrNil] |
|
239 |
||
240 |
"Created: / 29-05-2009 / 16:51:59 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
241 |
! ! |
|
242 |
||
243 |
!SCMAbstractTask class methodsFor:'documentation'! |
|
244 |
||
245 |
version_GIT |
|
246 |
"Never, ever change this method. Ask JV or CG why" |
|
247 |
^thisContext method mclass theNonMetaclass instVarNamed: #revision |
|
248 |
! |
|
249 |
||
53
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
250 |
version_HG |
114
8b27cb46af9a
version_HG changed to return String.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
81
diff
changeset
|
251 |
|
8b27cb46af9a
version_HG changed to return String.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
81
diff
changeset
|
252 |
^ '$Changeset: <not expanded> $' |
53
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
253 |
! |
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
254 |
|
44 | 255 |
version_SVN |
81
eeb86ad71bc3
Fixed all references to libsvn classes. Added SCMCompatModeQuery.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
53
diff
changeset
|
256 |
^ '§Id:: §' |
44 | 257 |
! ! |