877
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger
|
1152
|
3 |
|
1155
|
4 |
New code and modifications done at SWING Research Group [1]:
|
1152
|
5 |
|
877
|
6 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
|
|
7 |
SWING Research Group, Czech Technical University in Prague
|
|
8 |
|
|
9 |
This software is furnished under a license and may be used
|
|
10 |
only in accordance with the terms of that license and with the
|
|
11 |
inclusion of the above copyright notice. This software may not
|
|
12 |
be provided or otherwise made available to, or used by, any
|
|
13 |
other person. No title to or ownership of the software is
|
|
14 |
hereby transferred.
|
|
15 |
|
1155
|
16 |
[1] Code written at SWING Research Group contains a signature
|
|
17 |
of one of the above copright owners. For exact set of such code,
|
|
18 |
see the differences between this version and version stx:libjava
|
1152
|
19 |
as of 1.9.2010
|
877
|
20 |
"
|
754
|
21 |
"{ Package: 'stx:libjava' }"
|
|
22 |
|
|
23 |
Object subclass:#JavaLibraries
|
|
24 |
instanceVariableNames:''
|
|
25 |
classVariableNames:''
|
|
26 |
poolDictionaries:''
|
|
27 |
category:'Languages-Java-Support'
|
|
28 |
!
|
|
29 |
|
877
|
30 |
!JavaLibraries class methodsFor:'documentation'!
|
|
31 |
|
|
32 |
copyright
|
|
33 |
"
|
|
34 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger
|
1152
|
35 |
|
1155
|
36 |
New code and modifications done at SWING Research Group [1]:
|
1152
|
37 |
|
877
|
38 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
|
|
39 |
SWING Research Group, Czech Technical University in Prague
|
|
40 |
|
|
41 |
This software is furnished under a license and may be used
|
|
42 |
only in accordance with the terms of that license and with the
|
|
43 |
inclusion of the above copyright notice. This software may not
|
|
44 |
be provided or otherwise made available to, or used by, any
|
|
45 |
other person. No title to or ownership of the software is
|
|
46 |
hereby transferred.
|
|
47 |
|
1155
|
48 |
[1] Code written at SWING Research Group contains a signature
|
|
49 |
of one of the above copright owners. For exact set of such code,
|
|
50 |
see the differences between this version and version stx:libjava
|
1152
|
51 |
as of 1.9.2010
|
877
|
52 |
|
|
53 |
"
|
|
54 |
! !
|
754
|
55 |
|
756
|
56 |
!JavaLibraries class methodsFor:'accessing'!
|
|
57 |
|
|
58 |
directory
|
|
59 |
|
|
60 |
^Java cacheDirectory / 'libs'
|
|
61 |
|
|
62 |
"
|
|
63 |
JavaLibraries directory
|
|
64 |
"
|
|
65 |
|
|
66 |
"Created: / 08-04-2011 / 16:27:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
67 |
!
|
|
68 |
|
|
69 |
url
|
|
70 |
|
758
|
71 |
^(Smalltalk at:#stx_libjava) svnRepositoryUrlBase , '/libs'
|
756
|
72 |
|
|
73 |
"Created: / 08-04-2011 / 16:32:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
74 |
! !
|
|
75 |
|
|
76 |
!JavaLibraries class methodsFor:'private'!
|
|
77 |
|
|
78 |
checkoutDirectory
|
|
79 |
|
968
|
80 |
"/ OperatingSystem getNetworkAddresses size < 2
|
|
81 |
"/ ifTrue:
|
|
82 |
"/ [self error: 'No network connection!!'. ^self].
|
756
|
83 |
|
|
84 |
(OperatingSystem
|
996
|
85 |
executeCommand:('svn co "%1" "%2"' bindWith: self url with: self directory asString))
|
756
|
86 |
ifFalse:
|
|
87 |
[self error: 'Cannot checkout libraries!!'. ^self].
|
|
88 |
|
|
89 |
"Created: / 08-04-2011 / 16:38:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
90 |
!
|
|
91 |
|
|
92 |
updateDirectory
|
|
93 |
|
991
|
94 |
"/ OperatingSystem getNetworkAddresses size < 2
|
|
95 |
"/ ifTrue:
|
|
96 |
"/ [^self].
|
756
|
97 |
|
|
98 |
(OperatingSystem
|
996
|
99 |
executeCommand:('svn update "%1" "%2"' bindWith: self url with: self directory asString))
|
756
|
100 |
ifFalse:
|
|
101 |
[self error: 'Cannot update libraries!!'. ^self].
|
|
102 |
|
|
103 |
"Created: / 08-04-2011 / 16:38:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
104 |
! !
|
|
105 |
|
|
106 |
!JavaLibraries class methodsFor:'utilities'!
|
|
107 |
|
970
|
108 |
addToClassPath
|
|
109 |
| dir |
|
1078
|
110 |
(dir := self directory) exists ifFalse: [ self update ].
|
|
111 |
dir recursiveDirectoryContentsAsFilenames do: [
|
|
112 |
:file |
|
|
113 |
file suffix = 'jar' ifTrue: [ Java addToClassPath: file pathName ]
|
970
|
114 |
]
|
|
115 |
|
|
116 |
"
|
|
117 |
JavaLibraries addToClassPath.
|
1078
|
118 |
Java classPath"
|
970
|
119 |
|
|
120 |
"Created: / 02-09-2011 / 09:24:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
1078
|
121 |
"Modified: / 03-11-2011 / 12:51:00 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
970
|
122 |
!
|
|
123 |
|
756
|
124 |
addToClassPath: jarname
|
|
125 |
|
|
126 |
| dir jar |
|
|
127 |
|
|
128 |
(dir := self directory) exists
|
|
129 |
ifFalse:[self update].
|
|
130 |
|
|
131 |
(jar := dir / jarname) exists
|
|
132 |
ifTrue: [Java addToClassPath: jar pathName]
|
|
133 |
ifFalse:[self error:'Library ' , jarname , ' not found in ', dir pathName].
|
|
134 |
|
|
135 |
"
|
|
136 |
JavaLibraries addToClassPath:'junit4.jar'.
|
|
137 |
Java classPath
|
|
138 |
"
|
|
139 |
|
|
140 |
"Created: / 08-04-2011 / 16:49:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
141 |
!
|
|
142 |
|
|
143 |
flush
|
|
144 |
|
|
145 |
self directory recursiveRemove
|
|
146 |
|
|
147 |
"Created: / 08-04-2011 / 16:27:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
148 |
!
|
|
149 |
|
|
150 |
update
|
|
151 |
|
|
152 |
| dir |
|
|
153 |
dir := self directory.
|
|
154 |
dir exists
|
|
155 |
ifTrue: [self updateDirectory]
|
|
156 |
ifFalse:[self checkoutDirectory]
|
|
157 |
|
968
|
158 |
"
|
|
159 |
JavaLibraries update
|
|
160 |
"
|
|
161 |
|
756
|
162 |
"Created: / 08-04-2011 / 16:29:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
163 |
! !
|
|
164 |
|
754
|
165 |
!JavaLibraries class methodsFor:'documentation'!
|
|
166 |
|
|
167 |
version_SVN
|
|
168 |
^ '$Id$'
|
|
169 |
! !
|