Skip to content

Instantly share code, notes, and snippets.

@nonchip
Last active May 3, 2018 15:51
Show Gist options
  • Save nonchip/d610ae96dd84856b11603a51f99ebff1 to your computer and use it in GitHub Desktop.
Save nonchip/d610ae96dd84856b11603a51f99ebff1 to your computer and use it in GitHub Desktop.
Lilith's Throne ant file.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project default="main" name="LilithsThrone" xmlns:fx="javafx:com.sun.javafx.tools.ant">
<!--
USAGE: create a folder for the game, then put this file as `build.xml` into it.
to build the game just run `ant` inside the folder (no more messing with git and eclipse yourself).
to run the game just run `java -jar LilithsThroneGit.jar` inside the folder.
LICENSE: I sincerely don't care. apply MIT, WTFPL, copyleft, or public domain as you see fit.
But please seriously consider supporting Innoxia for making this awesome game.
To do so go to https://www.patreon.com/innoxia
-->
<property name="dir.out" value="."/>
<property name="dir.src" value="${dir.out}/src"/>
<property name="dir.build" value="${dir.src}/build"/>
<property name="MainClass" value="com.lilithsthrone.main.Main"/>
<property name="jarfile" value="${dir.out}/LilithsThroneGit.jar"/>
<property name="zipfile" value="${dir.out}/LilithsThroneGit.zip"/>
<property name="url.git.remote" value="https://github.com/Innoxia/liliths-throne-public.git"/>
<taskdef resource="com/sun/javafx/tools/ant/antlib.xml"
uri="javafx:com.sun.javafx.tools.ant"
classpath="${java.home}/../lib/ant-javafx.jar"/>
<target name="clone">
<exec dir="${dir.out}" executable="git">
<arg value="clone"/>
<arg value="${url.git.remote}"/>
<arg value="${dir.src}"/>
</exec>
</target>
<target name="clean">
<delete dir="${dir.build}"/>
</target>
<target name="pull">
<exec dir="${dir.src}" executable="git">
<arg value="pull"/>
</exec>
</target>
<target name="compile">
<mkdir dir="${dir.build}"/>
<javac srcdir="${dir.src}" destdir="${dir.build}"/>
</target>
<target name="jar">
<!--<jar destfile="${jarfile}" basedir="${dir.build}">
<manifest>
<attribute name="Main-Class" value="${MainClass}"/>
<attribute name="Class-Path" value="."/>
</manifest>
<fileset dir="${dir.build}"/>
<zipfileset dir="${dir.src}/src/com/lilithsthrone/res" prefix="/com/lilithsthrone/res"/>
</jar>-->
<fx:application name="LilithsThrone" id="LilithsThroneFX" mainClass="${MainClass}"/>
<fx:jar destfile="${jarfile}">
<fx:application refid="LilithsThroneFX"/>
<fileset dir="${dir.build}"/>
<fx:resources>
<fx:fileset type="data" includes="${dir.src}/src/com/lilithsthrone/res"/>
</fx:resources>
</fx:jar>
</target>
<target name="res">
<copy todir="${dir.out}/res">
<fileset dir="${dir.src}/res"/>
</copy>
</target>
<target name="zip">
<zip destfile="${zipfile}">
<fileset file="${jarfile}"/>
<fileset dir="${dir.out}/res"/>
</zip>
</target>
<target name="main" depends="clone,clean,pull,compile,jar,res,zip"/>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment