Skip to content

Commit

Permalink
added SkyNet basefiles
Browse files Browse the repository at this point in the history
  • Loading branch information
Linus Lotz committed Mar 3, 2011
1 parent 0115ee8 commit 396867c
Show file tree
Hide file tree
Showing 9 changed files with 176 additions and 0 deletions.
7 changes: 7 additions & 0 deletions SkyNet/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path=""/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/NXJ_JARS"/>
<classpathentry kind="output" path=""/>
</classpath>
17 changes: 17 additions & 0 deletions SkyNet/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>SkyNet</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
Binary file added SkyNet/Aufgabe1.nxj
Binary file not shown.
Binary file added SkyNet/HelloWorld.nxj
Binary file not shown.
Binary file added SkyNet/SkyNet.class
Binary file not shown.
23 changes: 23 additions & 0 deletions SkyNet/SkyNet.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import lejos.nxt.*;
/**
* @author Linus Lotz
*
*/


public class SkyNet
{


public static void main (String[] aArg)
throws Exception
{
LCD.drawString("ALARM!!!!", 0, 0);
while(true)
{
Sound.setVolume(100);
Sound.buzz();
Thread.sleep(100);
}
}
}
25 changes: 25 additions & 0 deletions SkyNet/build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<project name="Aufgabe1" default="uploadandrun">
<description>
HelloWorld build file
</description>

<target name="clean" description="clean up all generated files" >
<ant antfile="../samplebuild.xml" target="clean"/>
</target>

<target name="compile" description="compile the source" >
<ant antfile="../samplebuild.xml" target="compile"/>
</target>

<target name="link" description="link the binary" >
<ant antfile="../samplebuild.xml" target="link"/>
</target>

<target name="upload" description="upload the binary" >
<ant antfile="../samplebuild.xml" target="upload"/>
</target>

<target name="uploadandrun" description="upload and run the binary" >
<ant antfile="../samplebuild.xml" target="uploadandrun"/>
</target>
</project>
90 changes: 90 additions & 0 deletions samplebuild.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<project name="sample" default="uploadandrun">
<description>
Sample build file
</description>

<!-- set properties for this build -->
<property environment="env"/>
<property file="../samples.properties"/>
<property name="src" location="."/>
<basename property="program" file="."/>
<property name="binary" value="${program}.nxj" />

<!-- deletes class files -->
<target name="clean" description="clean up all generated files">
<delete>
<fileset dir=".">
<include name="**/*.class"/>
</fileset>
</delete>
</target>

<target name="compile" depends="clean"
description="compile the source" >
<!-- Compile the java code from ${src} -->
<javac srcdir="${src}" destdir="${src}">
<bootclasspath>
<pathelement location="${nxj.classes.jar}"/>
</bootclasspath>
</javac>
</target>

<target name="link" depends="compile"
description="link the binary" >
<!-- Link the binary and create a signature file -->
<java classname="js.tinyvm.TinyVM">
<arg value="--bootclasspath"/>
<arg path="${nxj.classes.jar}" />
<arg value="--classpath"/>
<arg path="." />
<arg value="--writeorder" />
<arg value="LE" />
<arg value="${program}"/>
<arg value="-o"/>
<arg value="${binary}"/>
<arg value="-v"/>
<classpath>
<pathelement location="${nxj.jtools.jar}"/>
<pathelement location="${nxj.commons.jar}"/>
<pathelement location="${nxj.bcel.jar}"/>
</classpath>
</java>
</target>

<target name="upload" depends="link"
description="upload the binary" >
<java classname="lejos.pc.tools.NXJUpload" fork="true">
<jvmarg value="-Djava.library.path=${nxj.library.path}"/>
<jvmarg value="-Dnxj.home=${nxj.home}"/>
<arg value="${binary}"/>
<classpath>
<pathelement location="${nxj.jtools.jar}"/>
<pathelement location="${nxj.pctools.jar}"/>
<pathelement location="${nxj.pccomm.jar}"/>
<pathelement location="${nxj.commons.jar}"/>
<pathelement location="${nxj.bcel.jar}"/>
<pathelement location="${nxj.bluecove.jar}"/>
<pathelement location="${nxj.bluecove-gpl.jar}"/>
</classpath>
</java>
</target>

<target name="uploadandrun" depends="link"
description="upload and run the binary" >
<java classname="lejos.pc.tools.NXJUpload" fork="true">
<jvmarg value="-Djava.library.path=${nxj.library.path}"/>
<jvmarg value="-Dnxj.home=${nxj.home}"/>
<arg value="${binary}"/>
<arg value="-r"/>
<classpath>
<pathelement location="${nxj.jtools.jar}"/>
<pathelement location="${nxj.pctools.jar}"/>
<pathelement location="${nxj.pccomm.jar}"/>
<pathelement location="${nxj.commons.jar}"/>
<pathelement location="${nxj.bcel.jar}"/>
<pathelement location="${nxj.bluecove.jar}"/>
<pathelement location="${nxj.bluecove-gpl.jar}"/>
</classpath>
</java>
</target>
</project>
14 changes: 14 additions & 0 deletions samples.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
nxj.home=${env.NXJ_HOME}
nxj.classes.home=${nxj.home}
nxj.jtools.home=${nxj.home}
nxj.pctools.home=${nxj.home}
nxj.pccomm.home=${nxj.home}
nxj.library.path=${nxj.home}/bin
nxj.classes.jar=${nxj.classes.home}/lib/classes.jar
nxj.jtools.jar=${nxj.jtools.home}/lib/jtools.jar
nxj.pctools.jar=${nxj.pctools.home}/lib/pctools.jar
nxj.pccomm.jar=${nxj.pccomm.home}/lib/pccomm.jar
nxj.commons.jar=${nxj.jtools.home}/3rdparty/lib/commons-cli.jar
nxj.bcel.jar=${nxj.jtools.home}/3rdparty/lib/bcel.jar
nxj.bluecove.jar=${nxj.pccomm.home}/3rdparty/lib/bluecove.jar
nxj.bluecove-gpl.jar=${nxj.pccomm.home}/3rdparty/lib/bluecove-gpl.jar

0 comments on commit 396867c

Please sign in to comment.