Skip to content

Commit c3a5440

Browse files
authored
Merge pull request #282 from sid-srini/nb-l10n-remove-disabled-modules
[JVSC-253] Refactor Netbeans localisation build
2 parents ff75be2 + 40c9754 commit c3a5440

21 files changed

+993
-596
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
build/
22
netbeans/
3+
netbeans-l10n/
34
.DS_STORE
45
.idea/
6+
*.iml

build.xml

Lines changed: 38 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
<property name="nb_all" location="netbeans" />
3434
<loadresource property="patch-files-l10n">
3535
<string>
36-
patches/l10n/adding-ja-and-zh_CN.diff
36+
patches/l10n/filter-enabled-clusters-disabled-modules-code-cleanup.diff
37+
patches/l10n/adding-java.lsp.server-ja-and-zh_CN.diff
3738
</string>
3839
<filterchain>
3940
<tokenfilter delimoutput=" ">
@@ -58,7 +59,7 @@
5859
patches/rename-debugger.diff
5960
patches/remove-db.diff
6061
patches/nbjavac-not-required.diff
61-
patches/l10n-liscence.diff
62+
patches/l10n-licence.diff
6263
</string>
6364
<filterchain>
6465
<tokenfilter delimoutput=" ">
@@ -129,27 +130,35 @@
129130
</target>
130131

131132
<property name="netbeans.l10n.dir" location="netbeans-l10n"/>
132-
<property name="javavscode.nbuild.nb.dir" location="netbeans/nbbuild/netbeans"/>
133-
<property name="javavscode.nbcode.extra.dir" location="vscode/nbcode/extra"/>
133+
<property name="nbcode.l10n.dir" location="nbcode/l10n"/>
134+
<property name="vscode.nbcode.extra.dir" location="vscode/nbcode/extra"/>
134135

135-
<target name="build-l10n-ant-text-jar">
136+
<target name="build-l10n-ant-ext-jar">
136137
<ant dir="${netbeans.l10n.dir}/l10nantext" inheritall="false" inheritrefs="false">
137138
<property name="file.reference.ant.jar" value="${ant.home}/lib/ant.jar"/>
138139
</ant>
139140
</target>
140141

