/[schmitzm]/branches/2.2.x/build.xml
ViewVC logotype

Diff of /branches/2.2.x/build.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 11 by mojays, Wed Feb 25 15:20:19 2009 UTC revision 686 by mojays, Wed Feb 10 15:24:20 2010 UTC
# Line 1  Line 1 
1  <!-- Build file for SCHMITZM.  <!-- Build file for SCHMITZM. Target ZIPs/JARs are placed in "dist" folder.
2       This script does not compile the java source, but only create a       NOTE: This script does not compile the java source (because of library
3       jar from the existing binaries expected in folder "classes".             dependencies)!!
4    
5         Option "jar"     -> a JAR from the existing binaries expected in folder
6                             "classes" plus a ZIP of the JAR
7         Option "src"     -> a ZIP of the source code in folder "src"
8         Option "javadoc" -> a JavaDoc in folder "javadoc" plus a ZIP of
9                             this folder
10         Option "all"     -> all of the upper mentioned options
11         Option "basic"   -> only "jar" and "src"
12        
13         The default option is "basic"
14  -->  -->
15  <project default="jar" basedir=".">  <project default="basic" basedir="." xmlns:ac="antlib:net.sf.antcontrib">
16            <taskdef uri="antlib:net.sf.antcontrib" classpath="ant-contrib-1.0b2.jar" />
17    
18            <!-- Project name -->
19            <property name="PROJECT.NAME"    value="schmitzm"/>
20            <!-- Version number added as postfix to files -->
21            <property name="VERSION"         value="-2.0"/>
22    
23            <!-- Destination folder for ZIPs and JARs -->
24            <property name="DEST.DIR"         value="dist"/>
25            <!-- Prefix for the destination file names
26                 e.g. "schmitzm" >> "schmitzm.jar", "schmitzm-src.jar" -->
27            <property name="PROJECT.PREFIX"   value="${PROJECT.NAME}${VERSION}"/>
28    
29            <!-- Global prefix directory for ZIP files (except ZIP of JAR!) -->
30            <property name="ZIP.ROOT.DIR"     value="${PROJECT.PREFIX}"/>
31            
32            <!-- Source and Destination for source code ZIP -->
33            <property name="DIR.SRC"          value="src"/>
34            <property name="FILE.SRC.ZIP"     value="${DEST.DIR}/${PROJECT.PREFIX}-src.zip"/>
35            
36            <!-- Source and Destination for JAR file -->
37            <property name="DIR.CLASSES"      value="classes"/>
38        <property name="FILE.JAR"         value="${DEST.DIR}/${PROJECT.PREFIX}.jar"/>
39            <property name="FILE.JAR.ZIP"     value="${FILE.JAR}.zip"/>
40            
41            <!-- Destination for JavaDoc and its ZIP -->
42            <property name="DIR.JAVADOC"      value="javadoc"/>
43            <property name="FILE.JAVADOC.ZIP" value="${DEST.DIR}/${PROJECT.PREFIX}-doc.zip"/>
44            <property name="LINK.JDK"         value="http://java.sun.com/javase/6/docs/api/"/>
45            <property name="LINK.LOG4J"       value="http://logging.apache.org/log4j/docs/api/"/>
46            <property name="JAVADOC.TITLE"    value="Klassenbibliothek Martin Schmitz"/>
47    
48            <target name="all">
49                    <antcall target="jar"/>
50                    <antcall target="src"/>
51                    <antcall target="javadoc"/>
52            </target>
53    
54            <target name="basic">
55                    <antcall target="jar"/>
56                    <antcall target="src"/>
57            </target>
58    
59            <!-- ##############  Create a JAR from "classes" and ZIP it ############## -->
60    <!--    <target name="jar" depends="nativeToAscii"-->
61          <target name="jar">          <target name="jar">
62                  <jar destfile="schmitzm.jar" index="false" level="8" duplicate="preserve">                  <!-- Create the JAR -->
63                          <fileset dir="classes">                  <delete failonerror="false" file="${FILE.JAR}"/>
64                    <jar destfile="${FILE.JAR}" index="false" level="8" duplicate="preserve">
65                            <fileset dir="${DIR.CLASSES}">
66                                  <exclude name="schmitzm/test**" />                                  <exclude name="schmitzm/test**" />
67                                  <exclude name="**/*.html" />                                  <exclude name="**/*.html" />
68                                  <exclude name="**/*.xcf" />                                  <exclude name="**/*.xcf" />
69                                  <exclude name="**/Thumbs.db" />                                  <exclude name="**/Thumbs.db" />
70                          </fileset>                          </fileset>
   
