Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
henningSaul
Visitor

ANT Deployment Script

Please find below a little ANT build script to deploy your application to your local Roku box.
The actual deploy task requires a few 3rd party libraries as ANT provides no standard task for HTTP post.
I only tested this with a small sample application, but you might find it useful anyhow.
Cheers
--Henning

build.xml

<project name="roku-test" default="deploy" basedir=".">
<description>
A simple ANT build file that bundles the source and images folders into a zip
and pushes it to your Roku (see local.properties for configuration).
</description>

<!-- deploy task requires fikin-ant tasks and dependent libraries -->
<taskdef name="httpmpost" classname="net.sf.fikin.ant.httpclientanttask.AntMultipartPostMethod">
<!-- requires the following JARs:
fikin-ant-1.7.3.jar
commons-httpclient-3.1.jar
commons-logging-1.1.1.jar
commons-codec-1.4.jar -->
</taskdef>

<!-- set global properties for this build -->
<property name="source" location="source" />
<property name="images" location="images" />
<property name="build" location="target" />
<property name="dist" location="out" />
<property name="distfile" location="${dist}/${ant.project.name}.zip" />
<!-- load environment specific properties -->
<property file="local.properties" />

<target name="init">
<tstamp />
</target>

<!-- "compile" all resources, possibly do some filtering etc -->
<target name="compile" depends="init">
<mkdir dir="${build}" />
<copy todir="${build}/source">
<fileset dir="${source}" />
</copy>
<copy todir="${build}/images">
<fileset dir="${images}" />
</copy>
</target>

<target name="dist" depends="compile">
<mkdir dir="${dist}" />
<zip basedir="${build}" destfile="${distfile}" />
</target>

<target name="deploy" depends="dist">
<echo message="Deploying Application to Roku at http://${ROKU_DEV_TARGET}" />
<httpmpost url="http://${ROKU_DEV_TARGET}/plugin_install">
<postFile name="archive" file="${distfile}" />
<poststring name="mysubmit" value="Install" />
</httpmpost>
</target>

<target name="clean">
<delete dir="${build}" />
<delete dir="${dist}" />
</target>
</project>


local.properties

# IP address of your Roku, see Settings->player info
ROKU_DEV_TARGET=10.0.1.4
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.