1
<?xml version="1.0" encoding="UTF-8"?>
3
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
5
Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
8
The contents of this file are subject to the terms of either the GNU
9
General Public License Version 2 only ("GPL") or the Common
10
Development and Distribution License("CDDL") (collectively, the
11
"License"). You may not use this file except in compliance with the
12
License. You can obtain a copy of the License at
13
http://www.netbeans.org/cddl-gplv2.html
14
or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
15
specific language governing permissions and limitations under the
16
License. When distributing the software, include this License Header
17
Notice in each file and include the License file at
18
nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
19
particular file as subject to the "Classpath" exception as provided
20
by Sun in the GPL Version 2 section of the License file that
21
accompanied this code. If applicable, add the following below the
22
License Header, with the fields enclosed by brackets [] replaced by
23
your own identifying information:
24
"Portions Copyrighted [year] [name of copyright owner]"
28
The Original Software is NetBeans. The Initial Developer of the Original
29
Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
30
Microsystems, Inc. All Rights Reserved.
32
If you wish your version of this file to be governed by only the CDDL
33
or only the GPL Version 2, indicate your decision by adding
34
"[Contributor] elects to include this software in this distribution
35
under the [CDDL or GPL Version 2] license." If you do not indicate a
36
single choice of license, a recipient has the option to distribute
37
your version of this file under either the CDDL, the GPL Version 2 or
38
to extend the choice of license to its licensees as provided above.
39
However, if you add GPL Version 2 code and therefore, elected the GPL
40
Version 2 license, then the option applies only if the new code is
41
made subject to such option by the copyright holder.
43
<project basedir="." default="netbeans" name="j2ee/blueprints">
45
<property file="./nbproject/project.properties"/>
46
<import file="../../nbbuild/templates/projectized.xml"/>
48
<property name="extnl" location="../../nbbuild/external"/>
49
<property name="build.gensrc.dir" location="build/gensrc"/>
50
<property name="bp.locale.dir" location="${nb_all}/translatedfiles/src/j2ee/blueprints"/>
51
<property name="build.locale.dir" location="${nb_all}/translatedfiles/src/j2ee/blueprints/src"/>
53
<target name="jar" depends="init,extra-solutions,dd2beansgen,compile,projectized-common.jar"/>
55
<target name="netbeans-extra" depends="release"/>
57
<target name="netbeans-extra-ml" depends="build-localejar" />
59
<target name="build-localejar" depends="init,buildjar-ml,jar-ml,updatejar-ml,clean-ml"
60
description="Builds localized jar"/>
62
<!-- Define schema2beans task -->
63
<target name="s2binit" depends="build-init">
64
<taskdef name="schema2beans" classname="org.netbeans.modules.s2banttask.Schema2BeansAntTask">
66
<pathelement path="${schema2beans/rt.dir}/modules/org-netbeans-modules-schema2beans.jar" />
67
<pathelement path="${nb_all}/schema2beans/dev/schema2beansdev.jar" />
68
<pathelement path="${nb_all}/schema2beans/anttask/s2banttask.jar"/>
73
<!-- Generate schema2beans parser for nbcatalog.xml -->
74
<target name="dd2beansgen" depends="s2binit">
75
<mkdir dir="${build.classes.dir}"/>
76
<property name="bpcatalog_resource_root" location="${build.classes.dir}/org/netbeans/modules/j2ee/blueprints"/>
77
<echo message="Generating parser for nbcatalog.xml" />
78
<mkdir dir="build/gensrc" />
79
<schema2beans schema="${bpcatalog_resource_root}/nbcatalog.dtd"
80
package="org.netbeans.modules.j2ee.blueprints.catalog.bpcatalogxmlparser"
82
outputType="javabeans"
86
rootDir="${build.gensrc.dir}"/>
87
<javac srcdir="${build.gensrc.dir}" destdir="${build.classes.dir}"
88
debug="${build.compiler.debug}"
89
deprecation="${build.compiler.deprecation}"
90
optimize="${build.compiler.optimize}"
91
source="1.4" includeantruntime="false" />
94
<!-- Unzip blueprints-solutions-catalog.zip into build -->
95
<target name="extra-solutions">
96
<property name="examples" location="${build.classes.dir}/org/netbeans/modules/j2ee/blueprints"/>
97
<unzip dest="${examples}" src="external/blueprints-solutions-catalog.zip"/>
99
<!-- Unzip blueprints library jars into netbeans/extra -->
100
<target name="release" depends="init, extra-solutions">
101
<mkdir dir="${cluster}/modules/ext/blueprints"/>
102
<property name="bp-lib-dir" location="${cluster}/modules/ext/blueprints"/>
103
<unzip dest="${bp-lib-dir}" src="${build.classes.dir}/org/netbeans/modules/j2ee/blueprints/lib/blueprints-lib.zip"/>
106
<target name="buildjar-ml">
107
<condition property="locjar.locales" value="${locales}">
109
<isset property="locales" />
111
<isset property="locjar.locales"/>
115
<taskdef name="repeat" classname="org.netbeans.nbbuild.Repeat"
116
classpath="${nb_all}/nbbuild/nbantext.jar"/>
117
<repeat target="setup-one-locale" name="locale" values="${locales}"/>
120
<target name="setup-one-locale" if="locale">
121
<mkdir dir="${build.locale.dir}"/>
122
<condition property="localejar_exists">
124
<available file="${bp.locale.dir}/external/blueprints-solutions-catalog_${locale}.zip" type="file"/>
127
<antcall target="unzip-bp-jar"/>
130
<target name="unzip-bp-jar" if="localejar_exists">
131
<unzip src="${bp.locale.dir}/external/blueprints-solutions-catalog_${locale}.zip" dest="${build.locale.dir}/org/netbeans/modules/j2ee/blueprints"/>
134
<target name="jar-ml" depends="buildjar-ml">
135
<taskdef name="locjar"
136
classname="org.netbeans.nbbuild.LocalizedJar"
137
classpath="${nb_all}/nbbuild/nbantext.jar"/>
138
<locjar warnMissingDir="true"
139
basedir="${bp.locale.dir}/src"
140
jarfile="${cluster}/modules/org-netbeans-modules-j2ee-blueprints.jar"/>
143
<target name="updatejar-ml">
144
<condition property="locjar.locales" value="${locales}">
146
<isset property="locales" />
148
<isset property="locjar.locales"/>
152
<taskdef name="repeat" classname="org.netbeans.nbbuild.Repeat"
153
classpath="${nb_all}/nbbuild/nbantext.jar"/>
154
<repeat target="update-one-locale" name="locale" values="${locales}"/>
157
<target name="update-one-locale" if="locale">
158
<condition property="update-bp">
160
<available file="${bp.locale.dir}/external/blueprints-solutions-catalog_${locale}.zip" type="file"/>
161
<available file="${cluster}/modules/locale/org-netbeans-modules-j2ee-blueprints_${locale}.jar" type="file"/>
164
<antcall target="updatejar-ml-images"/>
167
<target name="updatejar-ml-images" if="update-bp">
168
<delete dir="${bp.locale.dir}/bp_images/org/netbeans/modules/j2ee/blueprints"/>
169
<mkdir dir="${bp.locale.dir}/bp_images/org/netbeans/modules/j2ee/blueprints"/>
170
<unzip src="${bp.locale.dir}/external/blueprints-solutions-catalog_${locale}.zip"
171
dest="${bp.locale.dir}/bp_images/org/netbeans/modules/j2ee/blueprints">
173
<include name="**/*.gif"/>
174
<include name="**/*.jpg"/>
175
<include name="**/*.png"/>
178
<jar basedir="${bp.locale.dir}/bp_images"
179
destfile="${cluster}/modules/locale/org-netbeans-modules-j2ee-blueprints_${locale}.jar"
180
update="true" duplicate="preserve">
182
<delete dir="${bp.locale.dir}/bp_images"/>
183
<echo message="Created and Updated blueprints jar ${cluster}/modules/locale/org-netbeans-modules-j2ee-blueprints_${locale}.jar"/>
186
<target name="clean-ml" depends="buildjar-ml,jar-ml,updatejar-ml" description="Cleans temporary stuff for localization">
188
<fileset dir="${nb_all}/translatedfiles/src">
189
<include name="j2ee/blueprints/src/org/netbeans/modules/j2ee/blueprints/BundleBpcatalog*"/>
190
<include name="j2ee/blueprints/src/org/netbeans/modules/j2ee/blueprints/BundleGenerated*"/>
193
<delete dir="${bp.locale.dir}/src/org/netbeans/modules/j2ee/blueprints/catalog"/>