format + indent
git-svn-id: https://svn.apache.org/repos/asf/ant/site/xooki@1078011 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/antlib.xml b/antlib.xml
index 0859961..eaa140a 100644
--- a/antlib.xml
+++ b/antlib.xml
@@ -26,7 +26,7 @@
importClass(java.io.File);
filesets = elements.get("fileset")
- for (j=0; j<filesets.size(); j++) {
+ for (j = 0; j < filesets.size(); j++) {
fs = filesets.get(j);
srcDir = fs.getDir(project);
@@ -35,22 +35,22 @@
srcFiles = ds.getIncludedFiles();
// iterate over that array
- print('processing '+srcFiles.length+' source files...');
- for (i=0; i<srcFiles.length; i++) {
+ print('processing ' + srcFiles.length + ' source files...');
+ for (i = 0; i < srcFiles.length; i++) {
// get the values via Java API
var file = new File(fs.getDir(project), srcFiles[i]);
var basedir = file.getParent();
var filename = file.getName();
- var filepath = srcFiles[i].substring(0, srcFiles[i].lastIndexOf(project.getProperty("file.separator"))+1);
+ var filepath = srcFiles[i].substring(0, srcFiles[i].lastIndexOf(project.getProperty("file.separator")) + 1);
if (attributes.get("checkuptodate") == "true") {
- p = "xooki."+file.getAbsolutePath().replace(' ','_')+".uptodate";
+ p = "xooki." + file.getAbsolutePath().replace(' ','_') + ".uptodate";
upToDate = project.createTask("uptodate");
upToDate.setProperty(p);
upToDate.setSrcfile(file);
- upToDate.setTargetFile(new File(attributes.get("destdir")+"/"+filepath+"/"+filename));
+ upToDate.setTargetFile(new File(attributes.get("destdir") + "/" + filepath + "/" + filename));
upToDate.perform();
if (project.getProperty(p) != null) {
self.log(srcFiles[i]+" is up to date", 3);
@@ -64,7 +64,7 @@
exec.setTaskName("generate");
exec.createArg().setValue(srcDir+"/xooki/xooki.js");
exec.createArg().setValue(filename);
- exec.createArg().setValue(attributes.get("destdir")+"/"+filepath);
+ exec.createArg().setValue(attributes.get("destdir") + "/" + filepath);
if (attributes.get("printerfriendly") == "true") {
exec.createArg().setValue("print");
}
@@ -79,45 +79,45 @@
<attribute name="xookidir"/>
<attribute name="checkUpToDate"/>
<![CDATA[
- importClass(java.io.File);
+ importClass(java.io.File);
- var file = new File(attributes.get("src"));
- var destFile = new File(attributes.get("dest"));
+ var file = new File(attributes.get("src"));
+ var destFile = new File(attributes.get("dest"));
- var xookidir = attributes.get("xookidir");
- if (xookidir == null) {
- xookidir = project.getProperty("basedir") + "/xooki";
- }
+ var xookidir = attributes.get("xookidir");
+ if (xookidir == null) {
+ xookidir = project.getProperty("basedir") + "/xooki";
+ }
- var basedir = file.getParent();
- var filename = file.getName();
+ var basedir = file.getParent();
+ var filename = file.getName();
- var perform = true;
+ var perform = true;
- if (attributes.get("checkuptodate") == "true") {
- p = "xooki."+file.getAbsolutePath().replace(' ','_')+".uptodate";
- upToDate = project.createTask("uptodate");
- upToDate.setProperty(p);
- upToDate.setSrcfile(file);
- upToDate.setTargetFile(destFile);
- upToDate.perform();
- if (project.getProperty(p) != null) {
- self.log(file+" is up to date", 3);
- perform = false;
- }
+ if (attributes.get("checkuptodate") == "true") {
+ p = "xooki." + file.getAbsolutePath().replace(' ', '_') + ".uptodate";
+ upToDate = project.createTask("uptodate");
+ upToDate.setProperty(p);
+ upToDate.setSrcfile(file);
+ upToDate.setTargetFile(destFile);
+ upToDate.perform();
+ if (project.getProperty(p) != null) {
+ self.log(file + " is up to date", 3);
+ perform = false;
}
+ }
- if (perform) {
+ if (perform) {
exec = project.createTask("exec");
exec.setDir(new File(basedir));
exec.setExecutable("jrunscript");
exec.setTaskName("print");
- exec.createArg().setValue(xookidir+"/xooki.js");
+ exec.createArg().setValue(xookidir + "/xooki.js");
exec.createArg().setValue(filename);
exec.createArg().setValue(destFile);
exec.createArg().setValue("print");
exec.perform();
- }
+ }
]]>
</scriptdef>
</antlib>
\ No newline at end of file