Gonna need that name before we try to load it

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6122 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Charlie Groves
2010-08-11 03:19:01 +00:00
parent 7badbbd20f
commit f98e5e9abf
@@ -29,6 +29,7 @@ import java.lang.reflect.Type;
import java.util.ArrayList;
import java.io.File;
import java.io.IOException;
import java.io.StringWriter;
import org.apache.tools.ant.BuildException;
@@ -79,10 +80,14 @@ public class GenDObjectTask extends GenTask
protected void processObject (File source)
{
// load up the file and determine it's package and classname
String name = null;
Class<?> klass = loadClass(name);
String name;
try{
name = GenUtil.readClassName(source);
} catch (IOException io) {
throw new BuildException("Couldn't read class name: " + source, io);
}
Class<?> klass = loadClass(name);
try {
processObject(source, klass);
} catch (Exception e) {
throw new BuildException("Failed to process " + source.getName(), e);