~ubuntu-branches/ubuntu/quantal/netbeans/quantal

« back to all changes in this revision

Viewing changes to j2ee/blueprints/build.xml

  • Committer: Bazaar Package Importer
  • Author(s): Marek Slama
  • Date: 2008-01-29 14:11:22 UTC
  • Revision ID: james.westby@ubuntu.com-20080129141122-fnzjbo11ntghxfu7
Tags: upstream-6.0.1
ImportĀ upstreamĀ versionĀ 6.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="UTF-8"?>
 
2
<!--
 
3
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
 
4
 
 
5
Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
 
6
 
 
7
 
 
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]"
 
25
 
 
26
Contributor(s):
 
27
 
 
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.
 
31
 
 
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.
 
42
-->
 
43
<project basedir="." default="netbeans" name="j2ee/blueprints">
 
44
 
 
45
    <property file="./nbproject/project.properties"/>
 
46
    <import file="../../nbbuild/templates/projectized.xml"/>
 
47
 
 
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"/>
 
52
    
 
53
    <target name="jar" depends="init,extra-solutions,dd2beansgen,compile,projectized-common.jar"/>
 
54
    
 
55
    <target name="netbeans-extra" depends="release"/>
 
56
    
 
57
    <target name="netbeans-extra-ml" depends="build-localejar" />
 
58
    
 
59
    <target name="build-localejar" depends="init,buildjar-ml,jar-ml,updatejar-ml,clean-ml"
 
60
          description="Builds localized jar"/> 
 
61
          
 
62
    <!-- Define schema2beans task -->
 
63
    <target name="s2binit" depends="build-init">
 
64
        <taskdef name="schema2beans" classname="org.netbeans.modules.s2banttask.Schema2BeansAntTask">
 
65
            <classpath>
 
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"/>
 
69
            </classpath>
 
70
        </taskdef>
 
71
    </target>
 
72
    
 
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"
 
81
          docRoot="nbcatalog"
 
82
          outputType="javabeans"
 
83
          validate="true"
 
84
          attrProp="true"
 
85
          standalone="true"
 
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" />
 
92
    </target>
 
93
    
 
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"/>
 
98
    </target>    
 
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"/>
 
104
    </target>
 
105
    
 
106
    <target name="buildjar-ml">
 
107
      <condition property="locjar.locales" value="${locales}">
 
108
      <and>
 
109
        <isset property="locales" />
 
110
        <not>
 
111
          <isset property="locjar.locales"/>
 
112
        </not>
 
113
      </and>
 
114
      </condition>  
 
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}"/>
 
118
    </target>
 
119
    
 
120
    <target name="setup-one-locale" if="locale">
 
121
        <mkdir dir="${build.locale.dir}"/>
 
122
        <condition property="localejar_exists">
 
123
            <and>
 
124
            <available file="${bp.locale.dir}/external/blueprints-solutions-catalog_${locale}.zip" type="file"/>
 
125
            </and>
 
126
        </condition>
 
127
        <antcall target="unzip-bp-jar"/>
 
128
   </target>
 
129
   
 
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"/>
 
132
   </target>
 
133
   
 
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"/>
 
141
    </target>
 
142
    
 
143
    <target name="updatejar-ml">
 
144
      <condition property="locjar.locales" value="${locales}">
 
145
      <and>
 
146
        <isset property="locales" />
 
147
        <not>
 
148
          <isset property="locjar.locales"/>
 
149
        </not>
 
150
      </and>
 
151
      </condition>  
 
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}"/>
 
155
    </target>
 
156
    
 
157
    <target name="update-one-locale" if="locale">
 
158
        <condition property="update-bp">
 
159
          <and>
 
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"/>
 
162
          </and>
 
163
        </condition>
 
164
        <antcall target="updatejar-ml-images"/>
 
165
    </target>
 
166
    
 
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">
 
172
          <patternset>
 
173
              <include name="**/*.gif"/>
 
174
              <include name="**/*.jpg"/>
 
175
              <include name="**/*.png"/>
 
176
          </patternset>
 
177
      </unzip>
 
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">
 
181
      </jar>
 
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"/>
 
184
    </target>
 
185
    
 
186
    <target name="clean-ml" depends="buildjar-ml,jar-ml,updatejar-ml" description="Cleans temporary stuff for localization">
 
187
        <delete>
 
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*"/>
 
191
            </fileset>
 
192
        </delete>
 
193
        <delete dir="${bp.locale.dir}/src/org/netbeans/modules/j2ee/blueprints/catalog"/>
 
194
    </target>
 
195
</project>