updates ant build.xml and convenience cmd scripts

* create ant tasks: compile-bot, compile-scripts, compile-all, run-bot, clean
* create compile_all.cmd
* create compile_scripts.cmd
* create run.bat
* create run_noconsole.bat
This commit is contained in:
Chomp committed 2021-12-03 00:35:30 -07:00
1 parent 0e79dd3108
commit 25e3fb308a
8 files changed
+87 -48

No files matched your search

-1
View File
@@ -1 +0,0 @@
javaw -cp ./Scripts;./lib/rs.jar;./lib/bis.jar;bot.jar; ClientInit NOCONSOLE
-1
View File
@@ -1 +0,0 @@
javaw -cp ./Scripts;./lib/rs.jar;./lib/bis.jar;bot.jar; ClientInit
+57 -40
View File
@@ -1,54 +1,71 @@
<project name="APOS" default="compile-and-run" basedir=".">
<property name="src" location="src"/>
<property name="build" location="build"/>
<property name="scripts" location="Scripts"/>
<property name="lib" location="lib"/>
<project name="APOS" default="run-bot" basedir=".">
<property name="build" location="build"/>
<property name="scripts" location="Scripts"/>
<property name="jar" location="bot.jar"/>
<property name="javac.source" value="1.8"/>
<property name="javac.target" value="1.8"/>
<target name="compile">
<delete file="${jar}"/>
<delete dir="${build}"/>
<path id="compile.path">
<file file="${jar}"/>
<fileset dir="lib">
<include name="rsclassic.jar"/>
</fileset>
</path>
<target name="clean">
<delete file="${jar}"/>
<delete>
<fileset dir="${scripts}">
<include name="*.class"/>
</fileset>
</delete>
</target>
<target name="compile-bot">
<delete file="${jar}"/>
<delete dir="${build}"/>
<mkdir dir="${build}"/>
<javac srcdir="${src}" destdir="${build}" debug="on" includeantruntime="false" target="${javac.target}" source="${javac.source}">
<classpath>
<pathelement location="${jar}"/>
<pathelement path="${java.class.path}/"/>
<pathelement location="${lib}/rsclassic.jar"/>
</classpath>
<compilerarg line="-Xlint:unchecked"/>
<javac srcdir="src" destdir="${build}" debug="on" includeantruntime="false" target="${javac.target}"
source="${javac.source}" classpathref="compile.path">
<compilerarg line="-Xlint:unchecked"/>
</javac>
<jar basedir="${build}" destfile="${jar}" manifest="MANIFEST.MF">
<jar basedir="${build}" destfile="${jar}" manifest="MANIFEST.MF">
<manifest>
<attribute name="Main-Class" value="ClientInit"/>
</manifest>
</jar>
<javac srcdir="${scripts}" destdir="${scripts}" debug="on" includeantruntime="false" target="${javac.target}" source="${javac.source}">
<compilerarg line="-Xlint:unchecked"/>
<classpath>
<pathelement location="${jar}"/>
<pathelement path="${java.class.path}/"/>
<pathelement location="${lib}/rsclassic.jar"/>
<pathelement location="${jar}"/>
</classpath>
<compilerarg line="-Xlint:deprecation"/>
</javac>
<delete dir="${build}"/>
</target>
<target name="runclient">
<java classname="ClientInit" fork="true">
<jvmarg line="-Xms312m -Dsun.java2d.opengl=true"/>
<classpath>
<pathelement path="${jar}:${lib}/rsclassic.jar"/>
</classpath>
</java>
<delete dir="${build}"/>
</target>
<target name="compile-and-run">
<antcall target="compile"/>
<antcall target="runclient"/>
<target name="compile-scripts">
<fail message="Error: must compile bot before compiling scripts!">
<condition>
<not>
<available file="${jar}"/>
</not>
</condition>
</fail>
<javac srcdir="${scripts}" destdir="${scripts}" debug="on" includeantruntime="false" target="${javac.target}"
source="${javac.source}" classpathref="compile.path">
<compilerarg line="-Xlint:unchecked -Xlint:deprecation"/>
</javac>
</target>
<target name="compile-all">
<antcall target="compile-bot"/>
<antcall target="compile-scripts"/>
</target>
<target name="run-bot">
<fail message="Error: must compile bot first!">
<condition>
<not>
<available file="${jar}"/>
</not>
</condition>
</fail>
<java classname="ClientInit" fork="true" classpathref="compile.path">
<jvmarg line="-Xms312m -Dsun.java2d.opengl=true"/>
</java>
</target>
</project>
-4
View File
@@ -1,4 +0,0 @@
@echo off
SET antpath="apache-ant-1.10.5\bin\"
%antpath%ant -f build.xml compile
+7
View File
@@ -0,0 +1,7 @@
@echo off
SET antpath="apache-ant-1.10.5\bin\"
echo Compiling bot and scripts ...
echo.
call %antpath%ant -f build.xml compile-all
pause
+12
View File
@@ -0,0 +1,12 @@
@echo off
SET antpath="apache-ant-1.10.5\bin\"
IF NOT EXIST bot.jar (
call compile_all.cmd
) ELSE (
echo Compiling scripts ...
echo.
call %antpath%ant -f build.xml compile-scripts
pause
)
+8 -2
View File
@@ -1,4 +1,10 @@
@echo off
SET antpath="apache-ant-1.10.5\bin\"
%antpath%ant -f build.xml runclient
IF NOT EXIST bot.jar (
echo Missing bot.jar ...
echo.
call compile_all.cmd
)
start javaw -jar bot.jar %1
exit
+3
View File
@@ -0,0 +1,3 @@
@echo off
run.cmd _