4 |
|
// |
5 |
|
// $Id$ |
6 |
|
|
7 |
+ |
/* Copyright 2007 Douglas Thrift |
8 |
+ |
* |
9 |
+ |
* Licensed under the Apache License, Version 2.0 (the "License"); |
10 |
+ |
* you may not use this file except in compliance with the License. |
11 |
+ |
* You may obtain a copy of the License at |
12 |
+ |
* |
13 |
+ |
* http://www.apache.org/licenses/LICENSE-2.0 |
14 |
+ |
* |
15 |
+ |
* Unless required by applicable law or agreed to in writing, software |
16 |
+ |
* distributed under the License is distributed on an "AS IS" BASIS, |
17 |
+ |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
18 |
+ |
* See the License for the specific language governing permissions and |
19 |
+ |
* limitations under the License. |
20 |
+ |
*/ |
21 |
+ |
|
22 |
|
package net.douglasthrift.anttasks; |
23 |
|
|
24 |
|
import java.io.File; |
49 |
|
private boolean nofinalize; |
50 |
|
private boolean nonative; |
51 |
|
private boolean nofp; |
52 |
< |
private ArrayList<String> classnames; |
52 |
> |
private ArrayList<String> classnames = new ArrayList<String>(); |
53 |
|
private Path dirnames; |
54 |
|
|
55 |
|
public void setClasspath(Path classpath) |
102 |
|
|
103 |
|
public void setClassnames(String classnames) |
104 |
|
{ |
90 |
– |
if (this.classnames == null) |
91 |
– |
this.classnames = new ArrayList<String>(); |
92 |
– |
|
105 |
|
for (String classname: classnames.split("[ ,]")) |
106 |
|
this.classnames.add(classname); |
107 |
|
} |
131 |
|
|
132 |
|
public void execute() |
133 |
|
{ |
134 |
< |
if (classnames == null && dirnames == null) |
134 |
> |
if (classnames.isEmpty() && dirnames == null) |
135 |
|
throw new BuildException("no classnames or dirnames"); |
136 |
|
|
137 |
|
if (this.isUpToDate()) |
173 |
|
|
174 |
|
ArrayList<String> files = new ArrayList<String>(); |
175 |
|
|
176 |
< |
if (this.classnames != null) |
177 |
< |
for (String classname: this.classnames) |
178 |
< |
{ |
179 |
< |
this.log("Preverifying " + classname); |
180 |
< |
exec.createArg().setValue(classname); |
169 |
< |
} |
176 |
> |
for (String classname: this.classnames) |
177 |
> |
{ |
178 |
> |
this.log("Preverifying " + classname); |
179 |
> |
exec.createArg().setValue(classname); |
180 |
> |
} |
181 |
|
|
182 |
|
if (this.dirnames != null) |
183 |
|
for (String dirname: this.dirnames.list()) |
194 |
|
{ |
195 |
|
FileUtils utils = FileUtils.getFileUtils(); |
196 |
|
|
197 |
< |
if (this.classnames != null) |
197 |
> |
if (!this.classnames.isEmpty()) |
198 |
|
return false; |
199 |
|
|
200 |
|
if (this.dirnames != null) |