author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Sat, 05 May 2012 22:58:24 +0100 | |
branch | jv |
changeset 17940 | 985e22966acb |
parent 17928 | 8e8dad2e6269 |
child 17955 | f5ee690b1a27 |
permissions | -rw-r--r-- |
17865 | 1 |
" |
2 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
17859 | 12 |
"{ Package: 'stx:libbasic' }" |
13 |
||
14 |
Object subclass:#ConfigurableFeatures |
|
15 |
instanceVariableNames:'' |
|
16 |
classVariableNames:'LoadedFeatures' |
|
17 |
poolDictionaries:'' |
|
18 |
category:'System-Support' |
|
19 |
! |
|
20 |
||
21 |
!ConfigurableFeatures class methodsFor:'documentation'! |
|
22 |
||
17865 | 23 |
copyright |
24 |
" |
|
25 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
26 |
All Rights Reserved |
|
27 |
||
28 |
This software is furnished under a license and may be used |
|
29 |
only in accordance with the terms of that license and with the |
|
30 |
inclusion of the above copyright notice. This software may not |
|
31 |
be provided or otherwise made available to, or used by, any |
|
32 |
other person. No title to or ownership of the software is |
|
33 |
hereby transferred. |
|
34 |
" |
|
35 |
! |
|
36 |
||
17859 | 37 |
documentation |
38 |
" |
|
39 |
being tired of finding '(Smalltalk at:someClass) notNil' all over the place, |
|
40 |
start to concentrate feature queries to this single class, which might get more |
|
41 |
feature methods via extensions. |
|
42 |
Thus, to correctly ask for a feature being present, use: |
|
43 |
ConfigurableFeature includesFeature:featureName |
|
44 |
or |
|
45 |
ConfigurableFeature knownFeatures |
|
46 |
to ask for a list of features. |
|
47 |
||
48 |
Caveat: just started; more will be moved to this place as time goes by |
|
49 |
" |
|
50 |
! ! |
|
51 |
||
52 |
!ConfigurableFeatures class methodsFor:'queries'! |
|
53 |
||
54 |
allFeatures |
|
55 |
"a list of features which are present in that smalltalk configuration" |
|
56 |
||
57 |
^ self knownFeatures select:[:each | self includesFeature:each] |
|
58 |
||
59 |
" |
|
60 |
ConfigurableFeatures allFeatures |
|
61 |
" |
|
62 |
||
63 |
"Created: / 07-09-2011 / 10:50:31 / cg" |
|
64 |
! |
|
65 |
||
66 |
includesFeature:featureName |
|
67 |
|querySelector| |
|
68 |
||
69 |
querySelector := ('has',featureName asUppercaseFirst) asSymbol. |
|
70 |
^ self perform:querySelector ifNotUnderstood:false. |
|
71 |
||
72 |
" |
|
73 |
ConfigurableFeatures includesFeature:#SubversionSupport |
|
74 |
" |
|
75 |
||
76 |
"Created: / 07-09-2011 / 10:49:08 / cg" |
|
77 |
! |
|
78 |
||
79 |
knownFeatures |
|
80 |
"a list of known features; some of them might not be present in that smalltalk configuration" |
|
81 |
||
82 |
^ self class methodDictionary keys |
|
83 |
collect:[:each | |
|
84 |
(each startsWith:'has') ifTrue:[ |
|
17912 | 85 |
(each endsWith:':') ifFalse:[ |
86 |
each copyFrom:4 |
|
87 |
] |
|
17859 | 88 |
] ifFalse:[ |
89 |
nil |
|
90 |
]. |
|
91 |
] |
|
92 |
thenSelect:[:nm | nm notNil] |
|
93 |
||
94 |
" |
|
95 |
ConfigurableFeatures allFeatures |
|
96 |
" |
|
97 |
||
98 |
"Created: / 07-09-2011 / 10:51:26 / cg" |
|
99 |
! ! |
|
100 |
||
101 |
!ConfigurableFeatures class methodsFor:'queries-features'! |
|
102 |
||
17909 | 103 |
hasCVSSupport |
104 |
"/ use Smalltalk-at to trick the dependency/prerequisite generator |
|
105 |
^ (Smalltalk at: #'CVSSourceCodeManager' ifAbsent:nil) notNil |
|
106 |
||
107 |
" |
|
108 |
ConfigurableFeatures hasCVSSupport |
|
109 |
" |
|
110 |
||
111 |
"Created: / 03-01-2012 / 15:36:54 / cg" |
|
112 |
! |
|
113 |
||
114 |
hasCVSSupportEnabled |
|
17910 | 115 |
^ self hasSCMSupportEnabledFor:#'CVSSourceCodeManager' |
17909 | 116 |
|
117 |
"Created: / 03-01-2012 / 15:42:16 / cg" |
|
118 |
! |
|
119 |
||
120 |
hasDataBaseSourceCodeManagerSupport |
|
121 |
"/ use Smalltalk-at to trick the dependency/prerequisite generator |
|
122 |
^ (Smalltalk at: #'DataBaseSourceCodeManager' ifAbsent:nil) notNil |
|
123 |
||
124 |
" |
|
125 |
ConfigurableFeatures hasDataBaseSourceCodeManagerSupport |
|
126 |
" |
|
127 |
||
128 |
"Created: / 03-01-2012 / 15:36:03 / cg" |
|
129 |
! |
|
130 |
||
131 |
hasDataBaseSourceCodeManagerSupportEnabled |
|
17910 | 132 |
^ self hasSCMSupportEnabledFor:#'DataBaseSourceCodeManager' |
17909 | 133 |
|
134 |
"Created: / 03-01-2012 / 15:36:12 / cg" |
|
135 |
! |
|
136 |
||
17940 | 137 |
hasExternalLookupSupport |
138 |
"Return true, if the VM is compiled with external lookup MOP" |
|
139 |
%{ |
|
140 |
#ifdef SUPPORT_EXTERNAL_LOOKUP |
|
141 |
RETURN ( true ); |
|
142 |
#endif |
|
143 |
%}. |
|
144 |
^false |
|
145 |
||
146 |
" |
|
147 |
ConfigurableFeatures hasExternalLookupSupport |
|
148 |
ConfigurableFeatures includesFeature:#ExternalLookupSupport |
|
149 |
" |
|
150 |
||
151 |
"Created: / 16-04-2012 / 20:00:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
152 |
! |
|
153 |
||
17909 | 154 |
hasFileBasedSourceCodeManagerSupport |
155 |
"/ use Smalltalk-at to trick the dependency/prerequisite generator |
|
156 |
^ (Smalltalk at: #'FileBasedSourceCodeManager' ifAbsent:nil) notNil |
|
157 |
||
17907 | 158 |
" |
159 |
ConfigurableFeatures hasFileBasedSourceCodeManagerSupport |
|
160 |
" |
|
161 |
||
162 |
"Created: / 21-12-2011 / 17:07:21 / cg" |
|
163 |
! |
|
164 |
||
165 |
hasFileBasedSourceCodeManagerSupportEnabled |
|
17910 | 166 |
^ self hasSCMSupportEnabledFor:#'FileBasedSourceCodeManager' |
17907 | 167 |
|
168 |
"Created: / 21-12-2011 / 17:07:08 / cg" |
|
169 |
! |
|
170 |
||
17910 | 171 |
hasMercurialSupport |
172 |
"/ use Smalltalk-at to trick the dependency/prerequisite generator |
|
173 |
^ (Smalltalk at: #'MercurialSourceCodeManager' ifAbsent:nil) notNil |
|
174 |
||
175 |
" |
|
176 |
ConfigurableFeatures hasMercurialSupport |
|
177 |
" |
|
178 |
||
179 |
"Created: / 18-01-2012 / 10:58:07 / cg" |
|
180 |
! |
|
181 |
||
182 |
hasMercurialSupportEnabled |
|
183 |
^ self hasSCMSupportEnabledFor:#'MercurialSourceCodeManager' |
|
184 |
||
185 |
" |
|
186 |
self hasMercurialSupportEnabled |
|
187 |
" |
|
188 |
||
189 |
"Created: / 18-01-2012 / 10:58:12 / cg" |
|
190 |
! |
|
191 |
||
17909 | 192 |
hasMonticelloSupport |
193 |
"/ use Smalltalk-at to trick the dependency/prerequisite generator |
|
194 |
^ (Smalltalk at: #'MonticelloSourceCodeManager' ifAbsent:nil) notNil |
|
195 |
||
196 |
" |
|
197 |
ConfigurableFeatures hasMonticelloSupport |
|
198 |
" |
|
199 |
||
200 |
"Created: / 03-01-2012 / 15:44:32 / cg" |
|
201 |
! |
|
202 |
||
203 |
hasMonticelloSupportEnabled |
|
17910 | 204 |
^ self hasSCMSupportEnabledFor:#'MonticelloSourceCodeManager' |
17909 | 205 |
|
206 |
"Created: / 03-01-2012 / 15:44:39 / cg" |
|
207 |
! |
|
208 |
||
209 |
hasPerforceSupport |
|
210 |
"/ use Smalltalk-at to trick the dependency/prerequisite generator |
|
211 |
^ (Smalltalk at: #'PerforceSourceCodeManager' ifAbsent:nil) notNil |
|
212 |
||
213 |
" |
|
214 |
ConfigurableFeatures hasPerforceSupport |
|
215 |
" |
|
17859 | 216 |
|
17909 | 217 |
"Created: / 03-01-2012 / 15:43:42 / cg" |
218 |
! |
|
219 |
||
220 |
hasPerforceSupportEnabled |
|
17910 | 221 |
^ self hasSCMSupportEnabledFor:#'PerforceSourceCodeManager' |
17909 | 222 |
|
223 |
"Created: / 03-01-2012 / 15:43:28 / cg" |
|
224 |
! |
|
225 |
||
17910 | 226 |
hasSCMSupportEnabledFor:aSourceCodeManagerClassName |
227 |
|scm| |
|
228 |
||
229 |
"/ use Smalltalk-at to trick the dependency/prerequisite generator |
|
230 |
scm := Smalltalk at:aSourceCodeManagerClassName ifAbsent:nil. |
|
231 |
||
232 |
^ scm notNil |
|
233 |
and:[ scm isLoaded |
|
234 |
and:[ scm shownInBrowserMenus ]] |
|
235 |
||
236 |
"Created: / 18-01-2012 / 10:55:58 / cg" |
|
237 |
! |
|
238 |
||
17909 | 239 |
hasSubversionSupport |
240 |
"/ use Smalltalk-at to trick the dependency/prerequisite generator |
|
17916
0c0298e5be99
SVN::SVNSourceCodeManager -> SVNSourceCodeManager
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17912
diff
changeset
|
241 |
^ (Smalltalk at: #'SVNSourceCodeManager' ifAbsent:nil) notNil |
17859 | 242 |
|
243 |
" |
|
244 |
ConfigurableFeatures hasSubversionSupport |
|
245 |
" |
|
246 |
||
247 |
"Created: / 07-09-2011 / 10:40:40 / cg" |
|
17928 | 248 |
"Modified: / 13-03-2012 / 17:19:13 / Jan Vrany <jan.vrany.fit.cvut.cz>" |
17859 | 249 |
! |
250 |
||
251 |
hasSubversionSupportEnabled |
|
17910 | 252 |
^ self hasSCMSupportEnabledFor:#'SVNSourceCodeManager' |
17859 | 253 |
|
254 |
"Created: / 07-09-2011 / 10:41:33 / cg" |
|
255 |
! ! |
|
256 |
||
257 |
!ConfigurableFeatures class methodsFor:'documentation'! |
|
258 |
||
259 |
version |
|
17940 | 260 |
^ '$Header: /cvs/stx/stx/libbasic/ConfigurableFeatures.st,v 1.8 2012/04/16 18:03:49 vrany Exp $' |
17859 | 261 |
! |
262 |
||
263 |
version_CVS |
|
17940 | 264 |
^ '§Header: /cvs/stx/stx/libbasic/ConfigurableFeatures.st,v 1.8 2012/04/16 18:03:49 vrany Exp §' |
17865 | 265 |
! |
266 |
||
267 |
version_SVN |
|
17940 | 268 |
^ '$Id: ConfigurableFeatures.st 10807 2012-05-05 21:58:24Z vranyj1 $' |
17865 | 269 |
! ! |