blob: de9869772e0da940464e15aae5b18696f1495819 [file] [log] [blame]
jgraham58243502006-01-10 16:09:30 +00001<?xml version="1.0" encoding="UTF-8"?>
jgraham58243502006-01-10 16:09:30 +00002<project name="org.eclipse.datatools.sqltools.plan" default="build.jars" basedir=".">
hcao47924b82007-03-21 00:00:19 +00003 <import file="../org.eclipse.datatools.build/common_build.xml" optional="true"/>
4 <property name="module.name" value="org.eclipse.datatools.sqltools.plan"/>
jgraham58243502006-01-10 16:09:30 +00005 <property name="basews" value="${ws}"/>
6 <property name="baseos" value="${os}"/>
7 <property name="basearch" value="${arch}"/>
8 <property name="basenl" value="${nl}"/>
hcao47924b82007-03-21 00:00:19 +00009 <property file="build.properties"/>
jgraham58243502006-01-10 16:09:30 +000010 <!-- Compiler settings. -->
hcao6fb76d72006-10-20 07:01:43 +000011 <property name="javacFailOnError" value="true"/>
jgraham58243502006-01-10 16:09:30 +000012 <property name="javacDebugInfo" value="on"/>
jgraham6b0683a2006-04-10 20:05:38 +000013 <property name="javacVerbose" value="false"/>
14 <property name="logExtension" value=".log"/>
jgraham58243502006-01-10 16:09:30 +000015 <property name="compilerArg" value=""/>
jgraham6b0683a2006-04-10 20:05:38 +000016 <property name="javacSource" value="1.3"/>
17 <property name="javacTarget" value="1.2"/>
jgraham58243502006-01-10 16:09:30 +000018 <path id="path_bootclasspath">
19 <fileset dir="${java.home}/lib">
20 <include name="*.jar"/>
21 </fileset>
jgraham58243502006-01-10 16:09:30 +000022 </path>
23 <property name="bootclasspath" refid="path_bootclasspath"/>
jgraham6b0683a2006-04-10 20:05:38 +000024 <property name="bundleJavacSource" value="${javacSource}"/>
25 <property name="bundleJavacTarget" value="${javacTarget}"/>
26 <property name="bundleBootClasspath" value="${bootclasspath}"/>
jgraham58243502006-01-10 16:09:30 +000027
28 <target name="init" depends="properties">
29 <condition property="pluginTemp" value="${buildTempFolder}/plugins">
30 <isset property="buildTempFolder"/>
31 </condition>
32 <property name="pluginTemp" value="${basedir}"/>
jgraham6b0683a2006-04-10 20:05:38 +000033 <condition property="build.result.folder" value="${pluginTemp}/org.eclipse.datatools.sqltools.plan">
jgraham58243502006-01-10 16:09:30 +000034 <isset property="buildTempFolder"/>
35 </condition>
36 <property name="build.result.folder" value="${basedir}"/>
37 <property name="temp.folder" value="${basedir}/temp.folder"/>
38 <property name="plugin.destination" value="${basedir}"/>
39 </target>
40
41 <target name="properties" if="eclipse.running">
42 <property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
43
44 </target>
45
46 <target name="build.update.jar" depends="init" description="Build the plug-in: org.eclipse.datatools.sqltools.plan for an update site.">
47 <delete dir="${temp.folder}"/>
48 <mkdir dir="${temp.folder}"/>
49 <antcall target="build.jars"/>
50 <antcall target="gather.bin.parts">
51 <param name="destination.temp.folder" value="${temp.folder}/"/>
52 </antcall>
hcao47924b82007-03-21 00:00:19 +000053 <zip destfile="${plugin.destination}/${module.name}_${plugin.version}.jar" basedir="${temp.folder}/${module.name}_${plugin.version}" filesonly="false" whenempty="skip" update="false"/>
jgraham58243502006-01-10 16:09:30 +000054 <delete dir="${temp.folder}"/>
hcao6fb76d72006-10-20 07:01:43 +000055 <delete dir="${build.result.folder}/@dot"/>
jgraham58243502006-01-10 16:09:30 +000056 </target>
57
jgraham6b0683a2006-04-10 20:05:38 +000058 <target name="@dot" depends="init" unless="@dot" description="Create jar: org.eclipse.datatools.sqltools.plan @dot.">
59 <delete dir="${temp.folder}/@dot.bin"/>
60 <mkdir dir="${temp.folder}/@dot.bin"/>
61 <path id="@dot.classpath">
hcao6fb76d72006-10-20 07:01:43 +000062 <fileset dir="${eclipse.home}/plugins">
63 <include name="com.ibm.icu*.jar"/>
64 <include name="org.eclipse.core.*.jar"/>
65 <include name="org.eclipse.equinox.*.jar"/>
66 <include name="org.eclipse.ui.*.jar"/>
67 <include name="org.eclipse.swt.*.jar"/>
68 <include name="org.eclipse.jface*.jar"/>
69 <include name="org.eclipse.text*.jar"/>
70 <include name="org.junit_*.jar"/>
71 <include name="org.eclipse.osgi*.jar"/>
72 <include name="org.eclipse.update.ui.forms_*.jar"/>
73 <include name="org.eclipse.search_*.jar"/>
74 <include name="org.eclipse.debug.*.jar"/>
75 <include name="org.eclipse.emf.common*.jar"/>
76 <include name="org.eclipse.emf.ecore*.jar"/>
77 <include name="org.eclipse.draw2d*.jar"/>
hcaoec17d8f2007-09-06 13:23:26 +000078 <include name="org.eclipse.help*.jar"/>
hcao6fb76d72006-10-20 07:01:43 +000079 </fileset>
80 <!--The generated dtp plugins-->
81 <fileset dir="${plugin.destination}">
82 <include name="org.eclipse.datatools*/*.jar"/>
83 <include name="*.jar"/>
84 </fileset>
85
jgraham6b0683a2006-04-10 20:05:38 +000086 </path>
jgraham58243502006-01-10 16:09:30 +000087 <!-- compile the source code -->
jgraham6b0683a2006-04-10 20:05:38 +000088 <javac destdir="${temp.folder}/@dot.bin" failonerror="${javacFailOnError}" verbose="${javacVerbose}" debug="${javacDebugInfo}" includeAntRuntime="no" bootclasspath="${bundleBootClasspath}" source="${bundleJavacSource}" target="${bundleJavacTarget}" >
jgraham58243502006-01-10 16:09:30 +000089 <compilerarg line="${compilerArg}"/>
jgraham6b0683a2006-04-10 20:05:38 +000090 <classpath refid="@dot.classpath" />
91 <src path="src/" />
92 <compilerarg value="@${basedir}/javaCompiler...args" compiler="org.eclipse.jdt.core.JDTCompilerAdapter"/>
93 <compilerarg line="-log '${temp.folder}/@dot.bin${logExtension}'" compiler="org.eclipse.jdt.core.JDTCompilerAdapter"/>
94 </javac>
jgraham58243502006-01-10 16:09:30 +000095 <!-- Copy necessary resources -->
jgraham6b0683a2006-04-10 20:05:38 +000096 <copy todir="${temp.folder}/@dot.bin" failonerror="true" overwrite="false">
97 <fileset dir="src/" excludes="**/*.java, **/package.htm*" />
jgraham58243502006-01-10 16:09:30 +000098 </copy>
99 <mkdir dir="${build.result.folder}"/>
jgraham6b0683a2006-04-10 20:05:38 +0000100 <copy todir="${build.result.folder}/@dot" failonerror="true" overwrite="false">
101 <fileset dir="${temp.folder}/@dot.bin" />
102 </copy>
103 <delete dir="${temp.folder}/@dot.bin"/>
jgraham58243502006-01-10 16:09:30 +0000104 </target>
105
jgraham6b0683a2006-04-10 20:05:38 +0000106 <target name="src.zip" depends="init" unless="src.zip">
jgraham58243502006-01-10 16:09:30 +0000107 <mkdir dir="${build.result.folder}"/>
jgraham6b0683a2006-04-10 20:05:38 +0000108 <zip destfile="${build.result.folder}/src.zip" filesonly="false" whenempty="skip" update="false">
jgraham58243502006-01-10 16:09:30 +0000109 <fileset dir="src/" includes="**/*.java" />
110 </zip>
111 </target>
112
113 <target name="build.jars" depends="init" description="Build all the jars for the plug-in: org.eclipse.datatools.sqltools.plan.">
jgraham6b0683a2006-04-10 20:05:38 +0000114 <available property="@dot" file="${build.result.folder}/@dot"/>
115 <antcall target="@dot"/>
jgraham58243502006-01-10 16:09:30 +0000116 </target>
117
118 <target name="build.sources" depends="init">
jgraham6b0683a2006-04-10 20:05:38 +0000119 <available property="src.zip" file="${build.result.folder}/src.zip"/>
120 <antcall target="src.zip"/>
jgraham58243502006-01-10 16:09:30 +0000121 </target>
122
123 <target name="gather.bin.parts" depends="init" if="destination.temp.folder">
hcao47924b82007-03-21 00:00:19 +0000124 <mkdir dir="${destination.temp.folder}/${module.name}_${plugin.version}"/>
125 <copy todir="${destination.temp.folder}/${module.name}_${plugin.version}" failonerror="true" overwrite="false">
jgraham6b0683a2006-04-10 20:05:38 +0000126 <fileset dir="${build.result.folder}/@dot" includes="**" />
jgraham58243502006-01-10 16:09:30 +0000127 </copy>
hcao47924b82007-03-21 00:00:19 +0000128 <copy todir="${destination.temp.folder}/${module.name}_${plugin.version}" failonerror="true" overwrite="false">
jgraham6b0683a2006-04-10 20:05:38 +0000129 <fileset dir="${basedir}" includes="META-INF/,plugin.xml,about.html,schema/,icons/,plugin.properties" />
jgraham58243502006-01-10 16:09:30 +0000130 </copy>
131 </target>
132
133 <target name="build.zips" depends="init">
134 </target>
135
hcao6fb76d72006-10-20 07:01:43 +0000136 <target name="gather.sources" depends="init,build.sources" if="destination.temp.folder">
hcao47924b82007-03-21 00:00:19 +0000137 <mkdir dir="${destination.temp.folder}/${module.name}_${plugin.version}"/>
138 <copy file="${build.result.folder}/src.zip" todir="${destination.temp.folder}/${module.name}_${plugin.version}" failonerror="false" overwrite="false"/>
jgraham58243502006-01-10 16:09:30 +0000139 </target>
140
141 <target name="gather.logs" depends="init" if="destination.temp.folder">
hcao47924b82007-03-21 00:00:19 +0000142 <mkdir dir="${destination.temp.folder}/${module.name}_${plugin.version}"/>
143 <copy file="${temp.folder}/@dot.bin${logExtension}" todir="${destination.temp.folder}/${module.name}_${plugin.version}" failonerror="false" overwrite="false"/>
jgraham58243502006-01-10 16:09:30 +0000144 </target>
145
146 <target name="clean" depends="init" description="Clean the plug-in: org.eclipse.datatools.sqltools.plan of all the zips, jars and logs created.">
jgraham6b0683a2006-04-10 20:05:38 +0000147 <delete dir="${build.result.folder}/@dot"/>
148 <delete file="${build.result.folder}/src.zip"/>
hcao47924b82007-03-21 00:00:19 +0000149 <delete file="${plugin.destination}/${module.name}_${plugin.version}.jar"/>
150 <delete file="${plugin.destination}/${module.name}_${plugin.version}.zip"/>
jgraham58243502006-01-10 16:09:30 +0000151 <delete dir="${temp.folder}"/>
152 </target>
153
154 <target name="refresh" depends="init" if="eclipse.running" description="Refresh this folder.">
jgraham6b0683a2006-04-10 20:05:38 +0000155 <eclipse.convertPath fileSystemPath="C:/V3/3.2M6-dev/eclipse/workspace/org.eclipse.datatools.sqltools.plan" property="resourcePath"/>
jgraham58243502006-01-10 16:09:30 +0000156 <eclipse.refreshLocal resource="${resourcePath}" depth="infinite"/>
157 </target>
158
159 <target name="zip.plugin" depends="init" description="Create a zip containing all the elements for the plug-in: org.eclipse.datatools.sqltools.plan.">
160 <delete dir="${temp.folder}"/>
161 <mkdir dir="${temp.folder}"/>
162 <antcall target="build.jars"/>
163 <antcall target="build.sources"/>
164 <antcall target="gather.bin.parts">
165 <param name="destination.temp.folder" value="${temp.folder}/"/>
166 </antcall>
167 <antcall target="gather.sources">
168 <param name="destination.temp.folder" value="${temp.folder}/"/>
169 </antcall>
170 <delete>
jgraham6b0683a2006-04-10 20:05:38 +0000171 <fileset dir="${temp.folder}" includes="**/*.bin${logExtension}" />
jgraham58243502006-01-10 16:09:30 +0000172 </delete>
hcao47924b82007-03-21 00:00:19 +0000173 <zip destfile="${plugin.destination}/${module.name}_${plugin.version}.zip" basedir="${temp.folder}" filesonly="true" whenempty="skip" update="false"/>
jgraham58243502006-01-10 16:09:30 +0000174 <delete dir="${temp.folder}"/>
175 </target>
176
177</project>