Skip to content

Commit

Permalink
Corrected extra v in program title and added new dist targets to ant …
Browse files Browse the repository at this point in the history
…build
  • Loading branch information
andybrodie committed Mar 8, 2015
1 parent 945ed3d commit 6e7f3ac
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 15 deletions.
41 changes: 28 additions & 13 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,17 @@
<property name="debuglevel" value="source,lines,vars" />
<property name="target" value="1.6" />
<property name="source" value="1.6" />
<property name="LIB" value="lib" />
<property name="lib" value="lib" />
<property name="dist" value="dist" />
<path id="JUnit 4.libraryclasspath">
<fileset dir="${LIB}">
<fileset dir="${lib}">
<include name="junit-4.11.jar" />
<include name="hamcrest-core-1.3.jar" />
</fileset>
</path>
<!-- The classpath to build xml2csv against -->
<path id="xml2csv.build.classpath">
<fileset dir="${LIB}">
<fileset dir="${lib}">
<include name="Saxon-HE-9.5.1-6.jar" />
<include name="xercesImpl-2.11.0.jar" />
<include name="commons-cli-1.2.jar" />
Expand All @@ -30,7 +31,7 @@
<path refid="xml2csv.build.classpath" />
<!-- Make sure that you include ALL jar files, otherwise we're taking responsibility for knowing
all the transitive dependendies of Jars we depend on. -->
<fileset dir="${LIB}">
<fileset dir="${lib}">
<include name="**/*.jar" />
</fileset>
<!-- Don't forget to include our own bin directory -->
Expand All @@ -43,16 +44,18 @@
<target name="clean" description="Deletes all the built artifacts">
<delete dir="bin" />
<delete dir="javadoc" />
<delete dir="${dist}" />
<delete dir="${lib}" />
</target>
<target name="clean-ivy" description="Deletes the dependencies downloaded by Ivy">
<delete dir="${LIB}" />
<delete dir="${lib}" />
</target>
<target name="clean-junit" description="Deletes all JUnit outputs">
<delete dir="${junit.output.dir}" />
</target>
<target name="clean-jar" description="Deletes all built jar artifacts">
<delete file="xml2csv.jar" />
<delete file="xml2csv-standalone.jar" />
<delete file="${dist}/xml2csv.jar" />
<delete file="${dist}/xml2csv-standalone.jar" />
</target>
<target depends="clean, clean-ivy, clean-junit,clean-jar" name="clean-all" description="Deletes all built artifacts and downloaded dependencies" />
<target depends="resolve" name="build" description="Compile all the sources">
Expand Down Expand Up @@ -122,7 +125,7 @@
</mapper>
</pathconvert>
<tstamp />
<jar destfile="xml2csv.jar">
<jar destfile="${dist}/xml2csv-${version}.jar">
<manifest>
<attribute name="Class-Path" value="${mf.classpath}" />
<attribute name="Main-Class" value="com.locima.xml2csv.cmdline.Program" />
Expand All @@ -131,7 +134,7 @@
</jar>
</target>
<target name="build-standalone-jar" description="Create standalone runnable jar" depends="build, update-build.properties">
<jar destfile="xml2csv-standalone.jar">
<jar destfile="${dist}/xml2csv-standalone-${version}.jar">
<manifest>
<attribute name="Main-Class" value="org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader" />
<attribute name="Rsrc-Main-Class" value="com.locima.xml2csv.cmdline.Program" />
Expand All @@ -149,42 +152,54 @@
<zipfileset dir="lib" includes="xml-apis-1.4.01.jar" />
</jar>
</target>
<target name="build-javadoc" depends="resolve" description="Build project javadoc">
<javadoc sourcepath="src" access="private" destdir="javadoc" packagenames="com.locima.xml2csv.*" author="true" version="true" use="true">
<target name="build-javadoc" depends="resolve, create-properties" description="Build project javadoc">
<javadoc sourcepath="src" access="private" destdir="javadoc" packagenames="com.locima.xml2csv.*" author="true" version="true" use="true" overview="src/overview.html" windowtitle="xml2csv ${version}">
<classpath refid="xml2csv.execute.classpath" />
<bottom>
&lt;i&gt;Copyright &#169; 2014-2015 Locima Ltd. All Rights Reserved. This code and documentation are licensed under the Microsoft Public License &lt;a target="_blank" href="http://www.microsoft.com/en-us/openness/licenses.aspx"&gt;MS-PL&lt;a&gt;.&lt;/i&gt;
</bottom>
</javadoc>
<jar destfile="${dist}/xml2csv-${version}-javadoc.jar" basedir="javadoc" />
</target>
<target name="update-build.properties" description="Updates or creates the file src/META-INF/build.properties which contains information used by the packaged program to track version.">
<target name="create-properties" description="Creates properties used in the build (current timestamp and Git information (latest tag is version number and latest commit hash)">
<!-- Get the short commit hash from Git -->
<exec executable="git.exe" outputproperty="commitHash">
<arg value="log" />
<arg value="-1" />
<arg value="--pretty=format:%h" />
</exec>
<echo message="Latest commit hash: ${commitHash}" />

