Initial version of ant project a.k.a xml programming.
commit
0e031849a2
|
@ -0,0 +1,2 @@
|
|||
lib/
|
||||
target/
|
|
@ -0,0 +1,64 @@
|
|||
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="ant_demo1" default="run">
|
||||
|
||||
<property name="dist" location="target" />
|
||||
<property name="src" location="src" />
|
||||
<property name="srcJava" location="${src}/main/java" />
|
||||
<property name="libs" location="lib/" />
|
||||
|
||||
<target name="resolve-ivy-deps" description="Resolving dependencies">
|
||||
<ivy:retrieve />
|
||||
</target>
|
||||
|
||||
<target name="download-ivy" description="Download ivy">
|
||||
<mkdir dir="${user.home}/.ant/lib" />
|
||||
<get src="https://repo1.maven.org/maven2/org/apache/ivy/ivy/2.5.0/ivy-2.5.0.jar"
|
||||
dest="${user.home}/.ant/lib/"
|
||||
verbose="off"
|
||||
quiet="true" />
|
||||
</target>
|
||||
|
||||
<target name="init" description="init build" depends="download-ivy" />
|
||||
|
||||
<target name="deps" depends="resolve-ivy-deps" />
|
||||
|
||||
<target name="copy-resources">
|
||||
<mkdir dir="${dist}/exploded" />
|
||||
<copy toDir="${dist}/exploded">
|
||||
<fileset dir="${src}/main/resources/" />
|
||||
<dirset dir="${src}/main/resources/" />
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<target name="compile-classes">
|
||||
<mkdir dir="${dist}/classes" />
|
||||
<javac srcdir="${srcJava}" destdir="${dist}/classes" />
|
||||
<copy toDir="${dist}/exploded">
|
||||
<fileset dir="${dist}/classes/" />
|
||||
<dirset dir="${dist}/classes/" />
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<target name="package-jar">
|
||||
<jar basedir="${dist}/exploded"
|
||||
destfile="${dist}/libs/lib.jar"
|
||||
filesetmanifest="merge" />
|
||||
</target>
|
||||
|
||||
<target name="build"
|
||||
description="build">
|
||||
|
||||
<antcall target="deps" />
|
||||
<antcall target="copy-resources" />
|
||||
<antcall target="compile-classes" />
|
||||
<antcall target="package-jar" />
|
||||
|
||||
</target>
|
||||
|
||||
<target name="clean" description="clean">
|
||||
<delete dir="${dist}" />
|
||||
</target>
|
||||
|
||||
<target name="run" description="default runner" depends="build" />
|
||||
|
||||
|
||||
</project>
|
|
@ -0,0 +1,7 @@
|
|||
<ivy-module version="2.0">
|
||||
<info organisation="ch.polgrabia.demos" module="ant_demo1" />
|
||||
<dependencies>
|
||||
<dependency org="commons-lang" name="commons-lang" rev="2.0" />
|
||||
<dependency org="commons-cli" name="commons-cli" rev="1.0" />
|
||||
</dependencies>
|
||||
</ivy-module>
|
|
@ -0,0 +1,5 @@
|
|||
public class Program {
|
||||
public static void main(String[] args) {
|
||||
System.out.println("Hello World!!!");
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
Main-Class: Program
|
|
@ -0,0 +1,3 @@
|
|||
<web>
|
||||
|
||||
</web>
|
Loading…
Reference in New Issue