-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.xml
110 lines (97 loc) · 4.31 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
109
110
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE project>
<project name="openmeetings moodle plugin" basedir="./" default="dist-bin"
xmlns="antlib:org.apache.tools.ant"
xmlns:rat="antlib:org.apache.rat.anttasks"
xmlns:ivy="antlib:org.apache.ivy.ant">
<property name="dist.dir" value="dist" />
<property name="project.version" value="4.4.2" />
<property name="project.distname" value="openmeetings-moodle-plugin" />
<property name="plugin.name" value="openmeetings" />
<tstamp>
<format property="VERSION_DATE" pattern="yyyyMMdd01" />
</tstamp>
<target name="dist-bin" depends="clean">
<property name="archive.file.name" value="${dist.dir}/apache-${project.distname}-${project.version}" />
<mkdir dir="${dist.dir}/${plugin.name}"/>
<copy todir="${dist.dir}/${plugin.name}">
<fileset dir="${basedir}">
<exclude name=".*/**" />
<exclude name="dist/**"/>
<exclude name="build.xml"/>
<exclude name="ivy.xml"/>
<exclude name="ivysettings.xml"/>
<exclude name="ivysettings.xsd"/>
</fileset>
</copy>
<echo message="$$plugin->release = '${project.version}';${line.separator}" file="${dist.dir}/${plugin.name}/version.php"
append="true" force="true"/>
<echo message="$$plugin->version = ${VERSION_DATE};${line.separator}" file="${dist.dir}/${plugin.name}/version.php"
append="true" force="true"/>
<zip destfile="${archive.file.name}.zip">
<zipfileset dir="${dist.dir}">
<include name="${plugin.name}/**/**" />
</zipfileset>
</zip>
<zip destfile="${archive.file.name}-src.zip">
<zipfileset dir="${basedir}">
<exclude name="*dist/**" />
</zipfileset>
</zip>
<tar longfile="gnu" compression="gzip" destfile="${archive.file.name}.tar.gz">
<tarfileset dir="${dist.dir}">
<include name="${plugin.name}/**/**" />
</tarfileset>
</tar>
<tar longfile="gnu" compression="gzip" destfile="${archive.file.name}-src.tar.gz">
<tarfileset dir="${basedir}">
<exclude name="*dist/**" />
</tarfileset>
</tar>
</target>
<target name="clean">
<delete includeemptydirs="true" dir="${dist.dir}" />
</target>
<!-- RAT -->
<property name="ivy.install.version" value="2.3.0-rc1" />
<property name="project.lib.dir" value="${dist.dir}" />
<property name="ivy.jar.path" value="${project.lib.dir}/ivy-${ivy.install.version}.jar" />
<available file="${ivy.jar.path}" type="file" property="ivy.installed" />
<target name="-download-ivy" unless="ivy.installed">
<mkdir dir="${project.lib.dir}" />
<echo message="Downloading ivy..." />
<get src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" dest="${ivy.jar.path}" usetimestamp="true" />
</target>
<path id="rat.classpath">
<fileset dir="${project.lib.dir}" includes="*.jar" />
</path>
<target name="-availability-check" unless="red5.installed" description="Check which libraries need to be retrieved">
<mkdir dir="${project.lib.dir}" />
<available classpathref="rat.classpath" classname="org.apache.rat.Report" property="rat.installed" />
</target>
<!-- Check for rat libraries -->
<target name="-retrieve-rat" unless="rat.installed" description="Retrieves the libraries if needed" depends="-availability-check, -download-ivy">
<taskdef uri="antlib:org.apache.ivy.ant" resource="org/apache/ivy/ant/antlib.xml" classpath="${ivy.jar.path}" />
<ivy:resolve file="ivy.xml" checkIfChanged="false" transitive="false" />
<ivy:retrieve pattern="${project.lib.dir}/[artifact]-[type]-[revision].[ext]" />
</target>
<target name="report_rat" depends="-retrieve-rat">
<taskdef uri="antlib:org.apache.rat.anttasks" resource="org/apache/rat/anttasks/antlib.xml" classpathref="rat.classpath" />
<rat:report>
<fileset dir="${basedir}">
<exclude name="*dist/**" />
</fileset>
</rat:report>
</target>
</project>