141142
<target name="build-l10n">
142-
<ant dir="${netbeans.l10n.dir}/locale_${locale}" target="build" inheritall="false" inheritrefs="false">
143-
<property name="nbplatform.default.harness.dir" location="${javavscode.nbuild.nb.dir}/harness"/>
144-
<property name="nbplatform.default.netbeans.dest.dir" location="${javavscode.nbuild.nb.dir}"/>
143+
<ant dir="${nbcode.l10n.dir}/locale_${locale}" target="build" inheritall="false" inheritrefs="false">
144+
<property name="nbplatform.default.harness.dir" location="${nbplatform.default.harness.dir}"/>
145+
<property name="nbplatform.default.netbeans.dest.dir" location="${nbplatform.default.netbeans.dest.dir}"/>
146+
<property name="netbeans.l10n.dir" location="${netbeans.l10n.dir}"/>
145147
</ant>
146-
<copy todir="${javavscode.nbcode.extra.dir}">
147-
<fileset dir="${netbeans.l10n.dir}/locale_${locale}/build/cluster"/>
148+
<copy todir="${vscode.nbcode.extra.dir}">
149+
<fileset dir="${nbcode.l10n.dir}/locale_${locale}/build/cluster"/>
148150
</copy>
149151
</target>
150152
<target name="clean-l10n">
151-
<delete dir="${netbeans.l10n.dir}/locale_${locale}/build"/>
152-
<delete dir="${netbeans.l10n.dir}/locale_${locale}/release"/>
153+
<delete dir="${nbcode.l10n.dir}/locale_${locale}/build" includeemptydirs="true" quiet="true"/>
154+
<delete dir="${nbcode.l10n.dir}/locale_${locale}/release" includeemptydirs="true" quiet="true"/>
155+
<delete includeemptydirs="true" quiet="true">
156+
<fileset dir="${vscode.nbcode.extra.dir}">
157+
<include name="**/*${locale}.jar"/>
158+
<include name="**/*${locale}.xml"/>
159+
<include name="**/*${locale}.html"/>
160+
</fileset>
161+
</delete>
153162
</target>
154163
<target name="clean-l10n-bundles">
155164
<delete dir="${netbeans.l10n.dir}/l10nantext/build"/>
@@ -162,11 +171,10 @@
162171
</ant>
163172
</target>
164173
<target name="no-l10n">
165-
<property name="javavscode.disablel0n" value="true"/>
174+
<property name="disable.netbeans.l10n" value="true"/>
166175
</target>
167-
<target name="build-l10n-bundles" depends="clean-l10n-bundles,build-l10n-ant-text-jar" description="builds l10n language bundles for vs code extension"
168-
unless="${javavscode.disablel0n}"
169-
>
176+
<target name="build-l10n-bundles" depends="clean-l10n-bundles,build-l10n-ant-ext-jar" description="builds l10n language bundles for vs code extension"
177+
unless="${disable.netbeans.l10n}">
170178
<ant target="build-l10n">
171179
<property name="locale" value="ja" description="japanese"/>
172180
</ant>
@@ -221,10 +229,10 @@
221229
<arg value="--save" />
222230
<arg value="@vscode/[email protected]" />
223231
</exec>
224-
225-
<copy file="${basedir}/LICENSE.txt" todir="${basedir}/vscode" />
226-
<copy file="${basedir}/THIRD_PARTY_LICENSES.txt" todir="${basedir}/vscode" />
227-
232+
233+
<copy file="${basedir}/LICENSE.txt" todir="${basedir}/vscode" />
234+
<copy file="${basedir}/THIRD_PARTY_LICENSES.txt" todir="${basedir}/vscode" />
235+
228236
<exec executable="${build.dir}/vsce/node_modules/.bin/vsce${cmd.suffix}" failonerror="true" dir="${basedir}/vscode">
229237
<arg value="package" />
230238
<arg line="${vsce.extra.args}" />
@@ -234,9 +242,9 @@
234242
<arg value="https://github.com/oracle/javavscode/raw/${metabuild.hash}/vscode" />
235243
<arg value="--out" />
236244
<arg value="${build.dir}/oracle-java-${vsix.version}.vsix" />
237-
</exec>
238-
<delete file="${basedir}/vscode/LICENSE.txt"/>
239-
<delete file="${basedir}/vscode/THIRD_PARTY_LICENSES.txt"/>
245+
</exec>
246+
<delete file="${basedir}/vscode/LICENSE.txt"/>
247+
<delete file="${basedir}/vscode/THIRD_PARTY_LICENSES.txt"/>
240248
</target>
241249
<target name="test-lsp-server" description="Tests the LSP server behavior">
242250
<ant dir="nbcode" target="test" inheritall="false" inheritrefs="false">
@@ -290,7 +298,7 @@
290298
<condition value="true" property="should-apply">
291299
<and>
292300
<istrue value="${has-l10n-patches}"/>
293-
<isfalse value="${javavscode.disablel0n}"/>
301+
<isfalse value="${disable.netbeans.l10n}"/>
294302
</and>
295303
</condition>
296304
<ant target="git-patch">
@@ -308,11 +316,11 @@
308316
import java.util.List;
309317
import java.util.stream.Collectors;
310318
public class Reverse {
311-
public static void main(String[] args) {
312-
List&lt;String> patches = Arrays.asList(args[0].split(" "));
313-
Collections.reverse(patches);
314-
System.out.print(patches.stream().collect(Collectors.joining(" ")));
315-
}
319+
public static void main(String[] args) {
320+
List&lt;String> patches = Arrays.asList(args[0].split(" "));
321+
Collections.reverse(patches);
322+
System.out.print(patches.stream().collect(Collectors.joining(" ")));
323+
}
316324
}
317325
</echo>
318326
<java sourcefile="${build.dir}/Reverse.java"
@@ -339,7 +347,7 @@
339347
<condition value="true" property="should-apply">
340348
<and>
341349
<istrue value="${has-l10n-patches}"/>
342-
<isfalse value="${javavscode.disablel0n}"/>
350+
<isfalse value="${disable.netbeans.l10n}"/>
343351
</and>
344352
</condition>
345353
<ant target="git-un-patch">

