How to: Nightly Builds (using google code and SVN)

I didn’t find a better place to put this, so here we go!

Ive been trying to find a good way to create nightly builds for my project but I find nothing on google… The project and its report is due for handing in the night between wednesday and thursday so you guys are pretty much my last hope! (It is not required, but it will help me get a better grade if I learn this!)

Now the google code check out site gives me the following:
Use this command to anonymously check out the latest project source code:

Non-members may check out a read-only working copy anonymously over HTTP.

svn checkout http://project.googlecode.com/svn/trunk/ project-read-only

But I really have no ideas, at all, on where to start. Can someone please explain (or point me in the direction of a tutorial / explanation) how to run nightly builds? Please!:frowning:

Here are some things you can google:

In general:
Continuous Integration
Jenkins

On Windows: Windows Scheduler
On Linux: cron

Good luck!

Thank you. :slight_smile:

Unfortunately so far it didn’t help all that much, but I will continue trying to figure out it when I get back from uni tonight.

I managed to create an ant build script (at least I think I did) with eclipse,

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- WARNING: Eclipse auto-generated file.
              Any modifications will be overwritten.
              To include a user specific buildfile here, simply create one in the same
              directory with the processing instruction <?eclipse.ant.import?>
              as the first entry and export the buildfile again. -->
<project basedir="." default="build" name="TowerBone">
    <property environment="env"/>
    <property name="ECLIPSE_HOME" value="../../eclipse"/>
    <property name="debuglevel" value="source,lines,vars"/>
    <property name="target" value="1.6"/>
    <property name="source" value="1.6"/>
    <path id="TowerBone.classpath">
        <pathelement location="bin"/>
        <pathelement location="libs/gdx-backend-lwjgl-natives.jar"/>
        <pathelement location="libs/gdx-backend-lwjgl-sources.jar"/>
        <pathelement location="libs/gdx-backend-lwjgl.jar"/>
        <pathelement location="libs/gdx-natives.jar"/>
        <pathelement location="libs/gdx.jar"/>
        <pathelement location="libs/lwjgl_util_applet.jar"/>
    </path>
    <target name="init">
        <mkdir dir="bin"/>
        <copy includeemptydirs="false" todir="bin">
            <fileset dir="src">
                <exclude name="**/*.launch"/>
                <exclude name="**/*.java"/>
            </fileset>
        </copy>
    </target>
    <target name="clean">
        <delete dir="bin"/>
    </target>
    <target depends="clean" name="cleanall"/>
    <target depends="build-subprojects,build-project" name="build"/>
    <target name="build-subprojects"/>
    <target depends="init" name="build-project">
        <echo message="${ant.project.name}: ${ant.file}"/>
        <javac debug="true" debuglevel="${debuglevel}" destdir="bin" source="${source}" target="${target}">
            <src path="src"/>
            <classpath refid="TowerBone.classpath"/>
        </javac>
    </target>
    <target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/>
    <target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler">
        <copy todir="${ant.library.dir}">
            <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
        </copy>
        <unzip dest="${ant.library.dir}">
            <patternset includes="jdtCompilerAdapter.jar"/>
            <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
        </unzip>
    </target>
    <target description="compile project with Eclipse compiler" name="build-eclipse-compiler">
        <property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
        <antcall target="build"/>
    </target>
    <target name="Starter">
        <java classname="com.struc.td.Starter" failonerror="true" fork="yes">
            <classpath refid="TowerBone.classpath"/>
        </java>
    </target>
</project>

But I don’t know how to use it… When I run it it will just say "
Buildfile: D:\Software Engineering\TowerBone\build.xml
build-subprojects:
init:
build-project:
[echo] TowerBone: D:\Software Engineering\TowerBone\build.xml
build:
BUILD SUCCESSFUL
Total time: 160 milliseconds

So I figured perhaps it was just something that tries to compile the project and tells if it works or not, so then I replaced my main method with something that would cause an error (I just randomly wrote a couple of letters, like “new LwjglASDREASDApplication(…)”. And ran the build script and it still said the exact same thing. Can someone explain?:confused:

Hi

If ant and eclipse both point to the same source, and both compile to the same directory, then ant will have no work to do as eclipse already compiled the classes.

Endolf

If you run ant without any arguments then it will execute the default target which is in this case ‘build’.

Thus:

$ ant

is equivalent to:
$ ant build

or:
$ ant -f build.xml build

In order to do a clean before build you need to specify the ‘clean’ target first e.g.:

$ ant clean
$ ant build

or:
$ ant clean build