author | Stefan Vogel <sv@exept.de> |
Fri, 11 Oct 2013 19:27:45 +0200 | |
changeset 2815 | 9cf54c8df8b7 |
parent 2678 | c865275e48a7 |
child 2731 | 13f5be2bf83b |
permissions | -rw-r--r-- |
749 | 1 |
" |
2 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
3 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
4 |
New code and modifications done at SWING Research Group [1]: |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
5 |
|
749 | 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 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
16 |
[1] Code written at SWING Research Group contains a signature |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
17 |
of one of the above copright owners. For exact set of such code, |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
18 |
see the differences between this version and version stx:libjava |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
19 |
as of 1.9.2010 |
749 | 20 |
" |
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 |
||
41 |
!JavaAntProjectResource class methodsFor:'documentation'! |
|
42 |
||
43 |
copyright |
|
44 |
" |
|
45 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
46 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
47 |
New code and modifications done at SWING Research Group [1]: |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
48 |
|
749 | 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 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
59 |
[1] Code written at SWING Research Group contains a signature |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
60 |
of one of the above copright owners. For exact set of such code, |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
61 |
see the differences between this version and version stx:libjava |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
62 |
as of 1.9.2010 |
749 | 63 |
|
64 |
" |
|
65 |
! ! |
|
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>" |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
91 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
92 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
93 |
properties |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
94 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
95 |
^#() |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
96 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
97 |
"Created: / 02-09-2011 / 09:27:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
749 | 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 |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
111 |
|
749 | 112 |
" |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
113 |
JavaTestsResource built: true. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
114 |
JavaTestsResource built: false. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
115 |
JavaTestsResource build. |
749 | 116 |
" |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
117 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
118 |
| properties cmd | |
749 | 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" |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
128 |
properties := String streamContents:[:s| |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
129 |
self properties pairsDo:[:name :value| |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
130 |
s nextPutAll:' "-D'; nextPutAll: name; nextPut: $=; nextPutAll: value; nextPut: $". |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
131 |
]. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
132 |
]. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
133 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
134 |
cmd := 'ant -f build.xml' , properties. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
135 |
|
749 | 136 |
Transcript |
137 |
show:'Running ant in '; |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
138 |
showCR:self antProjectDir asString; |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
139 |
showCR: cmd. |
749 | 140 |
OperatingSystem |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
141 |
executeCommand:cmd |
749 | 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>" |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
156 |
"Modified (comment): / 02-09-2011 / 09:32:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
749 | 157 |
! ! |
158 |
||
159 |
!JavaAntProjectResource methodsFor:'running'! |
|
160 |
||
161 |
setUp |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
162 |
self class build. |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
163 |
self class classpath do: [:each | Java addToClassPath: each ]. |
749 | 164 |
|
165 |
" |
|
166 |
JavaTestsResource basicNew setUp |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
167 |
Java classPath" |
749 | 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>" |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
171 |
"Modified: / 13-09-2012 / 20:34:19 / m" |
749 | 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 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
186 |
version_CVS |
2678
c865275e48a7
Updated to match Mercurial revision a00302fe5083 with two tweaks:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2396
diff
changeset
|
187 |
^ '$Header: /cvs/stx/stx/libjava/JavaAntProjectResource.st,v 1.4 2013-09-06 00:41:11 vrany Exp $' |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
188 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
189 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
190 |
version_HG |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
191 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
192 |
^ '$Changeset: <not expanded> $' |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
193 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
194 |
|
749 | 195 |
version_SVN |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
196 |
^ '§Id§' |
2152 | 197 |
! ! |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2152
diff
changeset
|
198 |