nbcode/l10n/locale_ja/build.xml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
Licensed to the Apache Software Foundation (ASF) under one
5+
or more contributor license agreements. See the NOTICE file
6+
distributed with this work for additional information
7+
regarding copyright ownership. The ASF licenses this file
8+
to you under the Apache License, Version 2.0 (the
9+
"License"); you may not use this file except in compliance
10+
with the License. You may obtain a copy of the License at
11+
12+
http://www.apache.org/licenses/LICENSE-2.0
13+
14+
Unless required by applicable law or agreed to in writing,
15+
software distributed under the License is distributed on an
16+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17+
KIND, either express or implied. See the License for the
18+
specific language governing permissions and limitations
19+
under the License.
20+
21+
-->
22+
<project name="org.apache.netbeans.l10n.ja" default="build" basedir=".">
23+
<description>Builds, tests, and runs the project org.apache.netbeans.l10n.ja.</description>
24+
<property name="nbplatform.active" value="default"/>
25+
<property name="netbeans.l10n.dir" location="${nbplatform.default.netbeans.dest.dir}/../../../netbeans-l10n"/>
26+
<property file="${basedir}/../../nbproject/platform.properties" prefix="nbcode."/>
27+
<condition property="cluster.path" value="${nbcode.cluster.path}">
28+
<isset property="nbcode.cluster.path"/>
29+
</condition>
30+
<condition property="disabled.modules" value="${nbcode.disabled.modules}">
31+
<isset property="nbcode.disabled.modules"/>
32+
</condition>
33+
<import file="nbproject/build-impl.xml"/>
34+
35+
<target name="build" depends="build-language-jars,projectized-common.build"/>
36+
37+
<target name="build-language-jars" depends="build-init">
38+
<property name="locale" value="ja"/>
39+
<property name="dist.dir" location="${netbeans.l10n.dir}/netbeans-l10n-zip/src/${locale}"/>
40+
<property name="nbms.dist.dir" location="nbms"/>
41+
<property name="nbms.dir" location="${netbeans.l10n.dir}/nbbuild/${nbms.dist.dir}"/>
42+
<property name="keystore" location=""/>
43+
<property name="storepass" value=""/>
44+
<property name="nbm_alias" value="nb_ide"/>
45+
46+
<taskdef name="packageBuild" classname="org.netbeans.l10n.Package">
47+
<classpath>
48+
<pathelement path="${netbeans.l10n.dir}/l10nantext/dist/l10nantext.jar"/>
49+
</classpath>
50+
</taskdef>
51+
<packageBuild src="${dist.dir}" locales="${locale}" dist="release/modules/locale" nbms="${nbms.dir}" nbmsDist="${nbms.dist.dir}"
52+
enabledClusterPath="${cluster.path}" disabledModules="${disabled.modules}"
53+
keystore="${keystore}" storepass="${storepass}" alias="${nbm_alias}">
54+
<classpath>
55+
<pathelement location="nbantext.jar"/>
56+
<fileset dir="${main.dir}">
57+
<include name="apisupport.harness/external/jsearch*.jar"/>
58+
</fileset>
59+
<fileset dir="${nbplatform.default.netbeans.dest.dir}">
60+
<include name="harness/jsearch*.jar"/>
61+
</fileset>
62+
</classpath>
63+
</packageBuild>
64+
<!--<repeat target="copy-docs-for-locale" name="one.locale" values="${locales}"/>-->
65+
</target>
66+
67+
</project>

