File: build.xml

package info (click to toggle)
libjena-iri-java 0.8-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 1,588 kB
  • ctags: 1,154
  • sloc: xml: 11,152; java: 10,457; perl: 142; sh: 26; makefile: 3
file content (231 lines) | stat: -rw-r--r-- 7,891 bytes parent folder | download
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
<?xml version="1.0"?>
<!-- build file for Jena iri package -->
<!-- IRI library released via Maven -->
<project name="iri" default="build" basedir=".">

  <!-- default value useful in Jeremy's development environment -->
  <property name="dist.name" value="iri-SNAPSHOT"/>

  <property name="lib.dir" value="lib/"/>
  <property name="src.dir" value="src/"/>
  <property name="doc.dir" value="doc/"/>
  <property name="javadoc.dir" value="${doc.dir}/javadoc"/>
  <property name="dist.root" value="dist/"/>
  <property name="zipfile" value="${dist.name}.zip"/>
  <property name="dist.dir" value="${dist.root}/${dist.name}"/>
  <property name="mirror.dir" value="mirror/"/>
  <property name="build.dir" value="bin-build"/>
  <property name="webdoc.dest.dir" value="iri/"/>
  <property name="otherpages.dest.dir" value="/home/groups/j/je/jena/OtherPages/"/>
  <property name="website.dest.dir" value="/home/groups/j/je/jena/htdocs/"/>
  
  <path id="classpath">
