|
From: <ls...@us...> - 2008-08-24 10:01:45
|
Revision: 4490
http://jnode.svn.sourceforge.net/jnode/?rev=4490&view=rev
Author: lsantha
Date: 2008-08-24 10:01:42 +0000 (Sun, 24 Aug 2008)
Log Message:
-----------
Added support for customizing standard Java system properties java.home, java.io.tmp, user.home in jnode.properties.
Modified Paths:
--------------
trunk/all/build.xml
trunk/builder/build.xml
trunk/core/build.xml
trunk/core/core.iml
trunk/core/src/core/org/jnode/vm/VmSystem.java
trunk/jnode.properties.dist
Added Paths:
-----------
trunk/core/src/template/
trunk/core/src/template/org/
trunk/core/src/template/org/jnode/
trunk/core/src/template/org/jnode/vm/
trunk/core/src/template/org/jnode/vm/VmSystemSettings.java
Modified: trunk/all/build.xml
===================================================================
--- trunk/all/build.xml 2008-08-24 08:13:29 UTC (rev 4489)
+++ trunk/all/build.xml 2008-08-24 10:01:42 UTC (rev 4490)
@@ -214,6 +214,8 @@
<!-- Call the assemble target of all subprojects -->
<target name="assemble-projects" depends="prepare">
+ <!-- pre compile tasks needed for compilation -->
+ <ant target="pre-compile" dir="${root.dir}/builder" inheritall="on" inheritrefs="on" />
<jnode.antall target="assemble"/>
</target>
Modified: trunk/builder/build.xml
===================================================================
--- trunk/builder/build.xml 2008-08-24 08:13:29 UTC (rev 4489)
+++ trunk/builder/build.xml 2008-08-24 10:01:42 UTC (rev 4490)
@@ -28,6 +28,28 @@
<mkdir dir="${jnasm-assembler-gen.dir}"/>
</target>
+ <!-- Compile the Template ANT task needed for compiling the core -->
+ <target name="pre-compile" depends="prepare">
+ <javac destdir="${my-classes.dir}"
+ debug="on"
+ optimize="on"
+ fork="off"
+ compiler="modern"
+ includeJavaRuntime="true"
+ target="${java.target}"
+ source="${java.source}"
+ encoding="${java.encoding}"
+ excludes="**/*-template.java,**/package-info.java"
+ srcdir="${my-src.dir}/builder/">
+ <bootclasspath path="${jnode-core.jar}"/>
+ <compilerarg value="${compilerarg}"/>
+ <filename name="org/jnode/ant/taskdefs/TemplateTask.java" />
+ </javac>
+ <jar jarfile="${jnode-builder.jar}"
+ basedir="${my-classes.dir}"
+ includes="org/jnode/ant/taskdefs/**"/>
+ </target>
+
<!-- Compile all subproject java files -->
<target name="compile" depends="prepare">
<javacc target="${jnasm-src.dir}/preprocessor/gen/JNAsmPP.jj"
Modified: trunk/core/build.xml
===================================================================
--- trunk/core/build.xml 2008-08-24 08:13:29 UTC (rev 4489)
+++ trunk/core/build.xml 2008-08-24 10:01:42 UTC (rev 4490)
@@ -109,6 +109,14 @@
<ExpandTest classname="PrimitiveLongTest" type="long"/>
<ExpandTest classname="PrimitiveFloatTest" type="float"/>
<ExpandTest classname="PrimitiveDoubleTest" type="double"/>
+
+ <taskdef name="template" classname="org.jnode.ant.taskdefs.TemplateTask" classpathref="cp-jnode"/>
+ <template file="${my-src.dir}/template/org/jnode/vm/VmSystemSettings.java"
+ tofile="${my-gen.dir}/org/jnode/vm/VmSystemSettings.java">
+ <token name="@java.home@" value="${jnode.java.home}"/>
+ <token name="@java.io.tmpdir@" value="${jnode.java.io.tmpdir}"/>
+ <token name="@user.home@" value="${jnode.user.home}"/>
+ </template>
</target>
<!-- Compile all subproject java files -->
Modified: trunk/core/core.iml
===================================================================
--- trunk/core/core.iml 2008-08-24 08:13:29 UTC (rev 4489)
+++ trunk/core/core.iml 2008-08-24 10:01:42 UTC (rev 4490)
@@ -22,6 +22,7 @@
<sourceFolder url="file://$MODULE_DIR$/src/openjdk/org" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/openjdk/sun" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/openjdk/vm" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/template" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/vmmagic" isTestSource="false" />
</content>
Modified: trunk/core/src/core/org/jnode/vm/VmSystem.java
===================================================================
--- trunk/core/src/core/org/jnode/vm/VmSystem.java 2008-08-24 08:13:29 UTC (rev 4489)
+++ trunk/core/src/core/org/jnode/vm/VmSystem.java 2008-08-24 10:01:42 UTC (rev 4490)
@@ -324,6 +324,7 @@
res.put("swing.handleTopLevelPaint", "false");
+ VmSystemSettings.insertSystemProperties(res);
}
/**
Added: trunk/core/src/template/org/jnode/vm/VmSystemSettings.java
===================================================================
--- trunk/core/src/template/org/jnode/vm/VmSystemSettings.java (rev 0)
+++ trunk/core/src/template/org/jnode/vm/VmSystemSettings.java 2008-08-24 10:01:42 UTC (rev 4490)
@@ -0,0 +1,21 @@
+/*
+ * $
+ */
+package org.jnode.vm;
+
+import java.util.Properties;
+
+/**
+ * @author Levente S\u00e1ntha
+ */
+public class VmSystemSettings {
+ private static final boolean ENABLED = false;
+
+ public static void insertSystemProperties(Properties props) {
+ if (ENABLED) {
+ props.put("java.home", "@java.home@");
+ props.put("java.io.tmpdir", "@java.io.tmpdir@");
+ props.put("user.home", "@user.home@");
+ }
+ }
+}
Modified: trunk/jnode.properties.dist
===================================================================
--- trunk/jnode.properties.dist 2008-08-24 08:13:29 UTC (rev 4489)
+++ trunk/jnode.properties.dist 2008-08-24 10:01:42 UTC (rev 4490)
@@ -85,3 +85,11 @@
# to the VMX file's location!
#vmware.vmx.overrides=<some-file-containing-vmx-settings>
+
+# -----------------------------------------------
+# Custom system properties
+# -----------------------------------------------
+
+jnode.java.home=/jnode
+jnode.java.io.tmpdir=/jnode/tmp
+jnode.user.home=/jnode/home
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|