-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
98 lines (84 loc) · 3.59 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<project name="jigsaw_create_build" default="main" basedir=".">
<description>
Author: Giovane Boaviagem Ribeiro
Since: 12/06/2014
Build the app
Copyright (C) 2014 Giovane Boaviagem
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses.
</description>
<!--
#
# Change here the version.
#
-->
<property name="build.version" value="1.0"/>
<!--
#
#
#
#
#
-->
<property name="src" value="src"/>
<property name="config" value="config"/>
<property name="pieces" value="pieces"/>
<property name="dist" value="dist"/>
<property name="dist.bin" value="${dist}/bin"/>
<property name="dist.pieces" value="${dist}/pieces"/>
<property name="dist.exec.sh" value="${dist}/exec.sh"/>
<property name="dist.exec.bat" value="${dist}/exec.bat"/>
<property name="jar.name" value="jc-${build.version}.jar"/>
<property name="zip.name" value="jigsaw-creator-${build.version}.zip"/>
<property name="main.class" value="br.com.giovanebribeiro.jigsaw_creator.FrameMain"/>
<target name="clean">
<delete dir="${dist}" quiet="true"/>
<mkdir dir="${dist}"/>
<mkdir dir="${dist.bin}"/>
<mkdir dir="${dist.pieces}"/>
</target>
<target name="compile">
<javac srcdir="${src}" destdir="${dist.bin}" includeAntRuntime="false" verbose="true" failonerror="true"/>
<!--Incrementing the build number-->
<tstamp>
<format property="current.time" pattern="dd/MM/yyyy hh-mm-ss.SSS aa"/>
</tstamp>
<propertyfile file="${config}/messages.properties">
<entry key="build" type="int" operation="+" default="0"/>
<entry key="version" value="${build.version}"/>
<entry key="date" value="${current.time}"/>
</propertyfile>
<copy todir="${dist.bin}" verbose="true" failonerror="true">
<fileset dir="${config}" includes="*.properties"/>
</copy>
<echo message="#!/bin/bash${line.separator}" file="${dist.exec.sh}" append="true"/>
<echo message="java -jar ${jar.name}" file="${dist.exec.sh}" append="true"/>
<chmod file="${dist.exec.sh}" perm="+x" verbose="yes"/> <!--only for unix systems, by default-->
<echo message="@echo off${line.separator}" file="${dist.exec.bat}" append="true"/>
<echo message="start java -jar ${jar.name}" file="${dist.exec.bat}" append="true"/>
<copy todir="${dist.pieces}" verbose="true" failonerror="true">
<fileset dir="${pieces}" includes="*.*"/>
</copy>
</target>
<target name="jar">
<jar basedir="${dist.bin}" destfile="${dist}/${jar.name}">
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Main-Class" value="${main.class}"/>
</manifest>
</jar>
<delete dir="${dist.bin}" quiet="true"/>
</target>
<target name="pack">
<zip basedir="${dist}" destfile="${zip.name}"/>
</target>
<target name="main" depends="clean,compile,jar,pack"/>
</project>