diff --git a/.gitignore b/.gitignore index 1d613e2e..24b94cb2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ build/ netbeans/ +netbeans-l10n/ .DS_STORE .idea/ +*.iml diff --git a/build.xml b/build.xml index 1c18d7ce..59b92eea 100644 --- a/build.xml +++ b/build.xml @@ -33,7 +33,8 @@ - patches/l10n/adding-ja-and-zh_CN.diff + patches/l10n/filter-enabled-clusters-disabled-modules-code-cleanup.diff + patches/l10n/adding-java.lsp.server-ja-and-zh_CN.diff @@ -58,7 +59,7 @@ patches/rename-debugger.diff patches/remove-db.diff patches/nbjavac-not-required.diff - patches/l10n-liscence.diff + patches/l10n-licence.diff @@ -129,27 +130,35 @@ - - + + - + - - - + + + + - - + + - - + + + + + + + + + @@ -162,11 +171,10 @@ - + - + @@ -221,10 +229,10 @@ - - - - + + + + @@ -234,9 +242,9 @@ - - - + + + @@ -290,7 +298,7 @@ - + @@ -308,11 +316,11 @@ import java.util.List; import java.util.stream.Collectors; public class Reverse { - public static void main(String[] args) { - List<String> patches = Arrays.asList(args[0].split(" ")); - Collections.reverse(patches); - System.out.print(patches.stream().collect(Collectors.joining(" "))); - } + public static void main(String[] args) { + List<String> patches = Arrays.asList(args[0].split(" ")); + Collections.reverse(patches); + System.out.print(patches.stream().collect(Collectors.joining(" "))); + } } - + diff --git a/nbcode/l10n/locale_ja/build.xml b/nbcode/l10n/locale_ja/build.xml new file mode 100644 index 00000000..382acf90 --- /dev/null +++ b/nbcode/l10n/locale_ja/build.xml @@ -0,0 +1,67 @@ + + + + Builds, tests, and runs the project org.apache.netbeans.l10n.ja. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nbcode/l10n/locale_ja/manifest.mf b/nbcode/l10n/locale_ja/manifest.mf new file mode 100644 index 00000000..3eaceaeb --- /dev/null +++ b/nbcode/l10n/locale_ja/manifest.mf @@ -0,0 +1,6 @@ +Manifest-Version: 1.0 +AutoUpdate-Show-In-Client: true +OpenIDE-Module: org.apache.netbeans.l10n.ja +OpenIDE-Module-Localizing-Bundle: org/apache/netbeans/l10n/ja/Bundle.properties +OpenIDE-Module-Specification-Version: 0.0.1 + diff --git a/nbcode/l10n/locale_ja/nbproject/build-impl.xml b/nbcode/l10n/locale_ja/nbproject/build-impl.xml new file mode 100644 index 00000000..8e084c16 --- /dev/null +++ b/nbcode/l10n/locale_ja/nbproject/build-impl.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nbcode/l10n/locale_ja/nbproject/platform.properties b/nbcode/l10n/locale_ja/nbproject/platform.properties new file mode 100644 index 00000000..7279b716 --- /dev/null +++ b/nbcode/l10n/locale_ja/nbproject/platform.properties @@ -0,0 +1,26 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +cluster.path=\ + ${nbplatform.active.dir}/extide${path.separator}\ + ${nbplatform.active.dir}/harness${path.separator}\ + ${nbplatform.active.dir}/ide${path.separator}\ + ${nbplatform.active.dir}/java${path.separator}\ + ${nbplatform.active.dir}/nb${path.separator}\ + ${nbplatform.active.dir}/platform${path.separator}\ + ${nbplatform.active.dir}/webcommon + +nbplatform.active=default diff --git a/nbcode/l10n/locale_ja/nbproject/project.properties b/nbcode/l10n/locale_ja/nbproject/project.properties new file mode 100644 index 00000000..73811063 --- /dev/null +++ b/nbcode/l10n/locale_ja/nbproject/project.properties @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +javac.release=17 +javac.compilerargs=-Xlint -Xlint:-serial diff --git a/nbcode/l10n/locale_ja/nbproject/project.xml b/nbcode/l10n/locale_ja/nbproject/project.xml new file mode 100644 index 00000000..4e1eb911 --- /dev/null +++ b/nbcode/l10n/locale_ja/nbproject/project.xml @@ -0,0 +1,32 @@ + + + + org.netbeans.modules.apisupport.project + + + org.apache.netbeans.l10n.ja + + + + + + diff --git a/nbcode/l10n/locale_ja/src/org/apache/netbeans/l10n/ja/Bundle.properties b/nbcode/l10n/locale_ja/src/org/apache/netbeans/l10n/ja/Bundle.properties new file mode 100644 index 00000000..b18b59a1 --- /dev/null +++ b/nbcode/l10n/locale_ja/src/org/apache/netbeans/l10n/ja/Bundle.properties @@ -0,0 +1,17 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +OpenIDE-Module-Name=Japanese diff --git a/nbcode/l10n/locale_zh_CN/build.xml b/nbcode/l10n/locale_zh_CN/build.xml new file mode 100644 index 00000000..812064aa --- /dev/null +++ b/nbcode/l10n/locale_zh_CN/build.xml @@ -0,0 +1,67 @@ + + + + Builds, tests, and runs the project org.apache.netbeans.l10n.zh_CN. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nbcode/l10n/locale_zh_CN/manifest.mf b/nbcode/l10n/locale_zh_CN/manifest.mf new file mode 100644 index 00000000..e705996b --- /dev/null +++ b/nbcode/l10n/locale_zh_CN/manifest.mf @@ -0,0 +1,6 @@ +Manifest-Version: 1.0 +AutoUpdate-Show-In-Client: true +OpenIDE-Module: org.apache.netbeans.l10n.zh_CN +OpenIDE-Module-Localizing-Bundle: org/apache/netbeans/l10n/zh_CN/Bundle.properties +OpenIDE-Module-Specification-Version: 0.0.1 + diff --git a/nbcode/l10n/locale_zh_CN/nbproject/build-impl.xml b/nbcode/l10n/locale_zh_CN/nbproject/build-impl.xml new file mode 100644 index 00000000..dc542d5b --- /dev/null +++ b/nbcode/l10n/locale_zh_CN/nbproject/build-impl.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nbcode/l10n/locale_zh_CN/nbproject/platform.properties b/nbcode/l10n/locale_zh_CN/nbproject/platform.properties new file mode 100644 index 00000000..7279b716 --- /dev/null +++ b/nbcode/l10n/locale_zh_CN/nbproject/platform.properties @@ -0,0 +1,26 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +cluster.path=\ + ${nbplatform.active.dir}/extide${path.separator}\ + ${nbplatform.active.dir}/harness${path.separator}\ + ${nbplatform.active.dir}/ide${path.separator}\ + ${nbplatform.active.dir}/java${path.separator}\ + ${nbplatform.active.dir}/nb${path.separator}\ + ${nbplatform.active.dir}/platform${path.separator}\ + ${nbplatform.active.dir}/webcommon + +nbplatform.active=default diff --git a/nbcode/l10n/locale_zh_CN/nbproject/project.properties b/nbcode/l10n/locale_zh_CN/nbproject/project.properties new file mode 100644 index 00000000..73811063 --- /dev/null +++ b/nbcode/l10n/locale_zh_CN/nbproject/project.properties @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +javac.release=17 +javac.compilerargs=-Xlint -Xlint:-serial diff --git a/nbcode/l10n/locale_zh_CN/nbproject/project.xml b/nbcode/l10n/locale_zh_CN/nbproject/project.xml new file mode 100644 index 00000000..eec7b395 --- /dev/null +++ b/nbcode/l10n/locale_zh_CN/nbproject/project.xml @@ -0,0 +1,32 @@ + + + + org.netbeans.modules.apisupport.project + + + org.apache.netbeans.l10n.zh_CN + + + + + + diff --git a/nbcode/l10n/locale_zh_CN/src/org/apache/netbeans/l10n/zh_CN/Bundle.properties b/nbcode/l10n/locale_zh_CN/src/org/apache/netbeans/l10n/zh_CN/Bundle.properties new file mode 100644 index 00000000..744e7e91 --- /dev/null +++ b/nbcode/l10n/locale_zh_CN/src/org/apache/netbeans/l10n/zh_CN/Bundle.properties @@ -0,0 +1,17 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +OpenIDE-Module-Name=Simplified Chinese diff --git a/nbcode/nbproject/platform.properties b/nbcode/nbproject/platform.properties index 47413d6f..44078692 100644 --- a/nbcode/nbproject/platform.properties +++ b/nbcode/nbproject/platform.properties @@ -21,12 +21,12 @@ branding.token=nbcode cluster.path=\ - ${nbplatform.active.dir}/extide:\ - ${nbplatform.active.dir}/harness:\ - ${nbplatform.active.dir}/ide:\ - ${nbplatform.active.dir}/java:\ - ${nbplatform.active.dir}/nb:\ - ${nbplatform.active.dir}/platform:\ + ${nbplatform.active.dir}/extide${path.separator}\ + ${nbplatform.active.dir}/harness${path.separator}\ + ${nbplatform.active.dir}/ide${path.separator}\ + ${nbplatform.active.dir}/java${path.separator}\ + ${nbplatform.active.dir}/nb${path.separator}\ + ${nbplatform.active.dir}/platform${path.separator}\ ${nbplatform.active.dir}/webcommon disabled.modules=\ bcpg,\ diff --git a/patches/l10n-liscence.diff b/patches/l10n-licence.diff similarity index 100% rename from patches/l10n-liscence.diff rename to patches/l10n-licence.diff diff --git a/patches/l10n/adding-ja-and-zh_CN.diff b/patches/l10n/adding-ja-and-zh_CN.diff deleted file mode 100644 index f6356030..00000000 --- a/patches/l10n/adding-ja-and-zh_CN.diff +++ /dev/null @@ -1,560 +0,0 @@ -diff --git a/.gitignore b/.gitignore -index 6f0f29522..f19cedae2 100644 ---- a/.gitignore -+++ b/.gitignore -@@ -9,3 +9,4 @@ - /l10nantext/dist/ - /l10nantext/nbproject/private/ - /l10nantext/nbproject/genfiles.properties -+.idea -diff --git a/locale_ja/build.xml b/locale_ja/build.xml -new file mode 100644 -index 000000000..9fb26158d ---- /dev/null -+++ b/locale_ja/build.xml -@@ -0,0 +1,57 @@ -+ -+ -+ -+ Builds, tests, and runs the project org.apache.netbeans.l10n.ja. -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/locale_ja/manifest.mf b/locale_ja/manifest.mf -new file mode 100644 -index 000000000..3eaceaebe ---- /dev/null -+++ b/locale_ja/manifest.mf -@@ -0,0 +1,6 @@ -+Manifest-Version: 1.0 -+AutoUpdate-Show-In-Client: true -+OpenIDE-Module: org.apache.netbeans.l10n.ja -+OpenIDE-Module-Localizing-Bundle: org/apache/netbeans/l10n/ja/Bundle.properties -+OpenIDE-Module-Specification-Version: 0.0.1 -+ -diff --git a/locale_ja/nbproject/build-impl.xml b/locale_ja/nbproject/build-impl.xml -new file mode 100644 -index 000000000..8e084c16d ---- /dev/null -+++ b/locale_ja/nbproject/build-impl.xml -@@ -0,0 +1,41 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/locale_ja/nbproject/platform.properties b/locale_ja/nbproject/platform.properties -new file mode 100644 -index 000000000..eb5ae3bf6 ---- /dev/null -+++ b/locale_ja/nbproject/platform.properties -@@ -0,0 +1,25 @@ -+# Licensed to the Apache Software Foundation (ASF) under one -+# or more contributor license agreements. See the NOTICE file -+# distributed with this work for additional information -+# regarding copyright ownership. The ASF licenses this file -+# to you under the Apache License, Version 2.0 (the -+# "License"); you may not use this file except in compliance -+# with the License. You may obtain a copy of the License at -+# -+# http://www.apache.org/licenses/LICENSE-2.0 -+# -+# Unless required by applicable law or agreed to in writing, -+# software distributed under the License is distributed on an -+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -+# KIND, either express or implied. See the License for the -+# specific language governing permissions and limitations -+# under the License. -+cluster.path=\ -+ ${nbplatform.active.dir}/extide:\ -+ ${nbplatform.active.dir}/ide:\ -+ ${nbplatform.active.dir}/java:\ -+ ${nbplatform.active.dir}/nb:\ -+ ${nbplatform.active.dir}/platform:\ -+ ${nbplatform.active.dir}/harness:\ -+ ${nbplatform.active.dir}/webcommon -+nbplatform.active=default -\ No newline at end of file -diff --git a/locale_ja/nbproject/project.properties b/locale_ja/nbproject/project.properties -new file mode 100644 -index 000000000..4cdfb33e0 ---- /dev/null -+++ b/locale_ja/nbproject/project.properties -@@ -0,0 +1,18 @@ -+# Licensed to the Apache Software Foundation (ASF) under one -+# or more contributor license agreements. See the NOTICE file -+# distributed with this work for additional information -+# regarding copyright ownership. The ASF licenses this file -+# to you under the Apache License, Version 2.0 (the -+# "License"); you may not use this file except in compliance -+# with the License. You may obtain a copy of the License at -+# -+# http://www.apache.org/licenses/LICENSE-2.0 -+# -+# Unless required by applicable law or agreed to in writing, -+# software distributed under the License is distributed on an -+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -+# KIND, either express or implied. See the License for the -+# specific language governing permissions and limitations -+# under the License. -+javac.source=1.8 -+javac.compilerargs=-Xlint -Xlint:-serial -\ No newline at end of file -diff --git a/locale_ja/nbproject/project.xml b/locale_ja/nbproject/project.xml -new file mode 100644 -index 000000000..4e1eb911f ---- /dev/null -+++ b/locale_ja/nbproject/project.xml -@@ -0,0 +1,32 @@ -+ -+ -+ -+ org.netbeans.modules.apisupport.project -+ -+ -+ org.apache.netbeans.l10n.ja -+ -+ -+ -+ -+ -+ -diff --git a/locale_ja/src/org/apache/netbeans/l10n/ja/Bundle.properties b/locale_ja/src/org/apache/netbeans/l10n/ja/Bundle.properties -new file mode 100644 -index 000000000..b18b59a1c ---- /dev/null -+++ b/locale_ja/src/org/apache/netbeans/l10n/ja/Bundle.properties -@@ -0,0 +1,17 @@ -+# Licensed to the Apache Software Foundation (ASF) under one -+# or more contributor license agreements. See the NOTICE file -+# distributed with this work for additional information -+# regarding copyright ownership. The ASF licenses this file -+# to you under the Apache License, Version 2.0 (the -+# "License"); you may not use this file except in compliance -+# with the License. You may obtain a copy of the License at -+# -+# http://www.apache.org/licenses/LICENSE-2.0 -+# -+# Unless required by applicable law or agreed to in writing, -+# software distributed under the License is distributed on an -+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -+# KIND, either express or implied. See the License for the -+# specific language governing permissions and limitations -+# under the License. -+OpenIDE-Module-Name=Japanese -diff --git a/locale_zh_CN/build.xml b/locale_zh_CN/build.xml -new file mode 100644 -index 000000000..3b5bec0e7 ---- /dev/null -+++ b/locale_zh_CN/build.xml -@@ -0,0 +1,57 @@ -+ -+ -+ -+ Builds, tests, and runs the project org.apache.netbeans.l10n.zh_CN. -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/locale_zh_CN/manifest.mf b/locale_zh_CN/manifest.mf -new file mode 100644 -index 000000000..e705996ba ---- /dev/null -+++ b/locale_zh_CN/manifest.mf -@@ -0,0 +1,6 @@ -+Manifest-Version: 1.0 -+AutoUpdate-Show-In-Client: true -+OpenIDE-Module: org.apache.netbeans.l10n.zh_CN -+OpenIDE-Module-Localizing-Bundle: org/apache/netbeans/l10n/zh_CN/Bundle.properties -+OpenIDE-Module-Specification-Version: 0.0.1 -+ -diff --git a/locale_zh_CN/nbproject/build-impl.xml b/locale_zh_CN/nbproject/build-impl.xml -new file mode 100644 -index 000000000..dc542d5bf ---- /dev/null -+++ b/locale_zh_CN/nbproject/build-impl.xml -@@ -0,0 +1,41 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/locale_zh_CN/nbproject/platform.properties b/locale_zh_CN/nbproject/platform.properties -new file mode 100644 -index 000000000..eb5ae3bf6 ---- /dev/null -+++ b/locale_zh_CN/nbproject/platform.properties -@@ -0,0 +1,25 @@ -+# Licensed to the Apache Software Foundation (ASF) under one -+# or more contributor license agreements. See the NOTICE file -+# distributed with this work for additional information -+# regarding copyright ownership. The ASF licenses this file -+# to you under the Apache License, Version 2.0 (the -+# "License"); you may not use this file except in compliance -+# with the License. You may obtain a copy of the License at -+# -+# http://www.apache.org/licenses/LICENSE-2.0 -+# -+# Unless required by applicable law or agreed to in writing, -+# software distributed under the License is distributed on an -+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -+# KIND, either express or implied. See the License for the -+# specific language governing permissions and limitations -+# under the License. -+cluster.path=\ -+ ${nbplatform.active.dir}/extide:\ -+ ${nbplatform.active.dir}/ide:\ -+ ${nbplatform.active.dir}/java:\ -+ ${nbplatform.active.dir}/nb:\ -+ ${nbplatform.active.dir}/platform:\ -+ ${nbplatform.active.dir}/harness:\ -+ ${nbplatform.active.dir}/webcommon -+nbplatform.active=default -\ No newline at end of file -diff --git a/locale_zh_CN/nbproject/project.properties b/locale_zh_CN/nbproject/project.properties -new file mode 100644 -index 000000000..4cdfb33e0 ---- /dev/null -+++ b/locale_zh_CN/nbproject/project.properties -@@ -0,0 +1,18 @@ -+# Licensed to the Apache Software Foundation (ASF) under one -+# or more contributor license agreements. See the NOTICE file -+# distributed with this work for additional information -+# regarding copyright ownership. The ASF licenses this file -+# to you under the Apache License, Version 2.0 (the -+# "License"); you may not use this file except in compliance -+# with the License. You may obtain a copy of the License at -+# -+# http://www.apache.org/licenses/LICENSE-2.0 -+# -+# Unless required by applicable law or agreed to in writing, -+# software distributed under the License is distributed on an -+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -+# KIND, either express or implied. See the License for the -+# specific language governing permissions and limitations -+# under the License. -+javac.source=1.8 -+javac.compilerargs=-Xlint -Xlint:-serial -\ No newline at end of file -diff --git a/locale_zh_CN/nbproject/project.xml b/locale_zh_CN/nbproject/project.xml -new file mode 100644 -index 000000000..eec7b3954 ---- /dev/null -+++ b/locale_zh_CN/nbproject/project.xml -@@ -0,0 +1,32 @@ -+ -+ -+ -+ org.netbeans.modules.apisupport.project -+ -+ -+ org.apache.netbeans.l10n.zh_CN -+ -+ -+ -+ -+ -+ -diff --git a/locale_zh_CN/src/org/apache/netbeans/l10n/zh_CN/Bundle.properties b/locale_zh_CN/src/org/apache/netbeans/l10n/zh_CN/Bundle.properties -new file mode 100644 -index 000000000..744e7e91e ---- /dev/null -+++ b/locale_zh_CN/src/org/apache/netbeans/l10n/zh_CN/Bundle.properties -@@ -0,0 +1,17 @@ -+# Licensed to the Apache Software Foundation (ASF) under one -+# or more contributor license agreements. See the NOTICE file -+# distributed with this work for additional information -+# regarding copyright ownership. The ASF licenses this file -+# to you under the Apache License, Version 2.0 (the -+# "License"); you may not use this file except in compliance -+# with the License. You may obtain a copy of the License at -+# -+# http://www.apache.org/licenses/LICENSE-2.0 -+# -+# Unless required by applicable law or agreed to in writing, -+# software distributed under the License is distributed on an -+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -+# KIND, either express or implied. See the License for the -+# specific language governing permissions and limitations -+# under the License. -+OpenIDE-Module-Name=Simplified Chinese -diff --git a/netbeans-l10n-zip/src/ja/java/java-lsp-server/java-lsp-server/org/netbeans/modules/java/lsp/server/protocol/Bundle_ja.properties b/netbeans-l10n-zip/src/ja/java/java-lsp-server/java-lsp-server/org/netbeans/modules/java/lsp/server/protocol/Bundle_ja.properties -new file mode 100755 -index 000000000..88b6b4608 ---- /dev/null -+++ b/netbeans-l10n-zip/src/ja/java/java-lsp-server/java-lsp-server/org/netbeans/modules/java/lsp/server/protocol/Bundle_ja.properties -@@ -0,0 +1,29 @@ -+# Licensed to the Apache Software Foundation (ASF) under one -+# or more contributor license agreements. See the NOTICE file -+# distributed with this work for additional information -+# regarding copyright ownership. The ASF licenses this file -+# to you under the Apache License, Version 2.0 (the -+# "License"); you may not use this file except in compliance -+# with the License. You may obtain a copy of the License at -+# -+# http://www.apache.org/licenses/LICENSE-2.0 -+# -+# Unless required by applicable law or agreed to in writing, -+# software distributed under the License is distributed on an -+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -+# KIND, either express or implied. See the License for the -+# specific language governing permissions and limitations -+# under the License. -+OpenIDE-Module-Name=Java LSP Server -+OpenIDE-Module-Display-Category=Java -+OpenIDE-Module-Short-Description=Java LSP Server -+ -+LBL_Run={0} \u3092\u5B9F\u884C -+LBL_Debug={0} \u3092\u30C7\u30D0\u30C3\u30B0 -+LBL_RunWith={0} \u3092\u6307\u5B9A\u3057\u3066 {1} \u3092\u5B9F\u884C -+LBL_DebugWith={0} \u3092\u6307\u5B9A\u3057\u3066 {1} \u3092\u30C7\u30D0\u30C3\u30B0 -+LBL_TestMethod={0} \u3092\u30C6\u30B9\u30C8 -+LBL_ProfileMethod={0} \u3092\u30D7\u30ED\u30D5\u30A1\u30A4\u30EA\u30F3\u30B0 -+LBL_Clean=\u6D88\u53BB -+LBL_Build=\u4F5C\u6210 -+LBL_ContinuousMode=\u9023\u7D9A\u30E2\u30FC\u30C9 -diff --git a/netbeans-l10n-zip/src/zh_CN/java/java-lsp-server/java-lsp-server/org/netbeans/modules/java/lsp/server/protocol/Bundle_zh_CN.properties b/netbeans-l10n-zip/src/zh_CN/java/java-lsp-server/java-lsp-server/org/netbeans/modules/java/lsp/server/protocol/Bundle_zh_CN.properties -new file mode 100755 -index 000000000..97a321575 ---- /dev/null -+++ b/netbeans-l10n-zip/src/zh_CN/java/java-lsp-server/java-lsp-server/org/netbeans/modules/java/lsp/server/protocol/Bundle_zh_CN.properties -@@ -0,0 +1,29 @@ -+# Licensed to the Apache Software Foundation (ASF) under one -+# or more contributor license agreements. See the NOTICE file -+# distributed with this work for additional information -+# regarding copyright ownership. The ASF licenses this file -+# to you under the Apache License, Version 2.0 (the -+# "License"); you may not use this file except in compliance -+# with the License. You may obtain a copy of the License at -+# -+# http://www.apache.org/licenses/LICENSE-2.0 -+# -+# Unless required by applicable law or agreed to in writing, -+# software distributed under the License is distributed on an -+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -+# KIND, either express or implied. See the License for the -+# specific language governing permissions and limitations -+# under the License. -+OpenIDE-Module-Name=Java LSP Server -+OpenIDE-Module-Display-Category=Java -+OpenIDE-Module-Short-Description=Java LSP Server -+ -+LBL_Run=\u8FD0\u884C {0} -+LBL_Debug=\u8C03\u8BD5 {0}, -+LBL_RunWith=\u4F7F\u7528 {0} \u8FD0\u884C {1} -+LBL_DebugWith=\u4F7F\u7528 {0} \u8C03\u8BD5 {1} -+LBL_TestMethod=\u6D4B\u8BD5 {0} -+LBL_ProfileMethod=\u6982\u8981\u5206\u6790 {0} -+LBL_Clean=\u6E05\u9664 -+LBL_Build=\u6784\u5EFA -+LBL_ContinuousMode=\u8FDE\u7EED\u6A21\u5F0F -\ No newline at end of file diff --git a/patches/l10n/adding-java.lsp.server-ja-and-zh_CN.diff b/patches/l10n/adding-java.lsp.server-ja-and-zh_CN.diff new file mode 100644 index 00000000..7e503335 --- /dev/null +++ b/patches/l10n/adding-java.lsp.server-ja-and-zh_CN.diff @@ -0,0 +1,71 @@ +diff --git a/netbeans-l10n-zip/src/ja/java/java-lsp-server/java-lsp-server/org/netbeans/modules/java/lsp/server/protocol/Bundle_ja.properties b/netbeans-l10n-zip/src/ja/java/java-lsp-server/java-lsp-server/org/netbeans/modules/java/lsp/server/protocol/Bundle_ja.properties +new file mode 100755 +index 000000000..88b6b4608 +--- /dev/null ++++ b/netbeans-l10n-zip/src/ja/java/java-lsp-server/java-lsp-server/org/netbeans/modules/java/lsp/server/protocol/Bundle_ja.properties +@@ -0,0 +1,29 @@ ++# Licensed to the Apache Software Foundation (ASF) under one ++# or more contributor license agreements. See the NOTICE file ++# distributed with this work for additional information ++# regarding copyright ownership. The ASF licenses this file ++# to you under the Apache License, Version 2.0 (the ++# "License"); you may not use this file except in compliance ++# with the License. You may obtain a copy of the License at ++# ++# http://www.apache.org/licenses/LICENSE-2.0 ++# ++# Unless required by applicable law or agreed to in writing, ++# software distributed under the License is distributed on an ++# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ++# KIND, either express or implied. See the License for the ++# specific language governing permissions and limitations ++# under the License. ++OpenIDE-Module-Name=Java LSP Server ++OpenIDE-Module-Display-Category=Java ++OpenIDE-Module-Short-Description=Java LSP Server ++ ++LBL_Run={0} \u3092\u5B9F\u884C ++LBL_Debug={0} \u3092\u30C7\u30D0\u30C3\u30B0 ++LBL_RunWith={0} \u3092\u6307\u5B9A\u3057\u3066 {1} \u3092\u5B9F\u884C ++LBL_DebugWith={0} \u3092\u6307\u5B9A\u3057\u3066 {1} \u3092\u30C7\u30D0\u30C3\u30B0 ++LBL_TestMethod={0} \u3092\u30C6\u30B9\u30C8 ++LBL_ProfileMethod={0} \u3092\u30D7\u30ED\u30D5\u30A1\u30A4\u30EA\u30F3\u30B0 ++LBL_Clean=\u6D88\u53BB ++LBL_Build=\u4F5C\u6210 ++LBL_ContinuousMode=\u9023\u7D9A\u30E2\u30FC\u30C9 +diff --git a/netbeans-l10n-zip/src/zh_CN/java/java-lsp-server/java-lsp-server/org/netbeans/modules/java/lsp/server/protocol/Bundle_zh_CN.properties b/netbeans-l10n-zip/src/zh_CN/java/java-lsp-server/java-lsp-server/org/netbeans/modules/java/lsp/server/protocol/Bundle_zh_CN.properties +new file mode 100755 +index 000000000..97a321575 +--- /dev/null ++++ b/netbeans-l10n-zip/src/zh_CN/java/java-lsp-server/java-lsp-server/org/netbeans/modules/java/lsp/server/protocol/Bundle_zh_CN.properties +@@ -0,0 +1,29 @@ ++# Licensed to the Apache Software Foundation (ASF) under one ++# or more contributor license agreements. See the NOTICE file ++# distributed with this work for additional information ++# regarding copyright ownership. The ASF licenses this file ++# to you under the Apache License, Version 2.0 (the ++# "License"); you may not use this file except in compliance ++# with the License. You may obtain a copy of the License at ++# ++# http://www.apache.org/licenses/LICENSE-2.0 ++# ++# Unless required by applicable law or agreed to in writing, ++# software distributed under the License is distributed on an ++# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ++# KIND, either express or implied. See the License for the ++# specific language governing permissions and limitations ++# under the License. ++OpenIDE-Module-Name=Java LSP Server ++OpenIDE-Module-Display-Category=Java ++OpenIDE-Module-Short-Description=Java LSP Server ++ ++LBL_Run=\u8FD0\u884C {0} ++LBL_Debug=\u8C03\u8BD5 {0}, ++LBL_RunWith=\u4F7F\u7528 {0} \u8FD0\u884C {1} ++LBL_DebugWith=\u4F7F\u7528 {0} \u8C03\u8BD5 {1} ++LBL_TestMethod=\u6D4B\u8BD5 {0} ++LBL_ProfileMethod=\u6982\u8981\u5206\u6790 {0} ++LBL_Clean=\u6E05\u9664 ++LBL_Build=\u6784\u5EFA ++LBL_ContinuousMode=\u8FDE\u7EED\u6A21\u5F0F +\ No newline at end of file diff --git a/patches/l10n/filter-enabled-clusters-disabled-modules-code-cleanup.diff b/patches/l10n/filter-enabled-clusters-disabled-modules-code-cleanup.diff new file mode 100644 index 00000000..3876efe8 --- /dev/null +++ b/patches/l10n/filter-enabled-clusters-disabled-modules-code-cleanup.diff @@ -0,0 +1,462 @@ +diff --git a/l10nantext/src/org/netbeans/l10n/Package.java b/l10nantext/src/org/netbeans/l10n/Package.java +index 9886cf0e6..ad695a914 100755 +--- a/l10nantext/src/org/netbeans/l10n/Package.java ++++ b/l10nantext/src/org/netbeans/l10n/Package.java +@@ -18,38 +18,22 @@ + */ + package org.netbeans.l10n; + +-import java.io.BufferedOutputStream; + import java.io.File; +-import java.io.FileInputStream; +-import java.io.FileOutputStream; +-import java.io.IOException; +-import java.io.InputStream; +-import java.io.OutputStream; ++import java.util.Collections; + import java.util.HashMap; +-import java.util.Properties; ++import java.util.HashSet; ++import java.util.Set; + import java.util.StringTokenizer; + import java.util.Vector; +-import java.util.jar.JarFile; +-import java.util.zip.ZipEntry; +-//import org.netbeans.nbbuild.XMLUtil; +-//import org.netbeans.nbbuild.AutoUpdate; ++import java.util.regex.Pattern; ++ + import org.apache.tools.ant.BuildException; + import org.apache.tools.ant.DirectoryScanner; +-import org.apache.tools.ant.Project; + import org.apache.tools.ant.Task; + import org.apache.tools.ant.taskdefs.Copy; +-import org.apache.tools.ant.taskdefs.Delete; + import org.apache.tools.ant.taskdefs.Jar; + import org.apache.tools.ant.taskdefs.Mkdir; +-import org.apache.tools.ant.taskdefs.SignJar; + import org.apache.tools.ant.types.Path; +-import org.apache.tools.ant.types.ZipFileSet; +-import org.w3c.dom.Document; +-import org.w3c.dom.Element; +-import org.xml.sax.ErrorHandler; +-import org.xml.sax.InputSource; +-import org.xml.sax.SAXException; +-import org.xml.sax.SAXParseException; + + public class Package extends Task { + +@@ -58,6 +42,8 @@ public class Package extends Task { + HashMap> nbms = new HashMap>(); + File srcDir = null; + private String jarSignerMaxMemory = "96m"; ++ private Set enabledClusterPath = null; ++ private Set disabledModules = null; + + /** Set the location of jhall.jar or jsearch.jar (JavaHelp tools library). */ + public Path createClasspath() { +@@ -114,203 +100,46 @@ public class Package extends Task { + alias = s; + } + ++ /** ++ * Set a colon-separated list of netbeans module clusters which are enabled, ++ * and which need to be skipped from the build. If nothing is specified then ++ * the default behaviour is the inclusion of all clusters in the build. ++ * @param enabledClusterPath colon-separated netbeans module clusters which are enabled ++ */ ++ public void setEnabledClusterPath(String enabledClusterPath) { ++ this.enabledClusterPath = split(enabledClusterPath, ":", Pattern.compile(".+" + (isWindows() ? "[\\\\/]" : "/")), ""); ++ log("enabledClusterPath: " + enabledClusterPath, 4); ++ } ++ ++ /** ++ * Set a comma-separated list of netbeans module names which are disabled, ++ * and which need to be skipped from the build. ++ * @param disabledModules comma-separated names of netbeans modules which are disabled ++ */ ++ public void setDisabledModules(String disabledModules) { ++ this.disabledModules = split(disabledModules, ",", Pattern.compile(".", Pattern.LITERAL), "-"); ++ log("disabledModules: " + disabledModules, 4); ++ } ++ + public void execute() throws BuildException { + + // Create all localized jars +- StringTokenizer tokenizer = new StringTokenizer(locales.trim(), ", "); ++ StringTokenizer tokenizer = new StringTokenizer(locales.trim(), ","); + while (tokenizer.hasMoreTokens()) { + String loc = tokenizer.nextToken(); +- processLocale(loc); ++ processLocale(loc.trim()); + } +- +-// // Deal with NBMs creation +-// DirectoryScanner ds = new DirectoryScanner(); +-// ds.setBasedir(nbmsLocation); +-// ds.setIncludes(new String[]{"**/*.nbm"}); +-// ds.scan(); +-// Mkdir mkdir = (Mkdir) getProject().createTask("mkdir"); +-// Copy copy = (Copy) getProject().createTask("copy"); +-// File tmpDir = new File("tmp"); +-// tmpDir.mkdir(); +-// for (String nbm : ds.getIncludedFiles()) { +-// String nbmName = nbm.substring(nbm.lastIndexOf(File.separator) + 1, nbm.lastIndexOf(".")); +-// Vector nbmFiles = nbms.get(nbmName); +-// if (nbmFiles == null) { +-// log("There is no localization content for NBM: " + nbmName); +-// continue; +-// } +-// String cluster = nbm.substring(0, nbm.indexOf(File.separator)); +-// File destNbmDir = new File(nbmsDistDir, cluster); +-// File destNbmFile = new File(destNbmDir, nbmName + ".nbm"); +-// if (!destNbmDir.isDirectory()) { +-// mkdir.setDir(destNbmDir); +-// mkdir.execute(); +-// } +-// copy.setFile(new File(nbmsLocation, nbm)); +-// copy.setTodir(destNbmDir); +-// copy.execute(); +-// +-// Jar jar = (Jar) getProject().createTask("jar"); +-// jar.setUpdate(true); +-// jar.setDestFile(destNbmFile); +-// ZipFileSet zfs = new ZipFileSet(); +-// zfs.setDir(new File(distDir, cluster)); +-// zfs.setPrefix("netbeans"); +-// zfs.appendIncludes(nbmFiles.toArray(new String[]{""})); +-// jar.addFileset(zfs); +-// +-// //Process InfoXMLs +-// tokenizer = new StringTokenizer(locales.trim(), ", "); +-// while (tokenizer.hasMoreTokens()) { +-// String loc = tokenizer.nextToken(); +-// try { +-// File jarF = new File(distDir, cluster + File.separator + "modules" + File.separator + "locale" + File.separator + nbmName + "_" + loc + ".jar"); +-// if (!jarF.isFile()) { +-// log("No " + loc + " localization for " + nbmName); +-// continue; +-// } +-// //Find localized bundle +-// JarFile jarFile = new JarFile(new File(distDir, cluster + File.separator + "modules" + File.separator + "locale" + File.separator + nbmName + "_" + loc + ".jar")); +-// Properties p = new Properties(); +-// ZipEntry bundleentry = jarFile.getEntry(nbmName.replace('-', '/') + File.separator + "Bundle_" + loc + ".properties"); +-// if (bundleentry == null) { +-// //Read it from the NBM and module's jar manifest +-// JarFile nbmFile = new JarFile(destNbmFile); +-// String jarEntryName = "netbeans/modules/" + nbmName + ".jar"; +-// ZipEntry ze = nbmFile.getEntry(jarEntryName); +-// InputStream is; +-// if(ze == null) { +-// //NBM is packed with pack200 +-// ze = nbmFile.getEntry(jarEntryName + ".pack.gz"); +-// if(ze!=null) { +-// File packedJar = File.createTempFile(nbmName, ".jar.pack.gz", tmpDir); +-// File unpackedJar = File.createTempFile(nbmName, ".jar", tmpDir); +-// unpackedJar.deleteOnExit(); +-// packedJar.deleteOnExit(); +-// InputStream fis = nbmFile.getInputStream(ze); +-// BufferedOutputStream bof = new BufferedOutputStream(new FileOutputStream(packedJar)); +-// byte [] buffer = new byte [4096]; +-// int read = 0; +-// while ((read = fis.read(buffer)) != -1) { +-// bof.write(buffer, 0, read); +-// } +-// bof.close(); +-// fis.close(); +-// AutoUpdate.unpack200(packedJar, unpackedJar); +-// is = new FileInputStream(unpackedJar); +-// } else { +-// throw new BuildException("Cannot find neither " + +-// jarEntryName + ".pack.gz nor " + +-// jarEntryName + " entry in " + nbmFile.getName()); +-// } +-// } else { +-// is = nbmFile.getInputStream(ze); +-// } +-// +-// File tmpJar = File.createTempFile("module", ".jar", tmpDir); +-// BufferedOutputStream bof = new BufferedOutputStream(new FileOutputStream(tmpJar)); +-// int ch = 0; +-// while ((ch = is.read()) != -1) { +-// bof.write(ch); +-// } +-// bof.close(); +-// is.close(); +-// JarFile moduleJar = new JarFile(tmpJar); +-// String bundlename = moduleJar.getManifest().getMainAttributes().getValue("OpenIDE-Module-Localizing-Bundle"); +-// String bfname = bundlename.substring(0, bundlename.lastIndexOf('.')); +-// String bfext = bundlename.substring(bundlename.lastIndexOf('.')); +-// bundlename = bfname + "_" + loc + bfext; +-// bundleentry = jarFile.getEntry(bundlename); +-// moduleJar.close(); +-// tmpJar.delete(); +-// } +-// if (bundleentry != null) { +-// InputStream is = jarFile.getInputStream(bundleentry); +-// try { +-// p.load(is); +-// } finally { +-// is.close(); +-// } +-// // Open the original info XML +-// JarFile nbmFile = new JarFile(destNbmFile); +-// Document doc = XMLUtil.parse(new InputSource(nbmFile.getInputStream(nbmFile.getEntry("Info/info.xml"))), false, false, new ErrorCatcher(), null); +-// Element manifest = (Element) doc.getElementsByTagName("manifest").item(0); +-// +-// // Now pick up attributes from the bundle and put them to the info.xml +-// for (String attr : new String[]{"OpenIDE-Module-Name", "OpenIDE-Module-Display-Category", "OpenIDE-Module-Short-Description", "OpenIDE-Module-Long-Description"}) { +-// String value = p.getProperty(attr); +-// if (value != null) { +-// manifest.setAttribute(attr, value); +-// } +-// } +-// File infofile = new File(tmpDir, "info_" + loc + ".xml"); +-// OutputStream infoStream = new FileOutputStream(infofile); +-// XMLUtil.write(doc, infoStream); +-// infoStream.close(); +-// zfs = new ZipFileSet(); +-// zfs.setDir(tmpDir); +-// zfs.setPrefix("Info/locale"); +-// zfs.appendIncludes(new String[]{"info_" + loc + ".xml"}); +-// jar.addFileset(zfs); +-// } else { +-// log("Can't find localizing bundle for " + nbmName); +-// } +-// } catch (IOException ex) { +-// log("Problems with reading localization bundles for " + loc + ", NBM: " + nbmName, ex, Project.MSG_WARN); +-// +-// } catch (SAXException saxe) { +-// log("Problem with creating localized info.xml for " + loc + ", NBM: " + nbmName, saxe, Project.MSG_WARN); +-// } +-// +-// } +-// jar.execute(); +-// +-// if (keystore != null && storepass != null && alias != null) { +-// if (!keystore.isFile()) { +-// continue; +-// } +-// SignJar signjar = (SignJar) getProject().createTask("signjar"); +-// try { // Signatures changed in various Ant versions. +-// +-// try { +-// SignJar.class.getMethod("setKeystore", File.class).invoke(signjar, keystore); +-// } catch (NoSuchMethodException x) { +-// SignJar.class.getMethod("setKeystore", String.class).invoke(signjar, keystore.getAbsolutePath()); +-// } +-// try { +-// SignJar.class.getMethod("setJar", File.class).invoke(signjar, destNbmFile); +-// } catch (NoSuchMethodException x) { +-// SignJar.class.getMethod("setJar", String.class).invoke(signjar, destNbmFile.getAbsolutePath()); +-// } +-// } catch (BuildException x) { +-// throw x; +-// } catch (Exception x) { +-// throw new BuildException(x); +-// } +-// signjar.setStorepass(storepass); +-// signjar.setAlias(alias); +-// signjar.setLocation(getLocation()); +-// signjar.setMaxmemory(this.jarSignerMaxMemory); +-// signjar.init(); +-// signjar.execute(); +-// } +-// } +-// Delete delete = (Delete) getProject().createTask("delete"); +-// delete.setDir(tmpDir); +-// delete.execute(); + } + + void processLocale(String locale) throws BuildException { +- DirectoryScanner ds = new DirectoryScanner(); +-// File baseSrcDir = new File(srcDir, locale); + File baseSrcDir = srcDir; +-// if (!baseSrcDir.exists()) { +-// log("No files for locale: " + locale); +-// return; +-// } +- ds.setBasedir(baseSrcDir); ++ ++ final Set enabledClusters = this.enabledClusterPath; ++ final Set disabledModules = this.disabledModules; + String[] includes = new String[]{"*/*/*", "*/*/ext/*", "*/*/ext/locale/*", "*/*/netbeans/*/*", "*/*/netbeans/*/locale/*", "*/*/netbeans/*/nblib/*", "*/*/netbeans/*/extra/*", "*/*/docs/*", "*/*/locale/*", "*/*/netbeans/config/*/*"}; + String[] excludes = new String[]{"other/**", "*/*/netbeans", "*/*/netbeans/*", "*/*/netbeans/*/locale", "*/*/netbeans/*/nblib", "*/*/netbeans/*/extra", "*/*/docs", "*/*/ext", "*/*/ext/locale", "*/*/locale", "*/*/netbeans/config/*"}; ++ DirectoryScanner ds = new DirectoryScanner(); ++ ds.setBasedir(baseSrcDir); + ds.setIncludes(includes); + ds.setExcludes(excludes); + ds.scan(); +@@ -318,13 +147,34 @@ public class Package extends Task { + Mkdir mkdir = (Mkdir) getProject().createTask("mkdir"); + Task locJH = getProject().createTask("locjhindexer"); + for (String dir : ds.getIncludedDirectories()) { +- String name = dir.substring(dir.lastIndexOf(File.separator) + 1); ++ int clusterEnd = dir.indexOf(File.separator); ++ int pathLeafStart = dir.lastIndexOf(File.separator); ++ int nbmEnd = dir.indexOf(File.separator, clusterEnd + 1); ++ String cluster = clusterEnd <= 0 ? "" : dir.substring(0, clusterEnd); ++ String nbm = dir.substring(clusterEnd + 1, nbmEnd < 0 ? dir.length() : nbmEnd); ++ String subPath = pathLeafStart <= nbmEnd ? File.separator : dir.substring(Math.max(nbmEnd, 0), pathLeafStart); ++ String name = dir.substring(pathLeafStart + 1); ++ ++ cluster = cluster.replaceAll("^vw", "visualweb"); + name = name.replaceAll("^vw-rh", "visualweb-ravehelp-rave_nbpack"); + name = name.replaceAll("^vw-", "visualweb-"); +- String nbm = dir.substring(dir.indexOf(File.separator) + 1); +- nbm = nbm.substring(0, nbm.indexOf(File.separator)); +- String cluster = dir.substring(0, dir.indexOf(File.separator)); +- String subPath = dir.substring((cluster + File.separator + nbm + File.separator).length() - 1, dir.lastIndexOf(File.separator)); ++ nbm = nbm.replaceAll("^vw-rh", "visualweb-ravehelp-rave_nbpack"); ++ nbm = nbm.replaceAll("^vw-", "visualweb-"); ++ if (!nbm.startsWith("org-") && !nbm.startsWith("com-") && !nbm.startsWith("net-")) { ++ nbm = "org-netbeans-modules-" + nbm; ++ } ++ ++ log("cluster: " + cluster + "; module: " + nbm + "; subPath: " + subPath + "; name: " + name, 4); ++ ++ if (enabledClusters != null && !enabledClusters.contains(cluster)) { ++ log("Skipping excluded cluster " + cluster + " for: " + dir, 3); ++ continue; ++ } ++ if (disabledModules != null && disabledModules.contains(nbm)) { ++ log("Skipping disabled module " + nbm + " for: " + dir, 3); ++ continue; ++ } ++ + if (!subPath.startsWith(File.separator + "netbeans")) { + subPath = File.separator + "modules" + subPath; + if (!name.startsWith("org-") && !(subPath.endsWith(File.separator + "ext") || subPath.endsWith(File.separator + "ext" + File.separator + "locale"))) { +@@ -342,12 +192,6 @@ public class Package extends Task { + name = "org-netbeans-modules-" + name; + } + } +- nbm = nbm.replaceAll("^vw-rh", "visualweb-ravehelp-rave_nbpack"); +- nbm = nbm.replaceAll("^vw-", "visualweb-"); +- if (!nbm.startsWith("org-") && !nbm.startsWith("com-")) { +- nbm = "org-netbeans-modules-" + nbm; +- } +- cluster = cluster.replaceAll("^vw", "visualweb"); + if (subPath.matches(".*/docs$")) { + ds.setBasedir(new File(baseSrcDir, dir)); + ds.setIncludes(new String[]{"**/*.hs"}); +@@ -375,72 +219,83 @@ public class Package extends Task { + subPath += File.separator + "locale"; + } + String jarFileName = name + "_" + locale + ".jar"; +-// File distJarDir = new File(distDir.getAbsolutePath(), cluster + subPath); + File distJarDir = distDir; + mkdir.setDir(distJarDir); + mkdir.execute(); + jar.setBasedir(new File(baseSrcDir, dir)); + jar.setDestFile(new File(distJarDir, jarFileName)); + jar.execute(); +- Vector nbmFiles = nbms.get(nbm); +- if (nbmFiles == null) { +- nbmFiles = new Vector(); +- nbms.put(nbm, nbmFiles); +- } +- nbmFiles.add(subPath.substring(1) + File.separator + jarFileName); ++ nbms.computeIfAbsent(nbm, k -> new Vector<>()) ++ .add(subPath.substring(1) + File.separator + jarFileName); + } ++ + ds.setBasedir(baseSrcDir); + ds.setIncludes(includes); + ds.setExcludes(excludes); + ds.scan(); + Copy copy = (Copy) getProject().createTask("copy"); + for (String file : ds.getIncludedFiles()) { +- String name = file.substring(file.lastIndexOf(File.separator) + 1); ++ int clusterEnd = file.indexOf(File.separator); ++ int pathLeafStart = file.lastIndexOf(File.separator); ++ int nbmEnd = file.indexOf(File.separator, clusterEnd + 1); ++ String cluster = clusterEnd <= 0 ? "" : file.substring(0, clusterEnd); ++ String nbm = file.substring(clusterEnd + 1, nbmEnd < 0 ? file.length() : nbmEnd); ++ String subPath = pathLeafStart <= nbmEnd ? File.separator : file.substring(Math.max(nbmEnd, 0), pathLeafStart); ++ String name = file.substring(pathLeafStart + 1); ++ ++ cluster = cluster.replaceAll("^vw", "visualweb"); + name = name.replaceAll("^vw-rh", "visualweb-ravehelp-rave_nbpack"); + name = name.replaceAll("^vw-", "visualweb-"); +- String nbm = file.substring(file.indexOf(File.separator) + 1); +- nbm = nbm.substring(0, nbm.indexOf(File.separator)); +- String cluster = file.substring(0, file.indexOf(File.separator)); +- String subPath = file.substring((cluster + File.separator + nbm + File.separator).length() - 1, file.lastIndexOf(File.separator)); ++ nbm = nbm.replaceAll("^vw-rh", "visualweb-ravehelp-rave_nbpack"); ++ nbm = nbm.replaceAll("^vw-", "visualweb-"); ++ if (!nbm.startsWith("org-") && !nbm.startsWith("com-") && !nbm.startsWith("net-")) { ++ nbm = "org-netbeans-modules-" + nbm; ++ } ++ ++ log("cluster: " + cluster + "; module: " + nbm + "; subPath: " + subPath + "; name: " + name, 4); ++ ++ if (enabledClusters != null && !enabledClusters.contains(cluster)) { ++ log("Skipping excluded cluster " + cluster + " for: " + file, 3); ++ continue; ++ } ++ if (disabledModules != null && disabledModules.contains(nbm)) { ++ log("Skipping disabled module " + nbm + " for: " + file, 3); ++ continue; ++ } ++ + if (!subPath.startsWith(File.separator + "netbeans")) { + subPath = File.separator + "modules" + subPath; + } else { + subPath = subPath.substring((File.separator + "netbeans").length()); + } +- nbm = nbm.replaceAll("^vw-rh", "visualweb-ravehelp-rave_nbpack"); +- nbm = nbm.replaceAll("^vw-", "visualweb-"); +- if (!nbm.startsWith("org") || !nbm.startsWith("com")) { +- nbm = "org-netbeans-modules-" + nbm; +- } +- cluster = cluster.replaceAll("^vw", "visualweb"); + File distFileDir = new File(distDir.getAbsolutePath(), cluster + subPath); + mkdir.setDir(distFileDir); + mkdir.execute(); + copy.setFile(new File(baseSrcDir, file)); + copy.setTodir(distFileDir); + copy.execute(); +- Vector nbmFiles = nbms.get(nbm); +- if (nbmFiles == null) { +- nbmFiles = new Vector(); +- nbms.put(nbm, nbmFiles); +- } +- nbmFiles.add(subPath.substring(1) + File.separator + file); ++ nbms.computeIfAbsent(nbm, k -> new Vector<>()) ++ .add(subPath.substring(1) + File.separator + name); + } + } + +- class ErrorCatcher implements ErrorHandler { +- +- public void error(SAXParseException e) { +- // normally a validity error +- pError = true; +- } +- +- public void warning(SAXParseException e) { +- //parseFailed = true; ++ private static Set split(String str, String delimiter, Pattern replaceAllRegex, String replacement) { ++ HashSet strings = new HashSet<>(); ++ if (str != null) { ++ for (String s : str.split(delimiter)) { ++ s = s.trim(); ++ if (replaceAllRegex != null && replacement != null) ++ s = replaceAllRegex.matcher(s).replaceAll(replacement); ++ if (!s.isEmpty()) ++ strings.add(s); ++ } + } ++ return strings.isEmpty() ? null : ++ strings.size() == 1 ? Collections.singleton(strings.iterator().next()) : ++ strings; ++ } + +- public void fatalError(SAXParseException e) { +- pError = true; +- } ++ private static boolean isWindows() { ++ return System.getProperty("os.name", "").toLowerCase().startsWith("win"); + } + }