71                          <manifest>                          <manifest>
72                                  <attribute name="Created-By" value="Martin O.J. Schmitz, Stefan A. Krüger" />                                  <attribute name="Created-By" value="Martin O.J. Schmitz, Stefan A. Krüger" />
73                          </manifest>                          </manifest>
   
74                  </jar>                  </jar>
75                    <!-- Create a ZIP of the JAR -->
76                    <delete failonerror="false" file="${FILE.JAR.ZIP}"/>
77                    <zip basedir="." destfile="${FILE.JAR.ZIP}">
78                            <filename name="${FILE.JAR}"/>
79                    </zip>
80            </target>
81            
82            <!-- ##############  Create a ZIP from "src" folder  ############## -->
83            <target name="src">
84                    <!-- Create a ZIP from "src" folder -->
85                    <delete failonerror="false" file="${FILE.SRC.ZIP}"/>
86                    <zip destfile="${FILE.SRC.ZIP}" update="false">
87                            <zipfileset dir="${DIR.SRC}" prefix="${ZIP.ROOT.DIR}/${DIR.SRC}">
88                                    <exclude name="schmitzm/test**" />
89                                    <exclude name="**/Thumbs.db" />
90                                    <exclude name="**/.svn" />
91                            </zipfileset>
92                    </zip>
93                    <!-- Add build.xml to ZIP -->
94                    <zip destfile="${FILE.SRC.ZIP}" update="true">
95                            <zipfileset file="build.xml" prefix="${ZIP.ROOT.DIR}"/>
96                    </zip>
97            </target>
98    
99                  <zip basedir="." destfile="schmitzm.jar.zip" >          <!-- ##############  Create a JavaDoc to "javadoc" and ZIP it  ############## -->
100                          <filename name="schmitzm.jar"/>          <target name="javadoc">
101                    <!-- Create a JavaDoc to "javadoc" folder -->
102                    <delete failonerror="false" dir="${DIR.JAVADOC}"/>
103                    <javadoc sourcepath ="${DIR.SRC}"
104                                 destdir    ="${DIR.JAVADOC}"
105                                 author     ="true"
106                                 version    ="true"
107                                 overview   ="${DIR.SRC}/overview.html"
108                                     windowtitle="${JAVADOC.TITLE}"
109                    >
110                            <excludepackage name="schmitzm.test"/>
111                            <link href="${LINK.JDK}"/>
112                            <link href="${LINK.LOG4J}"/>
113                    </javadoc>
114                    <!-- Create a ZIP from "javadoc" folder -->
115                    <delete failonerror="false" file="${FILE.JAVADOC.ZIP}"/>
116                    <zip destfile="${FILE.JAVADOC.ZIP}" update="false">
117                            <zipfileset dir="${DIR.JAVADOC}" prefix="${ZIP.ROOT.DIR}/${DIR.JAVADOC}">
118                                    <exclude name="**/Thumbs.db" />
119                                    <exclude name="**/.svn" />
120                            </zipfileset>
121                  </zip>                  </zip>
122            </target>
123    
124            <target name="nativeToAscii" description="Wandelt alle .properties dateien in src/ in ascii UTF8 um.">
125                    <ac:for xmlns:ac="antlib:net.sf.antcontrib" param="file">
126                            <path>
127                                    <fileset dir="${DIR.SRC}" includes="**/*.properties" />
128                            </path>
129                            <sequential>
130                                    <move file="@{file}" overwrite="true" tofile="@{file}Native" verbose="false"/>
131                            </sequential>
132                    </ac:for>
133                    <native2ascii encoding="ISO8859_15" src="${DIR.SRC}" includes="**/*.propertiesNative" dest="${DIR.SRC}" ext=".properties" />
134                    
135                    <ac:for xmlns:ac="antlib:net.sf.antcontrib" param="file">
136                            <path>
137                                    <fileset dir="${DIR.SRC}" includes="**/*.propertiesNative" />
138                            </path>
139                            <sequential>
140                                    <delete file="@{file}" quiet="true"/>
141                            </sequential>
142                    </ac:for>
143          </target>          </target>
144    
145  </project>  </project>

Legend:
Removed from v.11  
changed lines
  Added in v.686

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26