source: extensions/net.sf.basedb.skincollection/trunk/build.xml @ 6225

Last change on this file since 6225 was 6225, checked in by Nicklas Nordborg, 2 years ago

Preparing to release Skin collection 1.2

File size: 4.0 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3  Copyright (C) 2011 Nicklas Nordborg
4
5  This file is part of the Example Code Package for BASE.
6  Available at http://baseplugins.thep.lu.se/
7  BASE main site: http://base.thep.lu.se/
8 
9  This is free software; you can redistribute it and/or
10  modify it under the terms of the GNU General Public License
11  as published by the Free Software Foundation; either version 3
12  of the License, or (at your option) any later version.
13 
14  The software is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with BASE. If not, see <http://www.gnu.org/licenses/>.
21-->
22<project 
23  name="SkinCollection" 
24  default="build" 
25  basedir=".">
26
27  <!--create this file if you need to override values from properties below -->
28  <property file="build.properties" />
29
30  <!-- variables used -->
31  <property name="name" value="skin-collection" />
32  <property name="version" value="1.2" />
33  <property name="src" location="src" description="Location of source files" />
34  <property name="build" location="build" description="Location of compiled files" />
35  <property name="dist" location="dist" description="Directory where distribution should be created" />
36  <property name="jar.name" value="${name}.jar" description="Name of JAR file with the extensions." />
37  <property name="tar.prefix" value="${name}-${version}" description="Prefix of .tar.gz file for download." />
38  <property name="tar.name" value="${tar.prefix}.tar.gz" description="Full name of .tar.gz file for download." />
39  <property name="depend.base-version" 
40    value="3.18.1" 
41    description="The BASE version that this project depends on."
42  />
43
44  <target name="init">
45    <mkdir dir="${build}" />
46    <mkdir dir="${dist}" />
47  </target>
48   
49  <target name="clean">
50    <delete failonerror="false" includeemptydirs="true">
51      <fileset dir="${build}" defaultexcludes="no" />
52      <fileset dir="${dist}" defaultexcludes="no" />
53      <fileset file="${jar.name}" />
54      <fileset file="${tar.name}" />
55    </delete>
56  </target>
57 
58  <target 
59    name="dist" 
60    depends="clean,build"
61    >
62    <copy todir="${dist}">
63      <fileset dir="." includes="README,LICENSE" />
64      <fileset file="${jar.name}" />
65    </copy>
66  </target>
67 
68  <target
69    name="package"
70    depends="dist"
71    description="Create binary distribution package"
72    >
73    <tar
74      destfile="${tar.name}"
75      longfile="gnu"
76      compression="gzip"
77      >
78      <tarfileset
79        dir="${dist}"
80        prefix="${tar.prefix}"
81        preserveLeadingSlashes="true"
82        >
83      </tarfileset>
84    </tar>
85  </target>
86 
87  <target 
88    name="build"
89    depends="init"
90    description="Compiles the plugin and put in jar"
91    >
92    <jar 
93      jarfile="${jar.name}" 
94      manifest="META-INF/MANIFEST.MF"
95      >
96      <fileset dir="." includes="META-INF/**" />
97      <fileset dir="." includes="resources/**" />
98    </jar>
99  </target>
100 
101  <target 
102    name="install"
103    depends="build"
104    >
105    <fail unless="base.plugins" message="base.plugins is not set to the path of BASE plug-ins directory." />
106    <copy todir="${base.plugins}">
107      <fileset file="${jar.name}" />
108    </copy>
109    <echo>Copied '${jar.name}' to '${base.plugins}'.</echo>
110  </target>
111 
112  <target name="update-version">
113    <echo>Setting version to: ${version}</echo>
114   
115    <echo>extensions.xml</echo>
116    <replaceregexp 
117      file="META-INF/extensions.xml"
118      match="&lt;version&gt;.*&lt;/version&gt;"
119      replace="&lt;version&gt;${version}&lt;/version&gt;"
120      encoding="UTF-8"
121    />
122    <replaceregexp 
123      file="META-INF/extensions.xml"
124      match="&lt;min-base-version&gt;.*&lt;/min-base-version&gt;"
125      replace="&lt;min-base-version&gt;${depend.base-version}&lt;/min-base-version&gt;"
126      encoding="UTF-8"
127    />
128    <echo>Don't forget to commit the changes to the subversion repository!</echo>
129  </target>
130</project>
Note: See TracBrowser for help on using the repository browser.