summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: aa1e38b)
raw | patch | inline | side by side (parent: aa1e38b)
author | ishmal <ishmal@users.sourceforge.net> | |
Mon, 31 Mar 2008 18:14:58 +0000 (18:14 +0000) | ||
committer | ishmal <ishmal@users.sourceforge.net> | |
Mon, 31 Mar 2008 18:14:58 +0000 (18:14 +0000) |
build.xml | patch | blob | history | |
buildtool.cpp | patch | blob | history |
diff --git a/build.xml b/build.xml
index 25a1a2c9670f04a4efd5613da3b42359acdf237c..82b9e719dd456e0c5245e569eea3681e7d789eef 100644 (file)
--- a/build.xml
+++ b/build.xml
</target>
- <!--
- ########################################################################
- ## 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
<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}"/>
</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 24de4107707c2b85a5a98f9db964da2a0268e310..f912ebdeaf23d262c7b4cde3c4213218defdd49b 100644 (file)
--- a/buildtool.cpp
+++ b/buildtool.cpp
*
*/
-#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>
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;
};