|
|
*/ | */ |
public static File getRootFolder() | public static File getRootFolder() |
{ | { |
//TODO this is a bit hokey, we assume that we are running |
String rootFolder = System.getProperty("triplea.root"); |
//from the bin directory. |
if (rootFolder != null) |
return new File(".."); |
return new File(rootFolder); |
|
else |
|
return new File(".."); |
} | } |
| |
| |
|
|
factory.setValidating(true); | factory.setValidating(true); |
| |
//get the dtd location | //get the dtd location |
URL url = GameParser.class.getResource("../xml/"); |
URL url = GameParser.class.getResource("/games/strategy/engine/xml/"); |
String system = url.toExternalForm(); | String system = url.toExternalForm(); |
| |
DocumentBuilder builder = factory.newDocumentBuilder(); | DocumentBuilder builder = factory.newDocumentBuilder(); |
|
|
| |
<path id="full.path"> | <path id="full.path"> |
<pathelement path="${junit.jar}"/> | <pathelement path="${junit.jar}"/> |
<pathelement path="lib\plastic-1.2.0.jar"/> |
<fileset dir="lib"> |
|
<include name="**/*.jar"/> |
|
</fileset> |
<pathelement path="${classpath}"/> | <pathelement path="${classpath}"/> |
<pathelement path="classes/"/> | <pathelement path="classes/"/> |
</path> | </path> |
|
|
<target name="compileClean" depends="clean,compile" description="Clean then compile"/> | <target name="compileClean" depends="clean,compile" description="Clean then compile"/> |
| |
| |
|
<!-- jar --> |
|
<target name="jar" depends="init,compile" description="create a jar file"> |
|
<jar destfile="triplea.jar"> |
|
<fileset dir="."> |
|
<include name="triplea.properties"/> |
|
</fileset> |
|
<fileset dir="classes/"> |
|
<include name="**/*.class"/> |
|
<exclude name="**/*Test.class"/> <!-- dont put Test classes in the main distribution --> |
|
<include name="**/*.dtd"/> |
|
<include name="**/*.gif"/> |
|
<include name="**/*.png"/> |
|
<include name="**/*.txt"/> |
|
<include name="**/*.wav"/> |
|
</fileset> |
|
|
|
</jar> |
|
</target> |
|
|
|
|
<!-- zip --> | <!-- zip --> |
<target name="zip" depends="init,compile" description="create a zip file for end users"> | <target name="zip" depends="init,compile" description="create a zip file for end users"> |
<mkdir dir="release" /> | <mkdir dir="release" /> |
|
|
{ | { |
try | try |
{ | { |
String prefix = "../image/images/maps/"+mapDir+"/"; |
String prefix = "/games/strategy/triplea/image/images/maps/"+mapDir+"/"; |
| |
m_place = PointFileReaderWriter.readOneToMany(this.getClass().getResourceAsStream(prefix+PLACEMENT_FILE)); | m_place = PointFileReaderWriter.readOneToMany(this.getClass().getResourceAsStream(prefix+PLACEMENT_FILE)); |
m_polys = PointFileReaderWriter.readOneToManyPolygons(this.getClass().getResourceAsStream(prefix+POLYGON_FILE)); | m_polys = PointFileReaderWriter.readOneToManyPolygons(this.getClass().getResourceAsStream(prefix+POLYGON_FILE)); |