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 |
"
|
869
|
21 |
"{ Package: 'stx:libjava' }"
|
|
22 |
|
|
23 |
TestResource subclass:#JavaAntProjectResource
|
|
24 |
instanceVariableNames:''
|
|
25 |
classVariableNames:''
|
|
26 |
poolDictionaries:''
|
|
27 |
category:'Languages-Java-Tests'
|
|
28 |
!
|
|
29 |
|
|
30 |
JavaAntProjectResource class instanceVariableNames:'built'
|
|
31 |
|
|
32 |
"
|
|
33 |
The following class instance variables are inherited by this class:
|
|
34 |
|
|
35 |
TestResource - current
|
|
36 |
TestAsserter -
|
|
37 |
Object -
|
|
38 |
"
|
|
39 |
!
|
|
40 |
|
877
|
41 |
!JavaAntProjectResource class methodsFor:'documentation'!
|
|
42 |
|
|
43 |
copyright
|
|
44 |
"
|
|
45 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger
|
1152
|
46 |
|
1155
|
47 |
New code and modifications done at SWING Research Group [1]:
|
1152
|
48 |
|
877
|
49 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
|
|
50 |
SWING Research Group, Czech Technical University in Prague
|
|
51 |
|
|
52 |
This software is furnished under a license and may be used
|
|
53 |
only in accordance with the terms of that license and with the
|
|
54 |
inclusion of the above copyright notice. This software may not
|
|
55 |
be provided or otherwise made available to, or used by, any
|
|
56 |
other person. No title to or ownership of the software is
|
|
57 |
hereby transferred.
|
|
58 |
|
1155
|
59 |
[1] Code written at SWING Research Group contains a signature
|
|
60 |
of one of the above copright owners. For exact set of such code,
|
|
61 |
see the differences between this version and version stx:libjava
|
1152
|
62 |
as of 1.9.2010
|
877
|
63 |
|
|
64 |
"
|
|
65 |
! !
|
869
|
66 |
|
|
67 |
!JavaAntProjectResource class methodsFor:'accessing'!
|
|
68 |
|
|
69 |
antBuildDotXml
|
|
70 |
|
|
71 |
^self antProjectDir / 'build.xml'
|
|
72 |
|
|
73 |
"Created: / 18-07-2011 / 15:21:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
74 |
!
|
|
75 |
|
|
76 |
built
|
|
77 |
^ built == true
|
|
78 |
|
|
79 |
"Modified: / 18-07-2011 / 14:48:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
80 |
!
|
|
81 |
|
|
82 |
built:aBoolean
|
|
83 |
built := aBoolean.
|
|
84 |
!
|
|
85 |
|
|
86 |
classpath
|
|
87 |
|
|
88 |
^ Array with: (self antProjectDir / 'bin')
|
|
89 |
|
|
90 |
"Created: / 18-07-2011 / 15:02:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
970
|
91 |
!
|
|
92 |
|
|
93 |
properties
|
|
94 |
|
|
95 |
^#()
|
|
96 |
|
|
97 |
"Created: / 02-09-2011 / 09:27:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
869
|
98 |
! !
|
|
99 |
|
|
100 |
!JavaAntProjectResource class methodsFor:'accessing - ant project'!
|
|
101 |
|
|
102 |
antProjectDir
|
|
103 |
"raise an error: must be redefined in concrete subclass(es)"
|
|
104 |
|
|
105 |
^ self subclassResponsibility
|
|
106 |
! !
|
|
107 |
|
|
108 |
!JavaAntProjectResource class methodsFor:'running'!
|
|
109 |
|
|
110 |
build
|
970
|
111 |
|
869
|
112 |
"
|
970
|
113 |
JavaTestsResource built: true.
|
|
114 |
JavaTestsResource built: false.
|
|
115 |
JavaTestsResource build.
|
869
|
116 |
"
|
970
|
117 |
|
|
118 |
| properties cmd |
|
869
|
119 |
|
|
120 |
built == true
|
|
121 |
ifFalse:
|
|
122 |
[ "Check for ant"
|
|
123 |
self assert:(OperatingSystem canExecuteCommand:'ant')
|
|
124 |
description:'Cannot execute ant'.
|
|
125 |
self assert:self antBuildDotXml exists
|
|
126 |
description:'No build.xml in ' , self antProjectDir asString.
|
|
127 |
"Launch ant"
|
970
|
128 |
properties := String streamContents:[:s|
|
|
129 |
self properties pairsDo:[:name :value|
|
|
130 |
s nextPutAll:' "-D'; nextPutAll: name; nextPut: $=; nextPutAll: value; nextPut: $".
|
|
131 |
].
|
|
132 |
].
|
|
133 |
|
|
134 |
cmd := 'ant -f build.xml' , properties.
|
|
135 |
|
869
|
136 |
Transcript
|
|
137 |
show:'Running ant in ';
|
970
|
138 |
showCR:self antProjectDir asString;
|
|
139 |
showCR: cmd.
|
869
|
140 |
OperatingSystem
|
970
|
141 |
executeCommand:cmd
|
869
|
142 |
inputFrom:nil
|
|
143 |
outputTo:Stdout
|
|
144 |
errorTo:Stderr
|
|
145 |
inDirectory:self antProjectDir
|
|
146 |
onError:
|
|
147 |
[:status |
|
|
148 |
Transcript showCR:'ANT FAILED!!!!!!'.
|
|
149 |
self error:'ant failed'.
|
|
150 |
^ self ].
|
|
151 |
Transcript showCR:'Ant finished'.
|
|
152 |
built := true. ].
|
|
153 |
^ built.
|
|
154 |
|
|
155 |
"Modified: / 04-06-2011 / 18:03:00 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
970
|
156 |
"Modified (comment): / 02-09-2011 / 09:32:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
869
|
157 |
! !
|
|
158 |
|
|
159 |
!JavaAntProjectResource methodsFor:'running'!
|
|
160 |
|
|
161 |
setUp
|
1706
|
162 |
self class build.
|
|
163 |
self class classpath do: [:each | Java addToClassPath: each ].
|
869
|
164 |
|
|
165 |
"
|
|
166 |
JavaTestsResource basicNew setUp
|
1706
|
167 |
Java classPath"
|
869
|
168 |
|
|
169 |
"Modified: / 07-05-2011 / 18:19:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
170 |
"Created: / 18-07-2011 / 15:04:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
1706
|
171 |
"Modified: / 13-09-2012 / 20:34:19 / m"
|
869
|
172 |
! !
|
|
173 |
|
|
174 |
!JavaAntProjectResource methodsFor:'testing'!
|
|
175 |
|
|
176 |
isAvailable
|
|
177 |
|
|
178 |
^self class antProjectDir exists and:
|
|
179 |
[self class antBuildDotXml exists]
|
|
180 |
|
|
181 |
"Created: / 18-07-2011 / 15:07:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
182 |
! !
|
|
183 |
|
|
184 |
!JavaAntProjectResource class methodsFor:'documentation'!
|
|
185 |
|
|
186 |
version_SVN
|
1864
|
187 |
^ '§Id§'
|
869
|
188 |
! !
|