Allow digests to be easily created externally.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: DigesterTask.java,v 1.3 2004/07/30 02:23:52 mdb Exp $
|
// $Id: DigesterTask.java,v 1.4 2004/08/10 07:23:12 mdb Exp $
|
||||||
|
|
||||||
package com.threerings.getdown.tools;
|
package com.threerings.getdown.tools;
|
||||||
|
|
||||||
@@ -38,17 +38,27 @@ public class DigesterTask extends Task
|
|||||||
"directory via the 'appdir' attribute.";
|
"directory via the 'appdir' attribute.";
|
||||||
throw new BuildException(errmsg);
|
throw new BuildException(errmsg);
|
||||||
}
|
}
|
||||||
File target = new File(_appdir, Digest.DIGEST_FILE);
|
|
||||||
|
try {
|
||||||
|
createDigest(_appdir);
|
||||||
|
} catch (IOException ioe) {
|
||||||
|
throw new BuildException("Error creating digest: " +
|
||||||
|
ioe.getMessage(), ioe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a digest file in the specified application directory.
|
||||||
|
*/
|
||||||
|
public static void createDigest (File appdir)
|
||||||
|
throws IOException
|
||||||
|
{
|
||||||
|
File target = new File(appdir, Digest.DIGEST_FILE);
|
||||||
System.out.println("Generating digest file '" + target + "'...");
|
System.out.println("Generating digest file '" + target + "'...");
|
||||||
|
|
||||||
// create our application and instruct it to parse its business
|
// create our application and instruct it to parse its business
|
||||||
Application app = new Application(_appdir);
|
Application app = new Application(appdir);
|
||||||
try {
|
app.init(false);
|
||||||
app.init(false);
|
|
||||||
} catch (IOException ioe) {
|
|
||||||
throw new BuildException("Error parsing getdown.txt: " +
|
|
||||||
ioe.getMessage(), ioe);
|
|
||||||
}
|
|
||||||
|
|
||||||
ArrayList rsrcs = new ArrayList();
|
ArrayList rsrcs = new ArrayList();
|
||||||
rsrcs.add(app.getConfigResource());
|
rsrcs.add(app.getConfigResource());
|
||||||
@@ -56,12 +66,7 @@ public class DigesterTask extends Task
|
|||||||
rsrcs.addAll(app.getResources());
|
rsrcs.addAll(app.getResources());
|
||||||
|
|
||||||
// now generate the digest file
|
// now generate the digest file
|
||||||
try {
|
Digest.createDigest(rsrcs, target);
|
||||||
Digest.createDigest(rsrcs, target);
|
|
||||||
} catch (IOException ioe) {
|
|
||||||
throw new BuildException("Error creating digest: " +
|
|
||||||
ioe.getMessage(), ioe);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The application directory in which we're creating a digest file. */
|
/** The application directory in which we're creating a digest file. */
|
||||||
|
|||||||
Reference in New Issue
Block a user