Automatic SO downloading & updating

--HG--
extra : source : 11f8cf1c8ac2a81610ae086b440b6f5ca844377f
This commit is contained in:
Patrick Plenefisch
2014-04-05 02:48:17 -04:00
parent 69d9ad70ab
commit c0222d4e2d
7 changed files with 226 additions and 40 deletions

View File

@@ -2,6 +2,8 @@
<project name="athena-project-build" default="deploy">
<property file="${wpilib.ant.dir}/../so.properties"/>
<!-- Load Tasks -->
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
@@ -25,36 +27,6 @@
<echo>Target IP: ${target}</echo>
</target>
<!-- <target name="compile" description="Compile the source code."> -->
<!-- <mkdir dir="${build.dir}"/> -->
<!-- <echo>[athena-compile] Compiling ${src.dir} with classpath=${classpath} to ${build.dir}</echo> -->
<!-- <javac srcdir="${src.dir}" -->
<!-- destdir="${build.dir}" -->
<!-- includeAntRuntime="no" -->
<!-- includeJavaRuntime="no" -->
<!-- classpath="${classpath}" -->
<!-- target="1.7" -->
<!-- source="1.7" -->
<!-- debug="true"> -->
<!-- </javac> -->
<!-- </target> -->
<!-- <target name="jar" depends="compile"> -->
<!-- <echo>[athena-jar] Making jar ${dist.jar}.</echo> -->
<!-- <mkdir dir="${dist.dir}" /> -->
<!-- <jar destfile="${dist.jar}" update="false"> -->
<!-- <manifest> -->
<!-- <attribute name="Main-Class" value="${main}"/> -->
<!-- <attribute name="Class-Path" value="."/> -->
<!-- </manifest> -->
<!-- <fileset dir="${build.dir}" includes="**"/> -->
<!-- <zipgroupfileset file="${networktables.jar}" /> -->
<!-- </jar> -->
<!-- </target> -->
<target name="deploy" depends="get-target-ip" description="Deploy the progam and start it running.">
<echo>[athena-deploy] Killing running program</echo>
<sshexec host="${target}"
@@ -65,6 +37,29 @@
<echo>[athena-deploy] Copying code over.</echo>
<scp file="${out.exe}" todir="${username}@${target}:${deploy.dir}"
password="${password}" trust="true"/>
<sshexec host="${target}"
username="${username}"
password="${password}"
trust="true"
command="opkg info wpilib |grep Version | awk '{printf $2}'"
outputproperty="installedWpilibSo"/>
<if>
<equals arg1="${installedWpilibSo}" arg2="${cpp-sos}" />
<then>
<echo>Found version of WPILib: ${installedWpilibSo} (latest)</echo>
</then>
<else>
<echo>Found version of WPILib: ${installedWpilibSo}</echo>
<echo>Upgrading WPILib to ${cpp-sos}...</echo>
<scp file="${wpilib.ant.dir}/../wpilib_${cpp-sos}_armv7a-vfp.deb" todir="${username}@${target}:/tmp"
password="${password}" trust="true"/>
<sshexec host="${target}"
username="${username}"
password="${password}"
trust="true"
command="opkg install /tmp/wpilib_${cpp-sos}_armv7a-vfp.deb; sh -c 'rm -rf /tmp/wpilib*.deb'"/>
</else>
</if>
<scp file="${wpilib.ant.dir}/runcppprogram" todir="${username}@${target}:${deploy.dir}"
password="${password}" trust="true"/>
<scp file="${wpilib.ant.dir}/runjavaprogram" todir="${username}@${target}:${deploy.dir}"

View File

@@ -3,4 +3,4 @@ killall java
killall FRCUserProgram
sleep 1
chmod +x ./FRCUserProgram
nohup ./FRCUserProgram
./FRCUserProgram