Skip to content

Commit e6fa54e

Browse files
author
mgricken
committed
Ant script to create a combined DrJava/HJ jar file.
git-svn-id: file:///tmp/test-svn/trunk@5384 fe72c1cf-3628-48e9-8b72-1c46755d3cff
1 parent bc15f82 commit e6fa54e

15 files changed

Lines changed: 143 additions & 0 deletions

File tree

misc/drjava-hj/build.xml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Copyright 2007-2008 Sun Microsystems, Inc. All Rights Reserved.
4+
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5+
6+
This code is free software; you can redistribute it and/or modify it
7+
under the terms of the GNU General Public License version 2 only, as
8+
published by the Free Software Foundation. Sun designates this
9+
particular file as subject to the "Classpath" exception as provided
10+
by Sun in the LICENSE file that accompanied this code.
11+
12+
This code is distributed in the hope that it will be useful, but WITHOUT
13+
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14+
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15+
version 2 for more details (a copy is included in the LICENSE file that
16+
accompanied this code).
17+
18+
You should have received a copy of the GNU General Public License version
19+
2 along with this work; if not, write to the Free Software Foundation,
20+
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21+
22+
Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23+
CA 95054 USA or visit www.sun.com if you need additional information or
24+
have any questions.
25+
-->
26+
27+
<!--
28+
This is the main build file for the complete langtools workspace.
29+
It is used both when working on the tools in NetBeans, and when building
30+
JDK itself, in which case it is invoked from the wrapper Makefile.
31+
-->
32+
33+
<project name="drjava-hj" default="drjava-hj" basedir=".">
34+
<property name="build.dir" location="build"/>
35+
36+
<property name="input1" location="input/hj.jar"/>
37+
<property name="input2" location="input/hjc.jar"/>
38+
<property name="input3" location="input/hj-ant-task.jar"/>
39+
<property name="input4" location="input/jasminclasses-2.3.0.jar"/>
40+
<property name="input5" location="input/java_cup.jar"/>
41+
<property name="input6" location="input/lpg.jar"/>
42+
<property name="input7" location="input/polyglot.jar"/>
43+
<property name="input8" location="input/sootclasses-2.3.0.jar"/>
44+
45+
<target name="clean" description="Delete all generated files">
46+
<delete dir="${build.dir}"/>
47+
<delete file="drjava-hj.jar"/>
48+
</target>
49+
50+
<target name="drjava-hj"
51+
description="Create a combined DrJava/HJ jar file">
52+
<available property="drjava-exists" file="drjava.jar"/>
53+
<available property="input1-exists" file="${input1}"/>
54+
<available property="input2-exists" file="${input2}"/>
55+
<available property="input3-exists" file="${input3}"/>
56+
<available property="input4-exists" file="${input4}"/>
57+
<available property="input5-exists" file="${input5}"/>
58+
<available property="input6-exists" file="${input6}"/>
59+
<available property="input7-exists" file="${input7}"/>
60+
<available property="input8-exists" file="${input8}"/>
61+
62+
<fail message="Can't find file drjava.jar" unless="drjava-exists" />
63+
<fail message="Can't find file ${input1}" unless="input1-exists" />
64+
<fail message="Can't find file ${input2}" unless="input2-exists" />
65+
<fail message="Can't find file ${input3}" unless="input3-exists" />
66+
<fail message="Can't find file ${input4}" unless="input4-exists" />
67+
<fail message="Can't find file ${input5}" unless="input5-exists" />
68+
<fail message="Can't find file ${input6}" unless="input6-exists" />
69+
<fail message="Can't find file ${input7}" unless="input7-exists" />
70+
<fail message="Can't find file ${input8}" unless="input8-exists" />
71+
72+
<tempfile property="combine.jars.temp.dir" destDir="${build.dir}"/>
73+
<echo message="temp.dir = ${combine.jars.temp.dir}" />
74+
<delete dir="${combine.jars.temp.dir}" failonerror="false"/>
75+
<mkdir dir="${combine.jars.temp.dir}"/>
76+
<unzip src="${input1}" dest="${combine.jars.temp.dir}"/>
77+
<unzip src="${input2}" dest="${combine.jars.temp.dir}"/>
78+
<unzip src="${input3}" dest="${combine.jars.temp.dir}"/>
79+
<unzip src="${input4}" dest="${combine.jars.temp.dir}"/>
80+
<unzip src="${input5}" dest="${combine.jars.temp.dir}"/>
81+
<unzip src="${input6}" dest="${combine.jars.temp.dir}"/>
82+
<unzip src="${input7}" dest="${combine.jars.temp.dir}"/>
83+
<unzip src="${input8}" dest="${combine.jars.temp.dir}"/>
84+
<unzip src="drjava.jar" dest="${combine.jars.temp.dir}" overwrite="true"/>
85+
<unzip src="misc/drjava-hj-splash.zip"
86+
dest="${combine.jars.temp.dir}" overwrite="true"/>
87+
88+
<java classname="DrJavaHJPropertyFile"
89+
classpath="drjavaHJPropertyFile"
90+
fork="true"
91+
dir="."
92+
failonerror="true">
93+
<arg value="${combine.jars.temp.dir}/edu/rice/cs/drjava/config/options.properties"/>
94+
</java>
95+
96+
<manifest file="${combine.jars.temp.dir}/META-INF/MANIFEST.MF" mode="update">
97+
<attribute name="Created-By" value="1.5.0-drjavahj"/>
98+
</manifest>
99+
100+
<jar destfile="drjava-hj.jar" basedir="${combine.jars.temp.dir}"
101+
manifest="${combine.jars.temp.dir}/META-INF/MANIFEST.MF"/>
102+
<delete dir="${combine.jars.temp.dir}" failonerror="false"/>
103+
</target>
104+
105+
</project>
106+
1.72 KB
Binary file not shown.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import java.io.*;
2+
import java.util.Properties;
3+
import java.util.Date;
4+
5+
public class DrJavaHJPropertyFile {
6+
public static void main(String[] args) throws IOException {
7+
System.out.println("Appends the DrJava version string.");
8+
System.out.println("Disables automatic updates in DrJava.");
9+
10+
Properties p = new Properties();
11+
String fileName = "edu/rice/cs/drjava/config/options.properties";
12+
String versionAddition = "www.habanero.rice.edu";
13+
if (args.length>0) {
14+
fileName = args[0];
15+
}
16+
if (args.length>1) {
17+
versionAddition = args[1];
18+
}
19+
20+
p.load(new FileInputStream(fileName));
21+
22+
String versionSuffix = p.getProperty("custom.drjava.jar.version.suffix");
23+
if (versionSuffix==null) {
24+
versionSuffix = versionAddition;
25+
}
26+
else {
27+
versionSuffix += ", "+versionAddition;
28+
}
29+
p.setProperty("custom.drjava.jar.version.suffix", versionSuffix);
30+
p.setProperty("new.version.allowed", "false");
31+
p.setProperty("new.version.notification", "none (disabled)");
32+
p.setProperty("default.compiler.preference.control", "HJ 5.0-drjavahj");
33+
p.setProperty("default.compiler.preference", "HJ 5.0-drjavahj");
34+
35+
p.store(new FileOutputStream(fileName), "drjava.jar with Habanero Java file generated "+new Date());
36+
}
37+
}
5.96 KB
Binary file not shown.

misc/drjava-hj/input/hj.jar

477 KB
Binary file not shown.

misc/drjava-hj/input/hjc.jar

1020 KB
Binary file not shown.
176 KB
Binary file not shown.

misc/drjava-hj/input/java_cup.jar

80.9 KB
Binary file not shown.

misc/drjava-hj/input/lpg.jar

63.9 KB
Binary file not shown.

misc/drjava-hj/input/polyglot.jar

997 KB
Binary file not shown.

0 commit comments

Comments
 (0)