Skip to content

Commit

Permalink
update to Java 7, Ant 1.9.6, fix warnings and deprecated stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
don-vip committed Oct 4, 2015
1 parent 9f1ff39 commit fb1359e
Show file tree
Hide file tree
Showing 33 changed files with 223 additions and 362 deletions.
9 changes: 9 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path=""/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="lib" path="lib/ant.jar"/>
<classpathentry kind="lib" path="lib/hamcrest-core-1.3.jar"/>
<classpathentry kind="lib" path="lib/junit-4.12.jar"/>
<classpathentry kind="output" path="classes"/>
</classpath>
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/classes/
/TEST-*.txt
/xmltask.jar
/xmltask.tar.gz
/xmltask-v*.jar
/xmltask-v*.tar.gz
17 changes: 17 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>XmlTask</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>
7 changes: 7 additions & 0 deletions .settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7
30 changes: 5 additions & 25 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<target name="javac" depends="init" description="Java source build">
<mkdir dir="classes"/>
<!-- then compile -->
<javac srcdir="." destdir="classes" debug="on" nowarn="true" source="1.5" target="1.5">
<javac srcdir="." destdir="classes" debug="on" nowarn="true" source="1.7" target="1.7" includeantruntime="false">
<include name="**/*.java"/>
</javac>
<copy file="xmltask.properties" todir="classes"/>
Expand All @@ -47,10 +47,11 @@
<test name="com.oopsconsultancy.xmltask.test.TestXmlReplacement"/>
<classpath>
<pathelement location="${basedir}/classes"/>
<pathelement location="lib/junit-4.12.jar"/>
<pathelement location="lib/hamcrest-core-1.3.jar"/>
</classpath>
<formatter type="plain"/>
</junit>
<echo>Tests succeed!</echo>
</target>

<target name="main" depends="javac,test" description="Complete build/test"/>
Expand All @@ -68,8 +69,7 @@
<echo>Created .jar and .tar.gz</echo>
</target>

<target name="deliver" depends="package" description="Delivers to the Sourceforge site">
<!-- perform my local deployment for writing to Sourceforge -->
<target name="deliver" depends="package" description="Delivers">
<!-- create a web page with the correct version -->
<checksum file="${tarfile}.gz" property="GZ_MD5"/>
<checksum file="${jarfile}" property="JAR_MD5"/>
Expand All @@ -84,32 +84,12 @@
<replace file="/tmp/xmltask.html" token="@JAR_MD5@" value="${JAR_MD5}"/>
<replace file="/tmp/xmltask.html" token="@JAR_14_MD5@" value="${JAR_14_MD5}"/>

<!-- get and confirm the xmltask version -->
<input message="Distribute [${com.oopsconsultancy.xmltask.version}] to Sourceforge " validargs="y,n" addproperty="distribute"/>
<condition property="do.abort">
<equals arg1="n" arg2="${distribute}"/>
</condition>
<fail if="do.abort"/>

<echo>Created version stamped documentation page /tmp/xmltask.html</echo>

<!-- generate versioned files for Sourceforge dispatch -->
<!-- generate versioned files for dispatch -->
<copy file="${jarfile}" tofile="${v_jarfile}"/>
<copy file="${tarfile}.gz" tofile="${v_tarfile}.gz"/>
<echo>Created ${v_jarfile}, ${v_tarfile}.gz</echo>

<!-- sends the files to Sourceforge.net -->
<echo>FTPing to upload.sourceforge.net</echo>
<ftp server="upload.sourceforge.net"
password="[email protected]"
userid="anonymous"
verbose="yes"
remotedir="/incoming"
depends="yes">
<fileset dir=".">
<include name="${v_jarfile}"/>
<include name="${v_tarfile}.gz"/>
</fileset>
</ftp>
</target>
</project>
40 changes: 6 additions & 34 deletions classes/build.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<project name="XmlTask" default="main" basedir=".">
<!-- $Id: build.xml,v 1.23 2007/04/26 20:16:33 bagnew Exp $ -->
<!-- $Id: build.xml,v 1.24 2009/09/14 17:18:50 bagnew Exp $ -->
<target name="init">
<!--
<property name="build.compiler" value="jikes"/>
Expand All @@ -20,18 +20,10 @@
<target name="javac" depends="init" description="Java source build">
<mkdir dir="classes"/>
<!-- then compile -->
<javac srcdir="." destdir="." debug="on" nowarn="true" source="1.4">
<include name="**/XMLCatalog.java"/>
</javac>
<javac srcdir="." destdir="classes" debug="on" nowarn="true" source="1.4">
<javac srcdir="." destdir="classes" debug="on" nowarn="true" source="1.7" target="1.7" includeantruntime="false">
<include name="**/*.java"/>
</javac>
<copy file="xmltask.properties" todir="classes"/>
<!-- we've built against dummy XPathAPI classes so we
can compile pre/post JDK 1.5 classes in the absence
of one or the other. We then delete the dummy classes -->
<delete dir="classes/com/sun"/>
<delete dir="classes/org/apache"/>
</target>

