summaryrefslogtreecommitdiff
path: root/core/build/build.xml
blob: da1f27ef5f526f84f04308296f100168bbcbc94a (plain)
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
<?xml version="1.0"?>
<!-- ====================================================================== 
 * $RCSfile: build.xml,v $
 *
 * $Revision: 1.9 $
 *
 * last change: $Author: cedricbosdo $ $Date: 2009/04/20 06:16:00 $
 *
 * The Contents of this file are made available subject to the terms of 
 * the GNU Lesser General Public License Version 2.1
 *
 * Sun Microsystems Inc., October, 2000
 *
 *
 * GNU Lesser General Public License Version 2.1
 * =============================================
 * Copyright 2000 by Sun Microsystems, Inc.
 * 901 San Antonio Road, Palo Alto, CA 94303, USA
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License version 2.1, as published by the Free Software Foundation.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 * MA 02111-1307 USA
 * 
 * The Initial Developer of the Original Code is: Sun Microsystems, Inc..
 *
 * Copyright: 2002 by Sun Microsystems, Inc.
 *
 * All Rights Reserved.
 *
 * Contributor(s): Cedric Bosdonnat                                                              
 ====================================================================== -->

<project name="core" default="core.error">
	
	<target name="core.error">
		<fail>Wrong target!
			
			This script should not be executed directly.
			Please, use the one in the build project
		</fail>
	</target>
	
	<target name="init-env">
		<dirname property="core.basedir" file="${ant.file.core}/.."/>
		
		<loadproperties srcfile="${core.basedir}/build/build.properties" />
		
		<property name="core.out.path" value="${core.basedir}/bin/ant" />
		<property name="core.out.classes" value="${core.out.path}/classes"/>
		<property name="core.sources" value="${core.basedir}/source"/>
		
		<path id="core.dependencies.path">
			<path refid="office.class.path"/>

			<fileset dir="${eclipse.home}/plugins/">
				<include name="org.eclipse*.jar"/>
			</fileset>
		</path>
		
		<mkdir dir="${core.out.path}/features" />
		<mkdir dir="${core.out.path}/plugins" />
		<mkdir dir="${core.out.classes}" />
	</target>
	
	<target name="purge">
		<dirname property="core.basedir" file="${ant.file.core}/.."/>
		<property name="core.out.path" value="${core.basedir}/bin/ant" />
		<delete dir="${core.out.path}" />
		<delete dir="${core.basedir}/doc/help/html/api" />
	</target>

	
	<target name="site" depends="core.plugin, core.feature">
		<copy file="${core.basedir}/build/site_fragment.xml.in" 
			tofile="${core.out.path}/site_fragment.xml" />
				
		<replace file="${core.out.path}/site_fragment.xml"
			token="@VERSION@" value="${core.plugin.version}" />
	</target>

	
	<target name="core.feature">
		<!-- Replace the @VERSION@ tokens to create the feature.xml file  -->
		<copy file="${core.basedir}/build/feature.xml.in"
			tofile="${core.out.path}/feature.xml" />
		<replace file="${core.out.path}/feature.xml" 
			token="@VERSION@" value="${core.plugin.version}" />
		
		<jar destfile="${core.out.path}/features/${package.prefix}.core_${core.plugin.version}.jar">
			<zipfileset dir="${core.out.path}" prefix="" defaultexcludes="true">
				<include name="feature.xml"/>
			</zipfileset>
		</jar>
		
	</target>

	<target name="core.compile" depends="init-env">
		<javac srcdir="${core.basedir}/source" destdir="${core.out.classes}"
			target="1.5" source="1.5" 
			debug="${debug}"
			classpathref="core.dependencies.path" 
			excludes="**/unittests/**"/>
	</target>
	
	<target name="core.plugin" depends="core.compile, javadocs">
		
		<copy file="${core.basedir}/build/MANIFEST.MF.in"
			tofile="${core.out.path}/MANIFEST.MF" />
		<replace file="${core.out.path}/MANIFEST.MF"
			token="@VERSION@" value="${core.plugin.version}" />
		
		<jar destfile="${core.out.path}/plugins/${package.prefix}.core_${core.plugin.version}.jar"
			manifest="${core.out.path}/MANIFEST.MF">
			
			<zipfileset dir="${core.out.classes}" prefix=""/>
			<zipfileset dir="${core.sources}" prefix="">
				<exclude name="**/*.java"/>
			</zipfileset>
			<zipfileset dir="${core.basedir}/doc" prefix="doc"/>
			<zipfileset dir="${core.basedir}/icons" prefix="icons"/>
			<zipfileset dir="${core.basedir}/schema" prefix="schema"/>
			<zipfileset dir="${core.basedir}" defaultexcludes="true" prefix="">
				<include name="about.*"/>
				<include name="plugin.*"/>
			</zipfileset>
			<zipfileset dir="${core.out.path}" prefix="META-INF" defaultexcludes="true">
				<include name="MANIFEST.MF"/>
			</zipfileset>
		</jar>
	</target>

	<target name="check-javadocs">
		<condition property="javadocs.do">
			<not>
				<uptodate targetfile="${core.out.path}/javadocs-done">
					<srcfiles dir="${core.sources}" defaultexcludes="true">
						<include name="**/*.java"/>
					</srcfiles>
				</uptodate>
			</not>
		</condition>
	</target>
	
	<target name="javadocs" depends="init-env, check-javadocs" if="javadocs.do">
		<echo message="Generate the javadoc API in the doc/html/api folder"/>
		
		<javadoc 
			useexternalfile="true"
			packagenames="org.openoffice.ide.eclipse.core.*"
			classpathref="core.dependencies.path"
			destdir="${core.basedir}/doc/help/html/api">
				
			<packageset dir="${core.basedir}/source">
				<include name="org/openoffice/ide/eclipse/core/**"/>
				<exclude name="**/internal/**"/>
				<exclude name="**/unittests/**"/>
			</packageset>
		</javadoc>
		
		<touch file="${core.out.path}/javadocs-done"/>
	</target>
	
</project>