/[volute]/trunk/projects/theory/snapdm/build_java.xml
ViewVC logotype

Diff of /trunk/projects/theory/snapdm/build_java.xml

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

revision 188 by bourges.laurent, Wed Apr 2 16:23:10 2008 UTC revision 189 by bourges.laurent, Wed Apr 9 16:18:25 2008 UTC
# Line 3  Line 3 
3  -->    -->  
4    
5    
6  <!-- target makeAll : cleans, compiles java code -->  <!-- checks if build is necessary : java source code & libraries -->
7  <target name="makeJava" depends="cleanJava">  <uptodate property="build.base.notRequired">
8    <ant target="compile"/>    <srcfiles dir= "${root}" includes="build.properties"/>
9        <srcfiles dir= "${sources}" includes="**/*"/>
10      <srcfiles dir= "${libs}" includes="**/*.jar"/>
11      <mapper type="merge" to="${dist}/${build.file}"/>
12    </uptodate>  
13    
14    
15    
16    
17    <!-- target makeJava : cleans, compiles java code -->
18    <target name="makeJava" depends="cleanJava, compile">
19    <echo>makeJava : done.</echo>    <echo>makeJava : done.</echo>
20  </target>  </target>
21    
# Line 14  Line 23 
23    
24    
25  <!-- target cleanJava : clean build files -->  <!-- target cleanJava : clean build files -->
26  <target name="cleanJava">  <target name="cleanJava" depends="init, cleanDist">
27    <echo>cleaning directory : ${build} ...</echo>    <echo>cleaning directory : ${build} ...</echo>
28        
29    <delete includeemptydirs="true" verbose="true">    <delete includeemptydirs="true" verbose="true">
# Line 27  Line 36 
36    
37    
38    
39    <!-- target cleanJava : clean build files -->
40    <target name="cleanDist" depends="init" unless="build.base.notRequired">
41  <!-- target run : launches deployed application on Unix environment (bash used) -->    <echo>cleaning directory : ${dist} ...</echo>
 <target name="run" depends="makeJava">  
   <echo>running ${title} ...</echo>  
     
   <exec dir="${root}" executable="bash" failonerror="true">  
     <arg value="-c"/>  
     <arg value="./launch.sh"/>  
   </exec>  
42        
43    <ant target="compileOutput"/>    <delete includeemptydirs="true" verbose="true">
44        <fileset dir="${dist}" includes="**/*"/>
45      </delete>
46        
47    <echo>run ${title} : terminated.</echo>    <echo>cleaned directory : ${dist} : done.</echo>
48  </target>  </target>
49    
50    
51    
52    
53    
54  <!-- Compile java files and jar them -->  <!-- Compile java files and jar them -->
55  <target name="compile" depends="cleanJava">  <target name="compile" depends="cleanJava" unless="build.base.notRequired">
56    <echo>compile ${title} ...</echo>    <echo>compile ${base.title} ...</echo>
57    <echo>compile from : ${sources}</echo>    <echo>compile from : ${sources}</echo>
58    <echo>compile to   : ${build.src}</echo>    <echo>compile to   : ${build.src}</echo>
59        
# Line 69  Line 74 
74      <map from="${root}/" to=""/>      <map from="${root}/" to=""/>
75    </pathconvert>    </pathconvert>
76        
77    <jar jarfile="${root}/${build.file}" compress="true">    <jar jarfile="${dist}/${build.file}" compress="true">
78      <fileset dir="${build.src}" />      <fileset dir="${build.src}" />
79      <fileset file="${sources}/*.properties" />      <fileset file="${sources}/log4j.*" />
     <fileset file="${sources}/*.xml" />  
80            
81      <manifest>      <manifest>
82        <attribute name="Built-By" value="${build.by}"/>        <attribute name="Built-By" value="${build.by}"/>
# Line 80  Line 84 
84                
85        <attribute name="Build-Jdk" value="${java.vm.version}"/>        <attribute name="Build-Jdk" value="${java.vm.version}"/>
86        <attribute name="Build-Os" value="${os.name} ${os.version} - ${os.arch}"/>        <attribute name="Build-Os" value="${os.name} ${os.version} - ${os.arch}"/>
87        <!--              
       <attribute name="Main-Class" value="tools.MappingTool"/>  
 -->        