<!--    <fileset dir="${lib.dir}" includes="*.jar"/>-->
    <pathelement location="/usr/share/java/JFlex.jar"/>
    <pathelement location="/usr/share/java/junit4.jar"/>
    <pathelement location="/usr/share/java/icu4j.jar"/>

  </path>

  <target name="init" depends="clean, default-javac-flags">
    <mkdir dir="${build.dir}"/>
    <mkdir dir="${javadoc.dir}"/>
  </target>

  <target name="clean.javadoc" >
    <mkdir dir="${javadoc.dir}"/>
    <delete><fileset dir="${javadoc.dir}" includes="**"/></delete>
  </target>

  <target name="clean" depends="clean.javadoc">
    <delete dir="${build.dir}"/>
    <delete dir="${dist.root}"/>
  </target>

  <target name="build" depends="init, compile, jar"/>

  <target name="compile">
    <javac 
     srcdir="${src.dir}" 
     destdir="${build.dir}"
     debug="${java.debug}"
     debuglevel="${java.debuglevel}"
     deprecation="${java.deprecation}"
     optimize="${java.optimize}"
     source="${java.source}"
     target="${java.target}" 
     classpathref="classpath"/>
  </target>
  <target name="optimise-javac-flags"
          description="Set the javac flags that will produce an optmised jar with no debug symbols" >
    <property name="java.debug"       value="false"/>
    <property name="java.debuglevel"  value=""/>
    <property name="java.deprecation" value="false"/>
    <property name="java.optimize"    value="true"/>
    <property name="java.source"      value="1.5"/>
    <property name="java.target"      value="1.5"/>
  </target>

  <target name="default-javac-flags"
          description="Set the javac flags that will produce an debug jar with no compiler optimisation and all debug symbols" >
    <!-- Note that in ant, if these flags are already set setting them again has no effect -->
    <property name="java.debug"       value="true"/>
    <property name="java.debuglevel"  value="source,lines,vars"/>
    <property name="java.deprecation" value="false"/>
    <property name="java.optimize"    value="false"/>
    <property name="java.source"      value="1.5"/>
    <property name="java.target"      value="1.5"/>
  </target>

  <target name="jar">
    <jar jarfile="${lib.dir}/iri.jar" basedir="${build.dir}">
    </jar>
  </target>

  <target name="javadoc" depends="init">
    <javadoc
     sourcepath="${src.dir}"
     destdir="${javadoc.dir}"
     packagenames="com.hp.hpl.jena.iri"
     classpathref="classpath"
     />
  </target>

  
  <target name="dist" depends="init, build, jar, javadoc">
    <mkdir dir="${dist.root}"/>
    <mkdir dir="${dist.dir}"/>
    <mkdir dir="${dist.dir}/lib"/>
    <copy todir="${dist.dir}" file="dependencies.txt"/>
    <copy todir="${dist.dir}" file="RELEASE_NOTES.txt"/>
    <copy todir="${dist.dir}" file="build.xml"/>

    <copy todir="${dist.dir}" file="copyright.txt"/>
    
    <copy todir="${dist.dir}/src">
      <fileset dir="${src.dir}" includes="**"/>
    </copy>
    <copy todir="${dist.dir}/doc">
      <fileset dir="${doc.dir}" includes="**"/>
    </copy>
    <copy todir="${dist.dir}/lib" file="${lib.dir}/iri.jar"/>
    
    <zip zipfile="${zipfile}">
      <fileset dir="${dist.root}" includes="${dist.name}/**"/>
    </zip>
  </target>
  <!--
    <taskdef name="scp" classname="org.apache.tools.ant.taskdefs.optional.ssh.Scp"/>
  -->
  <!--
    Getting scp to work under eclipse:
    Either:
    1) Local config
    a) right click on build file
    select Run As => Ant Build ...
    b) select classpath Tab and add com.jcraft.jsch????.jar from
    the eclipse plugin directory (an external jar). It's in 
    the directory at the top-level
    c) select properties tab and add properties as used below
    
    Or:
    2) Global config
    a) Window/Preferences/Ant/Runtime
    b) select classpath tab and add com.jcraft.jsch????.jar from
    the eclipse plugin directory
    c) select properties tab and add properties
    
    sf.user      Source forge user name
    sf.keyfile   Private key file
    sf.pass      Passphrase (in clear text| :( )
    
    
  -->

  <target name="upload" depends="upload-A, upload-B"/>

  <target name="upload-A">
    <scp todir="${sf.user}@shell.sourceforge.net:/home/groups/j/je/jena/htdocs/iri/" >
      <fileset dir="${doc.dir}" includes="*.*"/>
    </scp>
    
  </target>

  <target name="upload-B">
    <scp todir="${sf.user}@shell.sourceforge.net:/home/users/j/je/jeremy_carroll/iri/" 
         passphrase="${sf.pass}" trust="yes"
         keyfile="${sf.keyfile}">
      <fileset dir="${doc.dir}" includes="*.*"/>
    </scp>
  </target>
  
  <target name="ssh-exec-on-sf" if="ssh-command">
    <echo message="ssh ${ssh-command}"/>
    <sshexec host="shell.sourceforge.net"
             username="${sf.user}"
             keyfile="${sf.keyfile}"
             trust="yes"
             passphrase="${sf.pass}" 
             command="${ssh-command}"/>  
  </target>
  
  <target name="copy-to-sf" if="sf.copy.dest.dir">
    <echo message="copying to ${sf.copy.dest.dir}"/>
    <echo message="copying from ${sf.copy.src.dir}"/>
    <antcall target="ssh-exec-on-sf">
      <param name="ssh-command" 
             value="rm -rf ${sf.copy.dest.dir}*"/>
    </antcall>
    <scp todir="${sf.user}@shell.sourceforge.net:${sf.copy.dest.dir}" 
         passphrase="${sf.pass}" trust="yes"
         keyfile="${sf.keyfile}">
      <fileset dir="${sf.copy.src.dir}" >
        <include name="**"/>
        <include name="**/.htacess"/>
        <exclude name="**/produce"/>
        <exclude name="**/merge" />
        <exclude name="**/*.content.html"/>
      </fileset>
    </scp>

    <antcall target="ssh-exec-on-sf">
      <param name="ssh-command" 
             value="chgrp -R jena ${sf.copy.dest.dir}"/>
    </antcall> 
    <antcall target="ssh-exec-on-sf">
      <param name="ssh-command" 
             value="chmod -R g+w ${sf.copy.dest.dir}"/>
    </antcall>
  </target>
  <target name="copy-to-sf-A" if="sf.copy.src.dir">
    <antcall target="copy-to-sf"/>
  </target>
  <target name="copy-to-sf-otherpages-and-web" if="sf.copy.web.path">
    <antcall target="copy-to-sf-A">
      <param name="sf.copy.dest.dir" value="${otherpages.dest.dir}${sf.copy.web.path}"/>
    </antcall> 
    <antcall target="ssh-exec-on-sf">
      <param name="ssh-command" 
             value="rm -rf ${website.dest.dir}${sf.copy.web.path}*"/>
    </antcall> 
    <antcall target="ssh-exec-on-sf">
      <param name="ssh-command" 
             value="cp -pr ${otherpages.dest.dir}${sf.copy.web.path}* ${website.dest.dir}${sf.copy.web.path}"/>
    </antcall> 
  </target>
  <target name="upload-doc">
    <antcall target="copy-to-sf-otherpages-and-web">
      <param name="sf.copy.web.path" value="${webdoc.dest.dir}"/>
      <param name="sf.copy.src.dir" value="${doc.dir}"/>
    </antcall>      
  </target>
  
  <target name="test-ssh">
    <antcall target="ssh-exec-on-sf">
      <param name="ssh-command" 
             value="ls"/>
    </antcall> 
    
  </target>

</project>