Skip to main content
summaryrefslogtreecommitdiffstats
blob: a581610e3eac3a7538141437a884cad820e67fcb (plain) (blame)
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
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright (c) 2012 Oracle. All rights reserved.
  This program and the accompanying materials are made available under the
  terms of the Eclipse Public License v1.0, which accompanies this distribution
  and is available at http://www.eclipse.org/legal/epl-v10.html.

  Contributors:
    Oracle - initial API and implementation
 -->

<project name="JPT Doc ISV Build" default="all"  basedir="." >

	<target name="init">
		<available file="${basedir}/index" property="index.present"/>
		<path location="${basedir}/../../../eclipse/plugins" id="pluginsInstallDir"/>
		<pathconvert property="base.plugins.install.dir" refid="pluginsInstallDir"/>
		<property name="optionsFile" value="jptOptions.tmp.txt" />
		<property name="sourcepathFile" value="jptSourcepath.tmp.properties" />
		<property name="classpathFile" value="jptClasspath.tmp.properties" />
		<property name="packagesFile" value="jptPackages.tmp.properties" />
		<condition property="pathSeparator" value=":">
			<os family="unix" />
		</condition>
		<condition property="pathSeparator" value=";">
			<os family="windows" />
		</condition>

		<delete file="${optionsFile}"/>
		<delete file="${sourcepathFile}"/>
		<delete file="${classpathFile}"/>
		<delete file="${packagesFile}"/>
	</target>

	<target name="all" depends="init" unless="index.present">
		<!-- antcall target="convertSchemaToHtml" /-->
		<antcall target="generateJavadoc" />
		<!-- antcall target="build.index" /-->
		<!-- antcall target="createDocZip" /-->
	</target>

	<target name="build.index" description="Builds search index for the plug-in: org.eclipse.jpt.doc.isv." if="eclipse.running">
		<help.buildHelpIndex manifest="${basedir}/plugin.xml" destination="${basedir}"/>
	</target>

	<target name="getJavadocPath">
		<available file="${java.home}/../bin/javadoc.exe" property="javadoc" value="${java.home}/../bin/javadoc.exe"/>
		<available file="${java.home}/../bin/javadoc" property="javadoc" value="${java.home}/../bin/javadoc" />
	</target>

	<!-- generateJavadoc -->
	<target name="generateJavadoc" depends="getJavadocPath" if="javadoc">
		<echo message="#### jpt.doc.isv #### - java.home = ${java.home}" />
		<echo message="base.plugins.install.dir = ${base.plugins.install.dir}" />

		<copy file="jptOptions.template" tofile="${optionsFile}" overwrite="true" />
		<copy file="jptSourcepath.template" tofile="${sourcepathFile}" overwrite="true" />
		<copy file="jptClasspath.template" tofile="${classpathFile}" overwrite="true" />
		<copy file="jptPackages.template" tofile="${packagesFile}" overwrite="true" />

        <antcall target="addBundle">
            <param name="bundleName" value="jpt.common.utility" />
        </antcall>
        <antcall target="addBundle">
            <param name="bundleName" value="jpt.common.core" />
        </antcall>
        <antcall target="addBundle">
            <param name="bundleName" value="jpt.common.ui" />
        </antcall>
        <antcall target="addBundle">
            <param name="bundleName" value="jpt.jpa.core" />
        </antcall>
        <antcall target="addBundle">
            <param name="bundleName" value="jpt.jpa.db" />
        </antcall>
        <antcall target="addBundle">
            <param name="bundleName" value="jpt.jpa.ui" />
        </antcall>
        <antcall target="addBundle">
            <param name="bundleName" value="jpt.jpa.eclipselink.core" />
        </antcall>
        <antcall target="addBundle">
            <param name="bundleName" value="jpt.jpa.eclipselink.core.ddlgen" />
        </antcall>
        <antcall target="addBundle">
            <param name="bundleName" value="jpt.jaxb.core" />
        </antcall>
        <antcall target="addBundle">
            <param name="bundleName" value="jpt.jaxb.core.schemagen" />
        </antcall>
        <antcall target="addBundle">
            <param name="bundleName" value="jpt.jaxb.ui" />
        </antcall>
        <antcall target="addBundle">
            <param name="bundleName" value="jpt.jaxb.eclipselink.core" />
        </antcall>
        <antcall target="addBundle">
            <param name="bundleName" value="jpt.jaxb.eclipselink.core.schemagen" />
        </antcall>
        <antcall target="addBundle">
            <param name="bundleName" value="jpt.dbws.eclipselink.core.gen" />
        </antcall>

        <antcall target="replaceRtToken" />
        <antcall target="replaceJptRtToken" />
        <antcall target="replaceWtpRtToken" />
        <antcall target="replaceJptSourcepathToken" />
        <antcall target="replacePackagesToken" />

		<replaceregexp file="${basedir}/${optionsFile}" flags="g" match=";" replace="${pathSeparator}" />

		<!--scrub isv plugin directories of any preexisting doc content-->
		<delete dir="index-files"/>
		<delete dir="org"/>
		<delete dir="resources"/>

		<exec dir="." executable="${javadoc}" output="doc.bin.log">
			<arg line="@${basedir}/${optionsFile} -J-Xmx1000M" />
		</exec>
	</target>

	<!-- replaceRtToken -->
	<target name="replaceRtToken" if="optionsFile" >
		<fileset id="jreJars" dir="${java.home}/lib">
		    <include name="*.jar" />
		</fileset>
		<pathconvert pathsep="${pathSeparator}" property="jreClasspath" refid="jreJars"/>
		<replace file="${basedir}/${optionsFile}" token="@rt@" value="${jreClasspath}" />
	</target>

	<!-- replaceWtpRtToken -->
	<target name="replaceWtpRtToken" if="optionsFile" >
		<fileset id="wtpJars" dir="${base.plugins.install.dir}">
		    <include name="*.jar" />
		</fileset>
		<pathconvert pathsep="${pathSeparator}" property="wtpClasspath" refid="wtpJars"/>
		<replace file="${basedir}/${optionsFile}" token="@wtprt@" value="${wtpClasspath}" />
	</target>

	<!-- replaceJptRtToken -->
	<target name="replaceJptRtToken" if="optionsFile" >
		<property file="${classpathFile}" />
		<replace file="${basedir}/${optionsFile}" token="@jptrt@" value="${jptClasspath}" />
	</target>

	<!-- replaceJptSourcepathToken -->
	<target name="replaceJptSourcepathToken" if="optionsFile" >
		<property file="${sourcepathFile}" />
		<replace file="${basedir}/${optionsFile}" token="@jptsourcepath@" value="${jptSourcepath}" />
	</target>

	<!-- replacePackagesToken -->
	<target name="replacePackagesToken" if="optionsFile" >
		<property file="${packagesFile}" />
		<replace file="${basedir}/${optionsFile}" token="@jptPackages@" value="${jptPackages}" />
	</target>
	
	<!-- addBundle -->
	<target name="addBundle" if="optionsFile" >
		<echo message="${bundleName}" />
		<property file="${basedir}/${bundleName}.properties" />
		<echo file="${sourcepathFile}" message="../org.eclipse.${bundleName}/src;" append="true"/>
		<echo file="${classpathFile}" message="../org.eclipse.${bundleName}/@dot;" append="true"/>
		<echo file="${packagesFile}" message="${jptPackages} " append="true"/>
	</target>

	<target name="buildJptDoc" unless="jpt.index.present">
		<ant antfile="buildDoc.xml" dir="../org.eclipse.jpt.doc.isv" />
	</target>

	<target name="createDocZip">
		<zip zipfile="${basedir}/doc.zip"
		basedir="${basedir}"
		includes="schema.css, book.css, notices.html, about.html, concepts/**, guide/**, tips/**, reference/**, tasks/**, whatsNew/**, images/**"
	/>
	</target>

</project>

Back to the top