summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Jamison <ishmalius@gmail.com>2008-03-31 18:14:58 +0000
committerishmal <ishmal@users.sourceforge.net>2008-03-31 18:14:58 +0000
commit0f270a59f397dca39befeed9f4ad83d2270bae5e (patch)
treed9161f8053ca0076e7caca729f6d94c28e081dec
parentCmake: Start of Platform Checks (diff)
downloadinkscape-0f270a59f397dca39befeed9f4ad83d2270bae5e.tar.gz
inkscape-0f270a59f397dca39befeed9f4ad83d2270bae5e.zip
Add simple <jar> task. Separate "builddist" target
(bzr r5270)
-rw-r--r--build.xml68
-rw-r--r--buildtool.cpp40
2 files changed, 83 insertions, 25 deletions
diff --git a/build.xml b/build.xml
index 25a1a2c96..82b9e719d 100644
--- a/build.xml
+++ b/build.xml
@@ -325,17 +325,6 @@
<!--
########################################################################
- ## T A R G E T : JAVA
- ########################################################################
- -->
- <target name="java" depends="init"
- description="compile java binding classes">
- <javac srcdir="${src}/bind/java" destdir="${build}/java/classes"/>
- </target>
-
-
- <!--
- ########################################################################
## T A R G E T : L I B
########################################################################
-->
@@ -584,9 +573,6 @@
<copy file="${gtk}/bin/gspawn-win32-helper.exe" todir="${dist}"/>
<copy file="${gtk}/bin/gspawn-win32-helper-console.exe" todir="${dist}"/>
- <!-- Java - copying this dir is ok even if you dont use it -->
- <copy todir="${dist}/share"> <fileset dir="${build}/java"/> </copy>
-
<!-- PERL -->
<copy file="${gtk}/perl/bin/perl58.dll" todir="${dist}"/>
@@ -648,39 +634,75 @@
</target>
+ <!--
+ ########################################################################
+ ## T A R G E T : JAVAC
+ ########################################################################
+ -->
+ <target name="javac" depends="init"
+ description="compile java binding classes">
+ <javac srcdir="${src}/bind/java" destdir="${build}/java/classes"/>
+ </target>
<!--
########################################################################
- ## T A R G E T : D I S T - A L L
+ ## T A R G E T : JAR
########################################################################
-->
- <target name="dist-all" depends="dist"
- description="generate the distribution, along with inkview" >
-
- <copy file="${build}/inkview.exe" todir="${dist}"/>
- <copy file="${build}/inkview.dbg" todir="${dist}"/>
+ <target name="jar" depends="javac"
+ description="pack java classes and resources into a jar file">
+ <copy todir="${build}/java/classes"> <fileset dir="${src}/bind/data"/> </copy>
+ <jar basedir="${build}/java/classes" destfile="${build}/java/lib/inkscape.jar"/>
</target>
+ <!--
+ ########################################################################
+ ## T A R G E T : BINDDIST
+ ########################################################################
+ -->
+ <target name="binddist" depends="jar"
+ description="pack java classes and resources into a jar file">
+ <copy todir="${dist}/share"> <fileset dir="share/bind"/> </copy>
+ <copy todir="${dist}/share/bind/java"> <fileset dir="${build}/java/lib"/> </copy>
+
+ </target>
<!--
########################################################################
- ## T A R G E T : JAVACLEAN
+ ## T A R G E T : BINDCLEAN
########################################################################
-->
- <target name="javaclean" depends=""
+ <target name="bindclean" depends=""
description="clean up java binding classes">
<delete dir="${build}/java"/>
</target>
+
+ <!--
+ ########################################################################
+ ## T A R G E T : D I S T - A L L
+ ########################################################################
+ -->
+ <target name="dist-all" depends="dist"
+ description="generate the distribution, along with inkview" >
+
+ <copy file="${build}/inkview.exe" todir="${dist}"/>
+ <copy file="${build}/inkview.dbg" todir="${dist}"/>
+ </target>
+
+
+
+
+
<!--
########################################################################
## T A R G E T : C L E A N
########################################################################
-->
- <target name="clean" depends="javaclean"
+ <target name="clean" depends="bindclean"
description="clean up. deleting build and distro dirs" >
<delete dir="${build}"/>
diff --git a/buildtool.cpp b/buildtool.cpp
index 24de41077..f912ebdea 100644
--- a/buildtool.cpp
+++ b/buildtool.cpp
@@ -38,7 +38,7 @@
*
*/
-#define BUILDTOOL_VERSION "BuildTool v0.7.6, 2007-2008 Bob Jamison"
+#define BUILDTOOL_VERSION "BuildTool v0.7.7, 2007-2008 Bob Jamison"
#include <stdio.h>
#include <fcntl.h>
@@ -6650,20 +6650,56 @@ class TaskJar : public Task
public:
TaskJar(MakeBase &par) : Task(par)
- { type = TASK_JAR; name = "jar"; }
+ { type = TASK_JAR; name = "jar"; command = "jar";}
virtual ~TaskJar()
{}
virtual bool execute()
{
+ String cmd = command;
+ cmd.append(" -cf ");
+ cmd.append(destfile);
+ cmd.append(" -C ");
+ cmd.append(basedir);
+ cmd.append(" .");
+
+ String execCmd = cmd;
+
+ String outString, errString;
+ bool ret = executeCommand(execCmd.c_str(), "", outString, errString);
+ if (!ret)
+ {
+ error("<jar> command '%s' failed :\n %s",
+ execCmd.c_str(), errString.c_str());
+ return false;
+ }
return true;
}
virtual bool parse(Element *elem)
{
+ String s;
+ if (!parent.getAttribute(elem, "command", s))
+ return false;
+ if (s.size() > 0)
+ command = s;
+ if (!parent.getAttribute(elem, "basedir", basedir))
+ return false;
+ if (!parent.getAttribute(elem, "destfile", destfile))
+ return false;
+ if (basedir.size() == 0 || destfile.size() == 0)
+ {
+ error("<jar> required both basedir and destfile attributes to be set");
+ return false;
+ }
return true;
}
+
+private:
+ String command;
+ String basedir;
+ String destfile;
};