forked from lamikae/html2jsr286
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
108 lines (91 loc) · 3.68 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
99
100
101
102
103
104
105
106
107
108
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Version: 0.1
-->
<project default="package" name="compile and pack the project">
<!--
################################################################################################################
Properties for the build process; Change the parameters you need
-->
<property name="src.dir" value="WEB-INF/src" />
<property name="lib.dir" value="WEB-INF/lib" />
<property name="metainf.dir" value="META-INF" />
<property name="build.dir" value="build" />
<property name="package.name" value="rails-portlet" />
<!-- This is the path of PortletVersion.java file -->
<property name="version.file"
value="WEB-INF/src/com/celamanzi/liferay/portlets/rails286/PortletVersion.java" />
<property name="readme.path" value="README.rdoc" />
<!-- The liferay version -->
<property name="liferay" value="6.0.5" />
<!--
################################################################################################################
Classpath builder, this builder could include all jar files inside the directory defined by
lib.dir property or use the files listed. Take a look of portal-service jar, with the default
include we use the liferay property to include the correct file.
-->
<path id="build.classpath">
<!--
<fileset dir="${lib.dir}" includes="**/*.jar"/>
-->
<fileset dir="${lib.dir}" includes="portlet-1.0.jar"/>
<fileset dir="${lib.dir}" includes="portlet-2.0.jar"/>
<fileset dir="${lib.dir}" includes="commons-logging.jar"/>
<fileset dir="${lib.dir}" includes="commons-fileupload-1.2.1.jar"/>
<fileset dir="${lib.dir}" includes="commons-io-1.4.jar"/>
<fileset dir="${lib.dir}" includes="portal-impl.jar"/>
<!--
<fileset dir="${lib.dir}" includes="portal-kernel.jar" />
-->
<fileset dir="${lib.dir}" includes="commons-httpclient-3.1.jar"/>
<fileset dir="${lib.dir}" includes="servlet-api-2.4.jar"/>
<fileset dir="${lib.dir}" includes="htmlparser-1.6.jar"/>
<fileset dir="${lib.dir}" includes="portal-service-${liferay}.jar"/>
<fileset dir="${lib.dir}" includes="util-java.jar"/>
</path>
<!--
################################################################################################################
Tasks to compile and pack the project
-->
<target name="init" description="create the build dir">
<delete dir="${build.dir}" />
<mkdir dir="${build.dir}" />
<mkdir dir="${build.dir}/META-INF" />
</target>
<target name="compile" depends="init" description="compile everything">
<!-- compilation process -->
<javac srcdir="${src.dir}" destdir="${build.dir}" includeantruntime="false" encoding="UTF-8">
<classpath refid="build.classpath" />
<compilerarg value="-Xlint:unchecked"/>
<compilerarg value="-Xlint:deprecation"/>
</javac>
<copy file="${readme.path}" todir="${build.dir}"/>
<copy todir="${build.dir}/META-INF">
<fileset dir="${metainf.dir}" />
</copy>
<!-- extract the version number with awk, use version.file property -->
<exec executable="awk"
output="${build.dir}/VERSION">
<arg value="-F\"" />
<arg value="/PORTLET_VERSION/{print $2}" />
<arg value="${version.file}" />
</exec>
</target>
<target name="package" depends="compile" description="Pack the compiled classes">
<tstamp/>
<!-- needed for TODAY -->
<manifest file="MANIFEST.MF">
<attribute name="Built-Date" value="${TODAY}"/>
</manifest>
<loadfile property="version_number" srcFile="${build.dir}/VERSION">
<filterchain>
<striplinebreaks/>
</filterchain>
</loadfile>
<jar destfile="${build.dir}/${package.name}-${version_number}.jar"
basedir="${build.dir}"
manifest="MANIFEST.MF">
</jar>
<delete file="MANIFEST.MF"/>
</target>
</project>