88        <attribute name="Class-Path" value="${jar.classpath}"/>        <attribute name="Class-Path" value="${jar.classpath}"/>
89                
90        <section name="Common">        <section name="Common">
91          <attribute name="Specification-Title" value="${title}"/>          <attribute name="Specification-Title" value="${base.title}"/>
92          <attribute name="Specification-Version" value="${version}"/>          <attribute name="Specification-Version" value="${version}"/>
93          <attribute name="Specification-Vendor" value="${vendor}"/>          <attribute name="Specification-Vendor" value="${vendor}"/>
94          <attribute name="Implementation-Title" value="${title}"/>          <attribute name="Implementation-Title" value="${base.title}"/>
95          <attribute name="Implementation-Version" value="${version} - ${build.date}"/>          <attribute name="Implementation-Version" value="${version} - ${build.date}"/>
96        </section>                </section>        
97      </manifest>      </manifest>
# Line 98  Line 100 
100        
101    <delete dir="${build.src}"/>    <delete dir="${build.src}"/>
102        
103    <echo>compile ${title} : done.</echo>    <echo>compile ${base.title} : done.</echo>
104    </target>
105    
106    
107    
108    
109    <!-- target makeOutput : compiles generated java code and javadoc -->
110    <target name="makeOutput" depends="compileOutput, makeJavaDoc">
111      <echo>makeOutput : done.</echo>
112  </target>  </target>
113    
114    
# Line 106  Line 116 
116    
117  <!-- Compile generated java files -->  <!-- Compile generated java files -->
118  <target name="compileOutput" depends="compile">  <target name="compileOutput" depends="compile">
119    <echo>compile generated Java classes ...</echo>    <echo>compile ${gen.title} ...</echo>
120    <echo>compile from : ${sources.gen}</echo>    <echo>compile from : ${sources.gen}</echo>
121    <echo>compile to   : ${build.gen}</echo>    <echo>compile to   : ${build.gen}</echo>
122        
# Line 122  Line 132 
132      <include name="**/*.java"/>      <include name="**/*.java"/>
133    </javac>    </javac>
134        
135      <pathconvert pathsep=" " property="jar.gen.classpath">
136        <path refid="infrastructure.class.path"/>
137        <map from="${dist}/" to=""/>
138      </pathconvert>
139      
140      <jar jarfile="${sources.gen.dist}/${build.gen.file}" compress="true">
141        <fileset dir="${build.gen}" />
142        
143        <manifest>
144          <attribute name="Built-By" value="${build.by}"/>
145          <attribute name="Built-Date" value="${build.date}"/>
146          
147          <attribute name="Build-Jdk" value="${java.vm.version}"/>
148          <attribute name="Build-Os" value="${os.name} ${os.version} - ${os.arch}"/>
149          
150          <attribute name="Class-Path" value="${jar.gen.classpath}"/>
151          
152          <section name="Common">
153            <attribute name="Specification-Title" value="${gen.title}"/>
154            <attribute name="Specification-Version" value="${version}"/>
155            <attribute name="Specification-Vendor" value="${vendor}"/>
156            <attribute name="Implementation-Title" value="${gen.title}"/>
157            <attribute name="Implementation-Version" value="${version} - ${build.date}"/>
158          </section>        
159        </manifest>
160        
161      </jar>
162      
163    <!-- remove to avoid classes in svn -->    <!-- remove to avoid classes in svn -->
164    <delete dir="${build.gen}"/>    <delete dir="${build.gen}"/>
165        
166    <echo>compile generated Java classes : done.</echo>    <echo>compile ${gen.title} : done.</echo>
167  </target>  </target>
168    
169    
# Line 139  Line 177 
177        
178    <javadoc  additionalparam="-notimestamp"    <javadoc  additionalparam="-notimestamp"
179              destdir="${sources.gen.docs}"              destdir="${sources.gen.docs}"
180                access="private"
181              author="true"              author="true"
182              use="false"              use="false"
183              windowtitle="${title} ${version}" >              windowtitle="${source} : ${gen.title}" >
184            
185      <classpath refid="infrastructure.class.path"/>      <classpath refid="project.class.path" />
186            
187        <fileset dir="${sources}" defaultexcludes="yes" includes="**/*.java" />
188      <fileset dir="${sources.gen}" defaultexcludes="yes" includes="**/*.java" />      <fileset dir="${sources.gen}" defaultexcludes="yes" includes="**/*.java" />
189            
190    </javadoc>    </javadoc>

Legend:
Removed from v.188  
changed lines
  Added in v.189

msdemlei@ari.uni-heidelberg.de
ViewVC Help
Powered by ViewVC 1.1.26