nbcode/l10n/locale_ja/manifest.mf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Manifest-Version: 1.0
2+
AutoUpdate-Show-In-Client: true
3+
OpenIDE-Module: org.apache.netbeans.l10n.ja
4+
OpenIDE-Module-Localizing-Bundle: org/apache/netbeans/l10n/ja/Bundle.properties
5+
OpenIDE-Module-Specification-Version: 0.0.1
6+
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
*** GENERATED FROM project.xml - DO NOT EDIT ***
4+
*** EDIT ../build.xml INSTEAD ***
5+
-->
6+
<project name="org.apache.netbeans.l10n.ja-impl" basedir="..">
7+
<fail message="Please build using Ant 1.7.1 or higher.">
8+
<condition>
9+
<not>
10+
<antversion atleast="1.7.1"/>
11+
</not>
12+
</condition>
13+
</fail>
14+
<property file="nbproject/platform.properties"/>
15+
<macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-project/2">
16+
<attribute name="name"/>
17+
<attribute name="value"/>
18+
<sequential>
19+
<property name="@{name}" value="${@{value}}"/>
20+
</sequential>
21+
</macrodef>
22+
<macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-project/2">
23+
<attribute name="property"/>
24+
<attribute name="value"/>
25+
<sequential>
26+
<property name="@{property}" value="@{value}"/>
27+
</sequential>
28+
</macrodef>
29+
<property file="${user.properties.file}"/>
30+
<nbmproject2:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
31+
<nbmproject2:property name="nbplatform.active.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
32+
<nbmproject2:evalprops property="cluster.path.evaluated" value="${cluster.path}" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
33+
<fail message="Path to 'platform' cluster missing in $${cluster.path} property or using corrupt Netbeans Platform (missing harness).">
34+
<condition>
35+
<not>
36+
<contains string="${cluster.path.evaluated}" substring="platform"/>
37+
</not>
38+
</condition>
39+
</fail>
40+
<import file="${harness.dir}/build.xml"/>
41+
</project>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
cluster.path=\
18+
${nbplatform.active.dir}/extide${path.separator}\
19+
${nbplatform.active.dir}/harness${path.separator}\
20+
${nbplatform.active.dir}/ide${path.separator}\
21+
${nbplatform.active.dir}/java${path.separator}\
22+
${nbplatform.active.dir}/nb${path.separator}\
23+
${nbplatform.active.dir}/platform${path.separator}\
24+
${nbplatform.active.dir}/webcommon
25+
26+
nbplatform.active=default
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
javac.release=17
18+
javac.compilerargs=-Xlint -Xlint:-serial
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
Licensed to the Apache Software Foundation (ASF) under one
5+
or more contributor license agreements. See the NOTICE file
6+
distributed with this work for additional information
7+
regarding copyright ownership. The ASF licenses this file
8+
to you under the Apache License, Version 2.0 (the
9+
"License"); you may not use this file except in compliance
10+
with the License. You may obtain a copy of the License at
11+
12+
http://www.apache.org/licenses/LICENSE-2.0
13+
14+
Unless required by applicable law or agreed to in writing,
15+
software distributed under the License is distributed on an
16+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17+
KIND, either express or implied. See the License for the
18+
specific language governing permissions and limitations
19+
under the License.
20+
21+
-->
22+
<project xmlns="http://www.netbeans.org/ns/project/1">
23+
<type>org.netbeans.modules.apisupport.project</type>
24+
<configuration>
25+
<data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
26+
<code-name-base>org.apache.netbeans.l10n.ja</code-name-base>
27+
<standalone/>
28+
<module-dependencies/>
29+
<public-packages/>
30+
</data>
31+
</configuration>
32+
</project>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
OpenIDE-Module-Name=Japanese

0 commit comments

Comments
 (0)