<target name="clean" depends="init" description="Clean classes">
Expand All @@ -55,10 +47,11 @@
<test name="com.oopsconsultancy.xmltask.test.TestXmlReplacement"/>
<classpath>
<pathelement location="${basedir}/classes"/>
<pathelement location="lib/junit-4.12.jar"/>
<pathelement location="lib/hamcrest-core-1.3.jar"/>
</classpath>
<formatter type="plain"/>
</junit>
<echo>Tests succeed!</echo>
</target>

<target name="main" depends="javac,test" description="Complete build/test"/>
Expand All @@ -76,8 +69,7 @@
<echo>Created .jar and .tar.gz</echo>
</target>

<target name="deliver" depends="package" description="Delivers to the Sourceforge site">
<!-- perform my local deployment for writing to Sourceforge -->
<target name="deliver" depends="package" description="Delivers">
<!-- create a web page with the correct version -->
<checksum file="${tarfile}.gz" property="GZ_MD5"/>
<checksum file="${jarfile}" property="JAR_MD5"/>
Expand All @@ -92,32 +84,12 @@
<replace file="/tmp/xmltask.html" token="@JAR_MD5@" value="${JAR_MD5}"/>
<replace file="/tmp/xmltask.html" token="@JAR_14_MD5@" value="${JAR_14_MD5}"/>

<!-- get and confirm the xmltask version -->
<input message="Distribute [${com.oopsconsultancy.xmltask.version}] to Sourceforge " validargs="y,n" addproperty="distribute"/>
<condition property="do.abort">
<equals arg1="n" arg2="${distribute}"/>
</condition>
<fail if="do.abort"/>

<echo>Created version stamped documentation page /tmp/xmltask.html</echo>

<!-- generate versioned files for Sourceforge dispatch -->
<!-- generate versioned files for dispatch -->
<copy file="${jarfile}" tofile="${v_jarfile}"/>
<copy file="${tarfile}.gz" tofile="${v_tarfile}.gz"/>
<echo>Created ${v_jarfile}, ${v_tarfile}.gz</echo>

<!-- sends the files to Sourceforge.net -->
<echo>FTPing to upload.sourceforge.net</echo>
<ftp server="upload.sourceforge.net"
password="[email protected]"
userid="anonymous"
verbose="yes"
remotedir="/incoming"
depends="yes">
<fileset dir=".">
<include name="${v_jarfile}"/>
<include name="${v_tarfile}.gz"/>
</fileset>
</ftp>
</target>
</project>
23 changes: 0 additions & 23 deletions classes/samples/adithya/build.xml

This file was deleted.

76 changes: 0 additions & 76 deletions classes/samples/adithya/x.xml

This file was deleted.

10 changes: 0 additions & 10 deletions classes/samples/praveen/build.xml

This file was deleted.

6 changes: 0 additions & 6 deletions classes/samples/praveen/in.xml

This file was deleted.

7 changes: 0 additions & 7 deletions classes/samples/praveen/out.xml

This file was deleted.

4 changes: 2 additions & 2 deletions classes/test/scripts/run.pl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/perl
# $Id: run.pl,v 1.48 2009/08/13 16:31:07 bagnew Exp $
# $Id: run.pl,v 1.49 2009/09/14 17:18:50 bagnew Exp $

#
# tests for xmltask. This swaps tests in/out depending on the
Expand All @@ -12,7 +12,7 @@
my $cont=0;
my @failures=();

my @tests = (1..129);
my @tests = (1..130);
if (@ARGV > 0) {
while ($ARGV[0]=~/^-/) {
if ($ARGV[0] eq "-c") {
Expand Down
4 changes: 2 additions & 2 deletions com/oopsconsultancy/xmltask/Action.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public abstract class Action {
/**
* the list of nodes to remove once modifications have been applied
*/
private List removals = new ArrayList();
private List<Node> removals = new ArrayList<>();

/**
* the document to work on
Expand Down Expand Up @@ -63,7 +63,7 @@ protected final void complete() {
rn.getParentNode().removeChild(rn);
}
}
removals = new ArrayList();
removals = new ArrayList<>();
}

/**
Expand Down
Loading

0 comments on commit fb1359e

Please sign in to comment.