Skip to content

Commit

Permalink
Updated build to require Java SE 1.7 to allow usage of the new featur…
Browse files Browse the repository at this point in the history
…es in Java SE 1.7
  • Loading branch information
nfi committed Aug 22, 2013
1 parent 27a3633 commit d0ec91b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
7 changes: 5 additions & 2 deletions Makefile
Expand Up @@ -2,7 +2,7 @@
# Makefile for mspsim
#
# Needed stuff in the PATH:
# java, javac (JDK 1.6 or newer)
# java, javac (JDK 1.7 or newer)
#
# Under MS-DOS/Windows
# A GNU compatible Make (for example Cygwin's)
Expand Down Expand Up @@ -46,7 +46,7 @@ SPACE := ${EMPTY} ${EMPTY}
LIBS := ${wildcard lib/*.jar}
BUILD := build
CLASSPATH=${subst ${SPACE},${SEPARATOR},$(BUILD)/ ${LIBS}}
CCARGS=-deprecation -classpath ".${SEPARATOR}${CLASSPATH}" -d $(BUILD)
CCARGS=-deprecation -Xlint:unchecked -source 1.7 -target 1.7 -classpath ".${SEPARATOR}${CLASSPATH}" -d $(BUILD)

JAVAARGS=-classpath "${CLASSPATH}"

Expand Down Expand Up @@ -196,3 +196,6 @@ $(BUILD)/%.class : %.java $(BUILD)

clean:
-$(RM) -r $(BUILD)

distclean: clean
-$(RM) -f $(JARFILE)
7 changes: 3 additions & 4 deletions README.txt
Expand Up @@ -7,9 +7,8 @@ some tools for monitoring stack, setting breakpoints, and profiling.

* System requirements

You need a recent Java to run MSPSim. Java SE 1.5 or newer is
recommended. The current version of MSPSim also requires make for
compiling.
You need a recent Java to run MSPSim. Java SE 1.7 or newer is recommended.
The current version of MSPSim also requires make or ant for compiling.

* Building MSPSim

Expand Down Expand Up @@ -60,4 +59,4 @@ Run the default example on the Sky node emulator by typing:
- currently the emulator runs as if it can use all memory as RAM
(e.g. flash writes, etc not supported)
- no DMA implementation
- timer system not 100% emulated
- timer system not 100% emulated
9 changes: 7 additions & 2 deletions build.xml
Expand Up @@ -8,6 +8,8 @@
<property name="lib" location="lib"/>
<property name="jarfile" location="mspsim.jar"/>
<property name="javac.debug" value="true"/>
<property name="ant.build.javac.source" value="1.7"/>
<property name="ant.build.javac.target" value="1.7"/>

<path id="classpath">
<fileset dir="${lib}" includes="**/*.jar"/>
Expand All @@ -23,8 +25,11 @@
</target>

<target name="compile" depends="init" description="compile the source">
<javac srcdir="${src}" destdir="${build}" classpathref="classpath" debug="${javac.debug}"
includeantruntime="false"/>
<javac srcdir="${src}" destdir="${build}" classpathref="classpath"
debug="${javac.debug}" includeantruntime="false">
<compilerarg value="-Xlint:unchecked"/>
<compilerarg value="-deprecation"/>
</javac>
</target>

<target name="jar" depends="compile" description="generate MSPSim jar file" >
Expand Down
7 changes: 3 additions & 4 deletions se/sics/mspsim/emulink/EmuLink.java
Expand Up @@ -324,9 +324,8 @@ protected void disconnect() {
}
}

public void run() throws IOException {
try {
ServerSocket serverSocket = new ServerSocket(8000);
public void run() {
try (ServerSocket serverSocket = new ServerSocket(8000)) {

while(true) {

Expand Down Expand Up @@ -356,7 +355,7 @@ public void run() throws IOException {
}
}

public static void main(String[] args) throws IOException {
public static void main(String[] args) {
EmuLink el = new EmuLink();
el.run();
}
Expand Down

0 comments on commit d0ec91b

Please sign in to comment.