author | Claus Gittinger <cg@exept.de> |
Thu, 27 Mar 2014 21:44:08 +0100 | |
changeset 920 | 3d0f65b1ab71 |
parent 889 | 329193445e6f |
child 943 | 020cfc28a757 |
permissions | -rw-r--r-- |
429 | 1 |
"{ Package: 'stx:goodies/monticello' }"! |
2 |
||
3 |
!Annotation class methodsFor:'instance creation'! |
|
395 | 4 |
|
5 |
mctimestamp: aString |
|
6 |
||
7 |
^MCTimestampAnnotation new timestamp: aString |
|
8 |
||
9 |
"Created: / 14-09-2010 / 15:35:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10 |
! ! |
|
11 |
||
429 | 12 |
!Behavior methodsFor:'*monticello-squeakCompatibility'! |
395 | 13 |
|
14 |
includesLocalSelector:aSymbol |
|
15 |
^ self localSelectors includes:aSymbol |
|
16 |
||
17 |
"Created: / 26-08-2009 / 11:50:00 / Jaroslav Havlin <havlij6@fel.cvut.cz>" |
|
18 |
! ! |
|
19 |
||
429 | 20 |
!Behavior methodsFor:'*monticello-squeakCompatibility'! |
395 | 21 |
|
22 |
localSelectors |
|
23 |
^ self methodDictionary collect:[:x | x selector asSymbol ] |
|
24 |
||
25 |
"Created: / 26-08-2009 / 11:53:47 / Jaroslav Havlin <havlij6@fel.cvut.cz>" |
|
26 |
! ! |
|
27 |
||
429 | 28 |
!Behavior methodsFor:'*monticello-squeakCompatibility'! |
395 | 29 |
|
30 |
traitCompositionString |
|
31 |
^ '{}' |
|
32 |
||
33 |
"Created: / 26-08-2009 / 12:43:23 / Jaroslav Havlin <havlij6@fel.cvut.cz>" |
|
34 |
! ! |
|
35 |
||
429 | 36 |
!Behavior methodsFor:'*monticello-squeakCompatibility'! |
150 | 37 |
|
38 |
typeOfClass |
|
395 | 39 |
"Answer a symbol uniquely describing the type of the receiver" |
40 |
"self instSpec = CompiledMethod instSpec ifTrue:[^#compiledMethod]." "Very special!!" |
|
41 |
self isBytes ifTrue:[^#bytes]. |
|
42 |
(self isWords and:[self isPointers not]) ifTrue:[^#words]. |
|
43 |
self isWeakPointers ifTrue:[^#weak]. |
|
44 |
self isVariable ifTrue:[^#variable]. |
|
45 |
^#normal. |
|
46 |
||
47 |
"Created: / 26-08-2009 / 12:45:50 / Jaroslav Havlin <havlij6@fel.cvut.cz>" |
|
48 |
! ! |
|
49 |
||
429 | 50 |
!Change methodsFor:'accessing'! |
395 | 51 |
|
52 |
mcDefinition |
|
53 |
||
54 |
^self objectAttributeAt: #mcDefinition |
|
55 |
||
56 |
"Created: / 08-11-2010 / 17:56:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
57 |
! ! |
|
58 |
||
429 | 59 |
!Change methodsFor:'accessing'! |
395 | 60 |
|
61 |
mcDefinition: aMCDefinition |
|
62 |
||
63 |
^self objectAttributeAt: #mcDefinition put: aMCDefinition |
|
64 |
||
65 |
"Created: / 08-11-2010 / 17:56:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
150 | 66 |
! ! |
136 | 67 |
|
436
436066f63a27
moved asStringWith*LineEndings to CharacterArray
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
429
diff
changeset
|
68 |
!CharacterArray methodsFor:'*monticello-squeakCompatibility'! |
436066f63a27
moved asStringWith*LineEndings to CharacterArray
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
429
diff
changeset
|
69 |
|
436066f63a27
moved asStringWith*LineEndings to CharacterArray
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
429
diff
changeset
|
70 |
asStringWithNativeLineEndings |
436066f63a27
moved asStringWith*LineEndings to CharacterArray
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
429
diff
changeset
|
71 |
|
436066f63a27
moved asStringWith*LineEndings to CharacterArray
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
429
diff
changeset
|
72 |
^self copyReplaceAll:Character return with: Character cr |
436066f63a27
moved asStringWith*LineEndings to CharacterArray
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
429
diff
changeset
|
73 |
|
436066f63a27
moved asStringWith*LineEndings to CharacterArray
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
429
diff
changeset
|
74 |
"Created: / 12-09-2010 / 16:00:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
436066f63a27
moved asStringWith*LineEndings to CharacterArray
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
429
diff
changeset
|
75 |
"Modified: / 13-10-2010 / 17:27:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
436066f63a27
moved asStringWith*LineEndings to CharacterArray
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
429
diff
changeset
|
76 |
! ! |
436066f63a27
moved asStringWith*LineEndings to CharacterArray
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
429
diff
changeset
|
77 |
|
436066f63a27
moved asStringWith*LineEndings to CharacterArray
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
429
diff
changeset
|
78 |
!CharacterArray methodsFor:'*monticello-squeakCompatibility'! |
436066f63a27
moved asStringWith*LineEndings to CharacterArray
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
429
diff
changeset
|
79 |
|
436066f63a27
moved asStringWith*LineEndings to CharacterArray
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
429
diff
changeset
|
80 |
asStringWithSqueakLineEndings |
436066f63a27
moved asStringWith*LineEndings to CharacterArray
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
429
diff
changeset
|
81 |
|
436066f63a27
moved asStringWith*LineEndings to CharacterArray
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
429
diff
changeset
|
82 |
^self copyReplaceAll:Character cr with: Character return |
436066f63a27
moved asStringWith*LineEndings to CharacterArray
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
429
diff
changeset
|
83 |
|
436066f63a27
moved asStringWith*LineEndings to CharacterArray
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
429
diff
changeset
|
84 |
"Created: / 12-09-2010 / 16:00:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
436066f63a27
moved asStringWith*LineEndings to CharacterArray
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
429
diff
changeset
|
85 |
"Modified: / 13-10-2010 / 17:28:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
436066f63a27
moved asStringWith*LineEndings to CharacterArray
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
429
diff
changeset
|
86 |
! ! |
436066f63a27
moved asStringWith*LineEndings to CharacterArray
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
429
diff
changeset
|
87 |
|
429 | 88 |
!Class methodsFor:'*monticello'! |
136 | 89 |
|
90 |
asClassDefinition |
|
395 | 91 |
^ MCClassDefinition |
92 |
name: self name |
|
736
43645227af41
care for nil superclass in Class >> asClassDefinition
Claus Gittinger <cg@exept.de>
parents:
732
diff
changeset
|
93 |
superclassName: (self superclass isNil ifTrue:['nil'] ifFalse:[self superclass name]) |
395 | 94 |
traitComposition: self traitCompositionString |
95 |
classTraitComposition: self class traitCompositionString |
|
96 |
category: self category |
|
97 |
instVarNames: self instVarNames |
|
98 |
classVarNames: self classVarNames |
|
99 |
poolDictionaryNames: self poolDictionaryNames |
|
100 |
classInstVarNames: self class instVarNames |
|
101 |
type: self typeOfClass |
|
102 |
comment: (self organization classComment ? '') asStringWithSqueakLineEndings |
|
103 |
commentStamp: self organization commentStamp |
|
104 |
||
105 |
"Modified: / 12-09-2010 / 17:19:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
136 | 106 |
! ! |
107 |
||
429 | 108 |
!Class methodsFor:'*monticello'! |
136 | 109 |
|
110 |
classDefinitions |
|
888
f5d285e135d2
Fix in ProjectDefinition>>monticelloName.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
883
diff
changeset
|
111 |
self isLoaded ifFalse:[self autoload]. |
136 | 112 |
^ Array with: self asClassDefinition |
113 |
! ! |
|
114 |
||
429 | 115 |
!Class methodsFor:'*monticello'! |
136 | 116 |
|
117 |
poolDictionaryNames |
|
160 | 118 |
^ self sharedPools "/ collect: [:ea | ea name "self environment keyAtIdentityValue: ea"] |
136 | 119 |
! ! |
120 |
||
429 | 121 |
!ClassDescription methodsFor:'*monticello-squeakCompatibility'! |
395 | 122 |
|
123 |
mcDefinition |
|
124 |
||
125 |
|s| |
|
126 |
||
127 |
s := WriteStream on:(String new). |
|
128 |
self |
|
129 |
basicFileOutDefinitionOn:s |
|
130 |
withNameSpace:false |
|
131 |
withPackage:false. |
|
132 |
s position: s position - 1. |
|
133 |
||
134 |
^ s contents |
|
135 |
||
136 |
"Created: / 11-09-2010 / 18:06:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
137 |
! ! |
|
138 |
||
429 | 139 |
!Object methodsFor:'*monticello'! |
136 | 140 |
|
141 |
isConflict |
|
142 |
^false |
|
143 |
! ! |
|
144 |
||
839
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
145 |
!PackageInfo methodsFor:'testing'! |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
146 |
|
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
147 |
isMCStXPackageInfo |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
148 |
^ false |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
149 |
|
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
150 |
"Created: / 29-05-2013 / 01:08:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
151 |
! ! |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
152 |
|
429 | 153 |
!ProjectDefinition class methodsFor:'code generation'! |
395 | 154 |
|
452
cbc2f85f11f8
fixes for remembering Monticello metadata
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
437
diff
changeset
|
155 |
monticelloAncestry_code |
cbc2f85f11f8
fixes for remembering Monticello metadata
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
437
diff
changeset
|
156 |
|
459
cae7224c4ab3
fixes for remembering Monticello metadata
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
452
diff
changeset
|
157 |
^'#()' |
452
cbc2f85f11f8
fixes for remembering Monticello metadata
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
437
diff
changeset
|
158 |
|
cbc2f85f11f8
fixes for remembering Monticello metadata
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
437
diff
changeset
|
159 |
"Created: / 25-08-2011 / 16:49:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
cbc2f85f11f8
fixes for remembering Monticello metadata
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
437
diff
changeset
|
160 |
! ! |
cbc2f85f11f8
fixes for remembering Monticello metadata
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
437
diff
changeset
|
161 |
|
839
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
162 |
!ProjectDefinition class methodsFor:'accessing - monticello'! |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
163 |
|
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
164 |
monticelloName |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
165 |
"Return name of the package for Monticello. |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
166 |
|
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
167 |
Historically, Monticello package membership is based on |
878 | 168 |
naming conventions. All classes whose category name starts with |
169 |
package name are considerer as belonging to the package, others |
|
170 |
do not. If classes' category does not match this naming convention, |
|
171 |
the package will fail to load back properly. |
|
839
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
172 |
|
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
173 |
Here, infer such prefix. Individual packages may override this method |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
174 |
and return a string to enforce a particular name." |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
175 |
|
878 | 176 |
| cats longest prefix index nm | |
839
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
177 |
|
889
329193445e6f
Funny, previous fix does not work. This code does.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
888
diff
changeset
|
178 |
cats := (self classes collect:[:each | each autoload; category ]) asSet. |
839
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
179 |
cats remove:#'* Projects & Packages *'. |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
180 |
cats size == 1 ifTrue:[ |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
181 |
^ cats anElement |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
182 |
]. |
878 | 183 |
cats isEmpty ifTrue:[ |
184 |
^ 'Misc_Changes' |
|
185 |
]. |
|
839
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
186 |
longest := cats inject:cats anElement |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
187 |
into:[:cat :each | |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
188 |
each size > cat size ifTrue:[ |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
189 |
each |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
190 |
] ifFalse:[ cat ] |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
191 |
]. |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
192 |
prefix := ''. |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
193 |
[ |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
194 |
(index := longest indexOf:$- startingAt:prefix size + 2) ~~ 0 |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
195 |
] whileTrue:[ |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
196 |
prefix := longest copyTo:index - 1. |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
197 |
(cats allSatisfy:[:each | each startsWith:prefix ]) ifTrue:[ |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
198 |
nm := prefix. |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
199 |
]. |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
200 |
]. |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
201 |
nm notNil ifTrue:[ |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
202 |
^ nm |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
203 |
]. |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
204 |
self |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
205 |
error:'Cannot infer Monticello package name from class categories. Please define #mcName explicitly' |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
206 |
|
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
207 |
"Created: / 29-05-2013 / 01:36:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
888
f5d285e135d2
Fix in ProjectDefinition>>monticelloName.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
883
diff
changeset
|
208 |
"Modified: / 23-06-2013 / 21:12:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
839
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
209 |
! ! |
73bbd675ef17
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
786
diff
changeset
|
210 |
|
883
3b1947942911
Added ProjectDefinition>>monticelloNameForMCZ
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
878
diff
changeset
|
211 |
!ProjectDefinition class methodsFor:'accessing - monticello'! |
3b1947942911
Added ProjectDefinition>>monticelloNameForMCZ
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
878
diff
changeset
|
212 |
|
3b1947942911
Added ProjectDefinition>>monticelloNameForMCZ
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
878
diff
changeset
|
213 |
monticelloNameForMCZ |
3b1947942911
Added ProjectDefinition>>monticelloNameForMCZ
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
878
diff
changeset
|
214 |
"Return the name of package used to build .mcz file. |
3b1947942911
Added ProjectDefinition>>monticelloNameForMCZ
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
878
diff
changeset
|
215 |
Defaults to sanitized monticelloName" |
3b1947942911
Added ProjectDefinition>>monticelloNameForMCZ
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
878
diff
changeset
|
216 |
|
3b1947942911
Added ProjectDefinition>>monticelloNameForMCZ
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
878
diff
changeset
|
217 |
^self monticelloName asString copy replaceAll: $/ with: $_; replaceAll: $: with: $_ |
3b1947942911
Added ProjectDefinition>>monticelloNameForMCZ
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
878
diff
changeset
|
218 |
|
3b1947942911
Added ProjectDefinition>>monticelloNameForMCZ
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
878
diff
changeset
|
219 |
"Created: / 07-06-2013 / 01:48:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3b1947942911
Added ProjectDefinition>>monticelloNameForMCZ
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
878
diff
changeset
|
220 |
! ! |
3b1947942911
Added ProjectDefinition>>monticelloNameForMCZ
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
878
diff
changeset
|
221 |
|
452
cbc2f85f11f8
fixes for remembering Monticello metadata
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
437
diff
changeset
|
222 |
!ProjectDefinition class methodsFor:'code generation'! |
cbc2f85f11f8
fixes for remembering Monticello metadata
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
437
diff
changeset
|
223 |
|
395 | 224 |
monticelloTimestamps_code |
225 |
||
226 |
| methodsWithTimestamp | |
|
227 |
methodsWithTimestamp := OrderedCollection new. |
|
228 |
||
229 |
self classes do:[:cls| |
|
230 |
cls methodsDo:[:mthd| |
|
231 |
(mthd hasAnnotation: #mctimestamp:) ifTrue:[ |
|
232 |
methodsWithTimestamp add: mthd |
|
233 |
] |
|
234 |
]. |
|
235 |
]. |
|
236 |
self extensionMethods do:[:mthd| |
|
237 |
(mthd hasAnnotation: #mctimestamp:) ifTrue:[ |
|
238 |
methodsWithTimestamp add: mthd |
|
239 |
] |
|
240 |
]. |
|
241 |
||
242 |
^self monticelloTimestamps_codeFor: methodsWithTimestamp |
|
243 |
||
244 |
" |
|
245 |
stx_goodies_mondrian_core monticelloTimestamps_code |
|
246 |
" |
|
247 |
||
248 |
"Created: / 09-11-2010 / 18:23:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
249 |
! ! |
|
250 |
||
429 | 251 |
!ProjectDefinition class methodsFor:'code generation'! |
395 | 252 |
|
253 |
monticelloTimestamps_codeFor: methods |
|
254 |
||
255 |
| code | |
|
256 |
code := String new writeStream. |
|
257 |
code nextPutAll:'monticelloTimestamps |
|
258 |
||
259 |
^#('. |
|
260 |
methods do:[:mthd| |
|
261 |
code |
|
262 |
tab; tab; |
|
263 |
nextPut:$(; |
|
264 |
nextPutAll: mthd mclass fullName; |
|
265 |
space; |
|
266 |
nextPutAll: mthd selector; |
|
267 |
space; |
|
268 |
nextPutAll: (mthd annotationAt: #mctimestamp:) timestamp storeString; |
|
269 |
nextPut:$); |
|
270 |
cr. |
|
271 |
]. |
|
272 |
code nextPutAll:' |
|
273 |
)'. |
|
274 |
||
275 |
^code contents |
|
276 |
||
277 |
" |
|
278 |
stx_goodies_mondrian_core mcTimestamps_code |
|
279 |
" |
|
280 |
||
281 |
"Created: / 09-11-2010 / 18:27:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
282 |
! ! |
|
283 |
||
429 | 284 |
!SequenceableCollection methodsFor:'*monticello-squeakCompatibility'! |
395 | 285 |
|
286 |
copyReplaceAll: oldSubstring with: newSubstring asTokens: ifTokens |
|
287 |
"Answer a copy of the receiver in which all occurrences of |
|
288 |
oldSubstring have been replaced by newSubstring. |
|
289 |
ifTokens (valid for Strings only) specifies that the characters |
|
290 |
surrounding the recplacement must not be alphanumeric. |
|
291 |
Bruce Simth, must be incremented by 1 and not |
|
292 |
newSubstring if ifTokens is true. See example below. " |
|
293 |
||
294 |
| aString startSearch currentIndex endIndex | |
|
295 |
(ifTokens and: [(self isString) not]) |
|
296 |
ifTrue: [(self isKindOf: Text) ifFalse: [ |
|
297 |
self error: 'Token replacement only valid for Strings']]. |
|
298 |
aString := self. |
|
299 |
startSearch := 1. |
|
300 |
[(currentIndex := aString indexOfSubCollection: oldSubstring startingAt: startSearch) |
|
301 |
> 0] |
|
302 |
whileTrue: |
|
303 |
[endIndex := currentIndex + oldSubstring size - 1. |
|
304 |
(ifTokens not |
|
305 |
or: [(currentIndex = 1 |
|
306 |
or: [(aString at: currentIndex-1) isAlphaNumeric not]) |
|
307 |
and: [endIndex = aString size |
|
308 |
or: [(aString at: endIndex+1) isAlphaNumeric not]]]) |
|
309 |
ifTrue: [aString := aString |
|
310 |
copyReplaceFrom: currentIndex |
|
311 |
to: endIndex |
|
312 |
with: newSubstring. |
|
313 |
startSearch := currentIndex + newSubstring size] |
|
314 |
ifFalse: [ |
|
315 |
ifTokens |
|
316 |
ifTrue: [startSearch := currentIndex + 1] |
|
317 |
ifFalse: [startSearch := currentIndex + newSubstring size]]]. |
|
318 |
^ aString |
|
319 |
||
320 |
"Test case: |
|
321 |
'test te string' copyReplaceAll: 'te' with: 'longone' asTokens: true " |
|
322 |
||
323 |
"Created: / 26-08-2009 / 12:40:34 / Jaroslav Havlin <havlij6@fel.cvut.cz>" |
|
324 |
! ! |
|
325 |
||
429 | 326 |
!Stream methodsFor:'*monticello'! |
136 | 327 |
|
328 |
isMessageStream |
|
329 |
^ false |
|
330 |
! ! |
|
331 |
||
429 | 332 |
!String methodsFor:'*monticello'! |
136 | 333 |
|
334 |
extractNumber |
|
335 |
^ ('0', self select: [:ea | ea isDigit]) asNumber |
|
336 |
! ! |
|
337 |
||
429 | 338 |
!String methodsFor:'*monticello-squeakCompatibility'! |
395 | 339 |
|
340 |
withSqueakLineEndings |
|
341 |
"Answer a copy of myself in which all sequences of <CR><LF> or <LF> have been changed to <CR>" |
|
342 |
| newText | |
|
343 |
(self includes: Character lf) ifFalse: [ ^self copy ]. |
|
344 |
newText := self copyReplaceAll: String crlf with: String cr. |
|
345 |
(newText asString includes: Character lf) ifFalse: [ ^newText ]. |
|
346 |
^newText copyReplaceAll: String lf with: String cr asTokens: false. |
|
347 |
||
348 |
"Created: / 26-08-2009 / 11:35:56 / Jaroslav Havlin <havlij6@fel.cvut.cz>" |
|
349 |
! ! |
|
350 |
||
429 | 351 |
!StringCollection methodsFor:'converting'! |
395 | 352 |
|
353 |
asStringWithNativeLineEndings |
|
354 |
||
355 |
^self asString |
|
356 |
||
357 |
"Created: / 12-09-2010 / 15:58:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
358 |
! ! |
|
359 |
||
429 | 360 |
!StringCollection methodsFor:'converting'! |
395 | 361 |
|
362 |
asStringWithSqueakLineEndings |
|
363 |
||
364 |
^ self |
|
365 |
asStringWith:Character return |
|
366 |
from:1 to:(self size) |
|
367 |
compressTabs:false |
|
368 |
final:nil |
|
369 |
||
370 |
"Created: / 12-09-2010 / 15:58:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
371 |
! ! |
|
372 |
||
429 | 373 |
!Symbol methodsFor:'*monticello-squeakCompatibility'! |
395 | 374 |
|
375 |
isDoIt |
|
376 |
^ (self == #DoIt) or:[ self == #DoItIn: ]. |
|
377 |
||
378 |
"Created: / 26-08-2009 / 11:46:44 / Jaroslav Havlin <havlij6@fel.cvut.cz>" |
|
379 |
! ! |
|
380 |
||
429 | 381 |
!Timestamp class methodsFor:'*monticello-instance creation'! |
395 | 382 |
|
383 |
fromMethodTimeStamp: aString |
|
384 |
| stream | |
|
385 |
stream := ReadStream on: aString. |
|
386 |
stream skipSeparators. |
|
387 |
stream skipTo: Character space. |
|
388 |
^self readFrom: stream. |
|
389 |
! ! |
|
390 |
||
429 | 391 |
!Tools::NewSystemBrowser methodsFor:'menu actions-monticello'! |
395 | 392 |
|
393 |
projectMenuMonticelloCommit |
|
736
43645227af41
care for nil superclass in Class >> asClassDefinition
Claus Gittinger <cg@exept.de>
parents:
732
diff
changeset
|
394 |
| packageName package workingCopy | |
395 | 395 |
|
396 |
packageName := self theSingleSelectedProject. |
|
736
43645227af41
care for nil superclass in Class >> asClassDefinition
Claus Gittinger <cg@exept.de>
parents:
732
diff
changeset
|
397 |
packageName isNil ifTrue:[ |
43645227af41
care for nil superclass in Class >> asClassDefinition
Claus Gittinger <cg@exept.de>
parents:
732
diff
changeset
|
398 |
Dialog information:'Please select a single project'. |
43645227af41
care for nil superclass in Class >> asClassDefinition
Claus Gittinger <cg@exept.de>
parents:
732
diff
changeset
|
399 |
^ self. |
43645227af41
care for nil superclass in Class >> asClassDefinition
Claus Gittinger <cg@exept.de>
parents:
732
diff
changeset
|
400 |
]. |
43645227af41
care for nil superclass in Class >> asClassDefinition
Claus Gittinger <cg@exept.de>
parents:
732
diff
changeset
|
401 |
|
786
8c0dffd42eb8
class: Tools::NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
402 |
SourceCodeManagerUtilities basicNew |
8c0dffd42eb8
class: Tools::NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
403 |
validateConsistencyOfPackage:packageName |
8c0dffd42eb8
class: Tools::NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
404 |
doClasses:true |
8c0dffd42eb8
class: Tools::NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
405 |
doExtensions:true. |
8c0dffd42eb8
class: Tools::NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
406 |
|
395 | 407 |
package := MCPackage named: packageName. |
408 |
workingCopy := package workingCopy. |
|
409 |
MCCommitDialog new |
|
410 |
workingCopy: workingCopy; |
|
411 |
open |
|
412 |
||
413 |
"Created: / 14-09-2010 / 22:54:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
414 |
! ! |
|
415 |
||
736
43645227af41
care for nil superclass in Class >> asClassDefinition
Claus Gittinger <cg@exept.de>
parents:
732
diff
changeset
|
416 |
!UndefinedObject methodsFor:'* monticello'! |
150 | 417 |
|
418 |
typeOfClass |
|
419 |
"Necessary to support disjoint class hierarchies." |
|
420 |
||
421 |
^#normal |
|
422 |
! ! |
|
423 |
||
554 | 424 |
!UserPreferences methodsFor:'accessing-scm-monticello'! |
395 | 425 |
|
426 |
mcEnabled |
|
554 | 427 |
"/ needed for MCSettingsApp |
395 | 428 |
|
429 |
^self at: #mcEnabled ifAbsent: [true]. |
|
430 |
||
431 |
"Created: / 16-09-2010 / 09:44:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
432 |
"Modified: / 16-09-2010 / 14:50:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
554 | 433 |
"Modified (comment): / 15-01-2012 / 14:12:53 / cg" |
395 | 434 |
! ! |
435 |
||
554 | 436 |
!UserPreferences methodsFor:'accessing-scm-monticello'! |
395 | 437 |
|
438 |
mcEnabled: aBoolean |
|
554 | 439 |
"/ needed for MCSettingsApp |
395 | 440 |
|
441 |
self at: #mcEnabled put: aBoolean. |
|
442 |
||
443 |
"Created: / 16-09-2010 / 09:44:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
571 | 444 |
"Modified: / 27-08-2012 / 11:54:43 / cg" |
395 | 445 |
! ! |
446 |
||
554 | 447 |
!UserPreferences methodsFor:'accessing-scm-monticello'! |
395 | 448 |
|
449 |
mcRepositories |
|
562
d48401867000
Fixes in preferences reading/storing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
554
diff
changeset
|
450 |
"Returns a list of MCRepository as in LITERAL ARRAY ENCODING" |
395 | 451 |
|
562
d48401867000
Fixes in preferences reading/storing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
554
diff
changeset
|
452 |
^self at: #mcRepositories ifAbsent:[#(Array)]. |
395 | 453 |
|
454 |
" |
|
562
d48401867000
Fixes in preferences reading/storing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
554
diff
changeset
|
455 |
UserPreferences current mcRepositories |
d48401867000
Fixes in preferences reading/storing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
554
diff
changeset
|
456 |
UserPreferences current mcRepositories: #(Array) |
395 | 457 |
" |
458 |
||
459 |
"Created: / 16-09-2010 / 09:47:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
562
d48401867000
Fixes in preferences reading/storing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
554
diff
changeset
|
460 |
"Modified (comment): / 04-04-2012 / 11:08:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
395 | 461 |
! ! |
462 |
||
571 | 463 |
!UserPreferences methodsFor:'accessing-scm-monticello'! |
464 |
||
465 |
mcRepositories: aCollection |
|
466 |
"/ needed for MCSettingsApp |
|
467 |
||
468 |
self at: #mcRepositories put: aCollection. |
|
469 |
||
470 |
"Created: / 27-08-2012 / 11:54:34 / cg" |
|
471 |
! ! |
|
472 |
||
429 | 473 |
!VersionInfo methodsFor:'accessing'! |
395 | 474 |
|
475 |
timeStamp |
|
476 |
||
477 |
^Timestamp |
|
478 |
fromDate: (Date fromString: date) |
|
479 |
andTime: (Time fromString: time) |
|
480 |
||
481 |
"Created: / 09-09-2010 / 15:20:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
482 |
! ! |
|
483 |
||
429 | 484 |
!stx_goodies_monticello class methodsFor:'documentation'! |
182 | 485 |
|
486 |
extensionsVersion_CVS |
|
889
329193445e6f
Funny, previous fix does not work. This code does.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
888
diff
changeset
|
487 |
^ '$Header: /cvs/stx/stx/goodies/monticello/extensions.st,v 1.25 2013-06-23 23:08:00 vrany Exp $' |
786
8c0dffd42eb8
class: Tools::NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
488 |
! ! |
883
3b1947942911
Added ProjectDefinition>>monticelloNameForMCZ
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
878
diff
changeset
|
489 |