<!-- Get the tag name -->
<exec executable="git.exe" outputproperty="version">
<arg value="describe" />
<arg value="--abbrev=0" />
<arg value="--tags" />
</exec>
<echo message="Version: ${version}" />

<!-- Get the build date -->
<tstamp>
<format property="buildTimeStamp" pattern="yyyy-MM-dd HH:mm:ss" />
</tstamp>
<echo message="Build Timestamp ${buildTimeStamp}" />

</target>
<target name="update-build.properties" description="Updates or creates the file src/META-INF/build.properties which contains information used by the packaged program to track version." depends="create-properties">
<property name="propsFile" value="src/META-INF/build.properties" />
<propertyfile file="${propsFile}" comment="Created dynamically by Ant in build.xml update-version-properties task">
<entry key="CommitHash" value="${commitHash}" />
<entry key="Version" value="${version}" />
<entry key="BuildTimeStamp" value="${buildTimeStamp}" />
</propertyfile>
</target>

<target name="build-src-jar" depends="update-build.properties" description="Builds the distributable source jar">
<jar destfile="${dist}/xml2csv-${version}-sources.jar" basedir="src"/>
<jar destfile="${dist}/xml2csv-${version}-test-sources.jar" basedir="src"/>
</target>

<target name="all" depends="build-jar, build-standalone-jar, build-javadoc" description="Build the regular jar, standalone jar and javadoc (all delivered targets)" />
<target name="all" depends="build-jar, build-standalone-jar, build-javadoc, build-src-jar"
description="Build the regular jar, standalone jar and javadoc (all delivered targets)" />

</project>
4 changes: 2 additions & 2 deletions src/com/locima/xml2csv/cmdline/Program.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class Program {
private static final Logger LOG = LoggerFactory.getLogger(Program.class);

/**
* The main command line options, used after {@value #HELP_OPTONS} has not found a match. Set up by the static constructor.
* The main command line options, used after {@link #HELP_OPTIONS} has not found a match. Set up by the static constructor.
*/
public static final Options MAIN_OPTIONS;

Expand Down Expand Up @@ -153,7 +153,7 @@ public static void main(String[] args) {
*/
private String createHeader() {
StringBuilder sb = new StringBuilder();
sb.append("xml2csv v");
sb.append("xml2csv ");
Properties props = getBuildProperties();
sb.append(props.getProperty(PROPERTY_VERSION));
sb.append(". ");
Expand Down
36 changes: 36 additions & 0 deletions src/overview.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<body>

<p>xml2csv is a command line utility and library to convert XML files to CSV files, according to a configuration provided by the user.</p>

<p>This software is maintained on Github at <a href="http://www.github.com/andybrodie/xml2csv">http://www.github.com/andybrodie/xml2csv</a>.</p>

<p>xml2csv relies on the following third party software, each with it's own separate license:</p>

<dl>
<dt>Apache Commons CLI (<a href="http://commons.apache.org/proper/commons-cli/">http://commons.apache.org/proper/commons-cli/</a>)</dd>
<dd>Licensed under the Apache License Version 2.0 (<a href="http://www.apache.org/licenses/">http://www.apache.org/licenses/</a>)</dd>

<dt>Apache Xerces 11.2 (<a href="http://xerces.apache.org/">http://xerces.apache.org/</a>)</dt>
<dd>Licensed under Apache License Version 2.0 (<a href="http://xerces.apache.org/xml-commons/licenses.html">http://xerces.apache.org/xml-commons/licenses.html</a>)</dd>

<dt>Jar-in-Jar-Loader (<a href="http://www.eclipse.org">http://www.eclipse.org</a>)</dt>
<dd>Licensed under the Eclipse Public License 1.0 (<a href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</a>)</dd>

<dt>Junit 4.0 (<a href="http://junit.org/">http://junit.org/</a>)</dt></dd>
<dd>Licensed under Eclipse Public License Version 1.0 (<a href="http://junit.org/license.html">http://junit.org/license.html</a>)</dd>

<dt>Qos Logback (<a href="http://logback.qos.ch/">http://logback.qos.ch/</a>)</dt>
<dd>Licensed under the Eclipse Public License (<a href="http://logback.qos.ch/license.html">http://logback.qos.ch/license.html</a>)</dd>

<dt>Qos SLF4J (<a href="http://slf4j.org/">http://slf4j.org/</a>)</dt>
<dd>Licensed under the MIT licence (<a href="http://slf4j.org/license.html">http://slf4j.org/license.html</a>)</dd>

<dt>Saxonica Saxon 9 HE (<a href="http://saxon.sourceforge.net/">http://saxon.sourceforge.net/</a>)</dt>
<dd>Licensed under Mozilla Public License 1.0 (<a href="https://www.mozilla.org/MPL/1.0/">https://www.mozilla.org/MPL/1.0/</a>)</dd>
</dl>

<p>Copyright 2014-2015 Locima Ltd. (e-mail: `enquiries (at) locima.com` or website: <a href="http://www.locima.com">http://www.locima.com</a>)</p>

<p>Licensed under the Microsoft Public License (<a href="http://www.microsoft.com/en-us/openness/licenses.aspx">http://www.microsoft.com/en-us/openness/licenses.aspx</a>)</p>

</body>

0 comments on commit 6e7f3ac

Please sign in to comment.