blob: 0c5be2060d545452b794e9d6c20911da92e1ac0f [file] [log] [blame]
jgraham58243502006-01-10 16:09:30 +00001<?xml version="1.0" encoding="UTF-8"?>
2<!--
3 *************************************************************************
4 * Copyright (c) 2005 Sybase, Inc. and others.
5 * All rights reserved. This program and the accompanying materials
6 * are made available under the terms of the Eclipse Public License v1.0
7 * which accompanies this distribution, and is available at
8 * http://www.eclipse.org/legal/epl-v10.html
9 *
10 * Contributors:
11 * Sybase, Inc. - initial API and implementation
12 *
13 ***************************************************************************
14 -->
15<project name="org.eclipse.datatools.sqltools.sql" default="build.jars" basedir=".">
16 <import file="../org.eclipse.datatools.build/common_build.xml" optional="true"/>
17 <property name="module.name" value="org.eclipse.datatools.sqltools.sql"/>
18 <property name="basews" value="${ws}"/>
19 <property name="baseos" value="${os}"/>
20 <property name="basearch" value="${arch}"/>
21 <property name="basenl" value="${nl}"/>
22 <property name="eclipse.home" location="."/>
23 <property file="build.properties"/>
24 <!-- JavaDoc settings -->
25 <property name="javadocWindowTitle" value="DTP SQL Development Tools Core SQL Support"/>
26 <property name="javadocDocTitle" value="DTP SQL Development Tools Core SQL Support API (Internal)"/>
27 <property name="javadocPackages" value="org.eclipse.datatools.sqltools.sql.*"/>
28 <property name="javadocFooter" value="&lt;i>Copyright &#169; 2005 Sybase, Inc. and others. All rights reserved. &lt;/i>"/>
29 <!-- Compiler settings. -->
30 <property name="javacFailOnError" value="true"/>
31 <property name="javacDebugInfo" value="on"/>
32 <property name="javacVerbose" value="true"/>
33 <property name="javacSource" value="${javac.source}"/>
34 <property name="javacTarget" value="${javac.target}"/>
35 <property name="compilerArg" value=""/>
36 <path id="path_bootclasspath">
37 <fileset dir="${java.home}/lib">
38 <include name="*.jar"/>
39 </fileset>
40 <fileset dir="${eclipse.home}/plugins">
41 <!-- Include jared plug-ins -->
42 <include name="org.eclipse.core.runtime_*.jar"/>
43 <include name="org.eclipse.osgi_*.jar"/>
44 <include name="org.eclipse.ui_*.jar"/>
45 <include name="org.eclipse.swt_*.jar"/>
46 <include name="org.eclipse.swt.*_*.jar"/>
47 <include name="org.eclipse.jface_*.jar"/>
48 <include name="org.eclipse.core.commands_*.jar"/>
49 <include name="org.eclipse.ui.workbench_*.jar"/>
50 <include name="org.eclipse.jface.text_*.jar"/>
51 <include name="org.eclipse.text_*.jar"/>
52 <include name="org.eclipse.ui.editors_*.jar"/>
53 <include name="org.eclipse.core.filebuffers_*.jar"/>
54 <!-- Include expanded plug-ins -->
55 <include name="org.eclipse.core.runtime_*/org.eclipse.core.runtime_*.jar"/>
56 <include name="org.eclipse.osgi_*/org.eclipse.osgi_*.jar"/>
57 <include name="org.eclipse.ui_*/org.eclipse.ui_*.jar"/>
58 <include name="org.eclipse.swt_*/org.eclipse.swt_*.jar"/>
59 <include name="org.eclipse.swt.*_*/org.eclipse.swt.*_*.jar"/>
60 <include name="org.eclipse.core.commands_*/org.eclipse.core.commands_*.jar"/>
61 <include name="org.eclipse.ui.workbench_*/org.eclipse.ui.workbench_*.jar"/>
62 <include name="org.eclipse.jface_*/org.eclipse.jface_*.jar"/>
63 <include name="org.eclipse.jface.text_*/org.eclipse.jface.text_*.jar"/>
64 <include name="org.eclipse.text_*/org.eclipse.text_*.jar"/>
65 <include name="org.eclipse.ui.editors_*/org.eclipse.ui.editors_*.jar"/>
66 <include name="org.eclipse.core.filebuffers_*/org.eclipse.core.filebuffers_*.jar"/>
67 </fileset>
68 </path>
69 <property name="bootclasspath" refid="path_bootclasspath"/>
70
71 <target name="init" depends="properties">
72 <condition property="pluginTemp" value="${buildTempFolder}/plugins">
73 <isset property="buildTempFolder"/>
74 </condition>
75 <property name="pluginTemp" value="${basedir}"/>
76 <condition property="build.result.folder" value="${pluginTemp}/${module.name}">
77 <isset property="buildTempFolder"/>
78 </condition>
79 <property name="build.result.folder" value="${basedir}"/>
80 <property name="temp.folder" value="${basedir}/temp.folder"/>
81 <property name="plugin.destination" value="${basedir}"/>
82 </target>
83
84 <target name="properties" if="eclipse.running">
85 <property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
86
87 </target>
88
89 <target name="build.update.jar" depends="init" description="Build the plug-in: org.eclipse.datatools.sqltools.sql for an update site.">
90 <delete dir="${temp.folder}"/>
91 <mkdir dir="${temp.folder}"/>
92 <antcall target="build.jars"/>
93 <antcall target="gather.bin.parts">
94 <param name="destination.temp.folder" value="${temp.folder}/"/>
95 </antcall>
96 <zip destfile="${plugin.destination}/${module.name}_${plugin.version}.jar" basedir="${temp.folder}/${module.name}_${plugin.version}" filesonly="false" whenempty="skip" update="false"/>
97 <delete dir="${temp.folder}"/>
98 </target>
99
100 <target name="sqltools.jar" depends="init" unless="sqltools.jar" description="Create jar: org.eclipse.datatools.sqltools.sql sqltools.jar.">
101 <delete dir="${temp.folder}/sqltools.jar.bin"/>
102 <mkdir dir="${temp.folder}/sqltools.jar.bin"/>
103 <!-- compile the source code -->
104 <javac destdir="${temp.folder}/sqltools.jar.bin" failonerror="${javacFailOnError}" verbose="${javacVerbose}" debug="${javacDebugInfo}" includeAntRuntime="no" bootclasspath="${bootclasspath}" source="${javacSource}" target="${javacTarget}" >
105 <compilerarg line="${compilerArg}"/>
106 <classpath refid="path_bootclasspath"/>
107 <src path="src/"/>
108 </javac>
109 <!-- Copy necessary resources -->
110 <copy todir="${temp.folder}/sqltools.jar.bin" failonerror="true" overwrite="false">
111 <fileset dir="src/" excludes="**/*.java, **/package.htm*,null" />
112 </copy>
113 <mkdir dir="${build.result.folder}"/>
114 <jar destfile="${build.result.folder}/sqltools.jar" basedir="${temp.folder}/sqltools.jar.bin"/>
115 <delete dir="${temp.folder}/sqltools.jar.bin"/>
116 </target>
117
118 <target name="sqltoolssrc.zip" depends="init" unless="sqltoolssrc.zip">
119 <mkdir dir="${build.result.folder}"/>
120 <zip destfile="${build.result.folder}/sqltoolssrc.zip" filesonly="false" whenempty="skip" update="false">
121 <fileset dir="src/" includes="**/*.java" />
122 </zip>
123 </target>
124
125 <target name="build.jars" depends="init" description="Build all the jars for the plug-in: org.eclipse.datatools.sqltools.sql.">
126 <available property="sqltools.jar" file="${build.result.folder}/sqltools.jar"/>
127 <antcall target="sqltools.jar"/>
128 </target>
129
130 <target name="build.sources" depends="init">
131 <available property="sqltoolssrc.zip" file="${build.result.folder}/sqltoolssrc.zip"/>
132 <antcall target="sqltoolssrc.zip"/>
133 </target>
134
135 <target name="gather.bin.parts" depends="init" if="destination.temp.folder">
136 <mkdir dir="${destination.temp.folder}/${module.name}_${plugin.version}"/>
137 <copy todir="${destination.temp.folder}/${module.name}_${plugin.version}" failonerror="true" overwrite="false">
138 <fileset dir="${build.result.folder}" includes="sqltools.jar" />
139 </copy>
140 <copy todir="${destination.temp.folder}/${module.name}_${plugin.version}" failonerror="true" overwrite="false">
141 <fileset dir="${basedir}" includes="META-INF/,sqltools.jar,icons/,about.html" />
142 </copy>
143 <copy todir="${destination.temp.folder}/${module.name}_${plugin.version}" failonerror="false" overwrite="false">
144 <fileset dir="${basedir}" includes="sqltoolssrc.zip"/>
145 </copy>
146 </target>
147
148 <target name="build.zips" depends="init">
149 </target>
150
151 <target name="gather.sources" depends="init" if="destination.temp.folder">
152 <mkdir dir="${destination.temp.folder}/${module.name}_${plugin.version}"/>
153 <copy file="${build.result.folder}/sqltoolssrc.zip" todir="${destination.temp.folder}/${module.name}_${plugin.version}" failonerror="false" overwrite="false"/>
154 </target>
155
156 <target name="gather.logs" depends="init" if="destination.temp.folder">
157 <mkdir dir="${destination.temp.folder}/${module.name}_${plugin.version}"/>
158 <copy file="${temp.folder}/sqltools.jar.bin.log" todir="${destination.temp.folder}/${module.name}_${plugin.version}" failonerror="false" overwrite="false"/>
159 </target>
160
161 <target name="clean" depends="init" description="Clean the plug-in: org.eclipse.datatools.sqltools.sql of all the zips, jars and logs created.">
162 <delete file="${build.result.folder}/sqltools.jar"/>
163 <delete file="${build.result.folder}/sqltoolssrc.zip"/>
164 <delete file="${plugin.destination}/${module.name}_${plugin.version}.jar"/>
165 <delete file="${plugin.destination}/${module.name}_${plugin.version}.zip"/>
166 <delete dir="${temp.folder}"/>
167 </target>
168
169 <target name="refresh" depends="init" if="eclipse.running" description="Refresh this folder.">
170 <eclipse.convertPath fileSystemPath="C:/V3/3.1/eclipse/workspace-dtp/org.eclipse.datatools.sqltools.sql" property="resourcePath"/>
171 <eclipse.refreshLocal resource="${resourcePath}" depth="infinite"/>
172 </target>
173
174 <target name="zip.plugin" depends="init" description="Create a zip containing all the elements for the plug-in: org.eclipse.datatools.sqltools.sql.">
175 <delete dir="${temp.folder}"/>
176 <mkdir dir="${temp.folder}"/>
177 <antcall target="build.jars"/>
178 <antcall target="build.sources"/>
179 <antcall target="gather.bin.parts">
180 <param name="destination.temp.folder" value="${temp.folder}/"/>
181 </antcall>
182 <antcall target="gather.sources">
183 <param name="destination.temp.folder" value="${temp.folder}/"/>
184 </antcall>
185 <delete>
186 <fileset dir="${temp.folder}" includes="**/*.bin.log" />
187 </delete>
188 <zip destfile="${plugin.destination}/${module.name}_${plugin.version}.zip" basedir="${temp.folder}" filesonly="true" whenempty="skip" update="false"/>
189 <delete dir="${temp.folder}"/>
190 </target>
191
192</project>