|
31 | 31 | <property name="nbplatform.default.harness.dir" location="${nbplatform.default.netbeans.dest.dir}/harness" />
|
32 | 32 | <property name="nbantext.jar" location="netbeans/nbbuild/build/nbantext.jar" />
|
33 | 33 | <property name="nb_all" location="netbeans" />
|
| 34 | + <loadresource property="patch-files-l10n"> |
| 35 | + <string> |
| 36 | + patches/l10n/adding-ja-and-zh_CN.diff |
| 37 | + </string> |
| 38 | + <filterchain> |
| 39 | + <tokenfilter delimoutput=" "> |
| 40 | + <replaceregex pattern="\s+" replace=""/> |
| 41 | + </tokenfilter> |
| 42 | + </filterchain> |
| 43 | + </loadresource> |
34 | 44 | <loadresource property="patch-files">
|
35 | 45 | <string>
|
36 | 46 | patches/6330.diff
|
|
60 | 70 | <condition property="has-patches">
|
61 | 71 | <length string="${patches}" trim="true" when="greater" length="0"/>
|
62 | 72 | </condition>
|
| 73 | + <property name="patches-l10n" value="${patch-files-l10n}"/> |
| 74 | + <condition property="has-l10n-patches"> |
| 75 | + <length string="${patches-l10n}" trim="true" when="greater" length="0"/> |
| 76 | + </condition> |
63 | 77 |
|
64 | 78 | <condition property="cmd.suffix" value=".cmd" else="">
|
65 | 79 | <os family="windows"/>
|
|
93 | 107 | <chmod file="${lsp.build.dir}/platform/lib/nbexec.sh" perm="u+x"/>
|
94 | 108 | <chmod file="${lsp.build.dir}/java/maven/bin/mvn.sh" perm="u+x" />
|
95 | 109 | </target>
|
96 |
| - <target name="add-extra-modules" depends="build-lsp-server" if="extra.modules"> |
| 110 | + <target name="add-extra-modules" depends="build-lsp-server,build-l10n-bundles" if="extra.modules"> |
97 | 111 | <ant dir="../../nbbuild" target="build-nbms" inheritall="false" inheritrefs="false">
|
98 | 112 | <property name="cluster.config" value="basic"/>
|
99 | 113 | </ant>
|
|
113 | 127 | <delete dir="vscode/out" />
|
114 | 128 | <ant dir="nbcode" target="clean" inheritall="false" inheritrefs="false"/>
|
115 | 129 | </target>
|
| 130 | + |
| 131 | + <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"/> |
| 134 | + |
| 135 | + <target name="build-l10n-ant-text-jar"> |
| 136 | + <ant dir="${netbeans.l10n.dir}/l10nantext" inheritall="false" inheritrefs="false"> |
| 137 | + <property name="file.reference.ant.jar" value="${ant.home}/lib/ant.jar"/> |
| 138 | + </ant> |
| 139 | + </target> |
| 140 | + |
| 141 | + <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}"/> |
| 145 | + </ant> |
| 146 | + <copy todir="${javavscode.nbcode.extra.dir}"> |
| 147 | + <fileset dir="${netbeans.l10n.dir}/locale_${locale}/build/cluster"/> |
| 148 | + </copy> |
| 149 | + </target> |
| 150 | + <target name="clean-l10n"> |
| 151 | + <delete dir="${netbeans.l10n.dir}/locale_${locale}/build"/> |
| 152 | + <delete dir="${netbeans.l10n.dir}/locale_${locale}/release"/> |
| 153 | + </target> |
| 154 | + <target name="clean-l10n-bundles"> |
| 155 | + <delete dir="${netbeans.l10n.dir}/l10nantext/build"/> |
| 156 | + <delete dir="${netbeans.l10n.dir}/l10nantext/dist"/> |
| 157 | + <ant target="clean-l10n"> |
| 158 | + <property name="locale" value="ja"/> |
| 159 | + </ant> |
| 160 | + <ant target="clean-l10n"> |
| 161 | + <property name="locale" value="zh_CN"/> |
| 162 | + </ant> |
| 163 | + </target> |
| 164 | + <target name="no-l10n"> |
| 165 | + <property name="javavscode.disablel0n" value="true"/> |
| 166 | + </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 | + > |
| 170 | + <ant target="build-l10n"> |
| 171 | + <property name="locale" value="ja" description="japanese"/> |
| 172 | + </ant> |
| 173 | + <ant target="build-l10n"> |
| 174 | + <property name="locale" value="zh_CN" description="simplified chinese"/> |
| 175 | + </ant> |
| 176 | + </target> |
| 177 | + |
| 178 | + |
| 179 | + |
| 180 | + |
116 | 181 | <target name="build-vscode-ext" depends="add-extra-modules" description="Build the Visual Studio Code extension.">
|
117 | 182 | <taskdef name="gitbranchhash" classname="org.netbeans.nbbuild.GitBranchHash" classpath="${nbantext.jar}" />
|
118 | 183 | <gitbranchhash file="." branchproperty="metabuild.branch" hashproperty="metabuild.hash" />
|
|
204 | 269 | </exec>
|
205 | 270 | </target>
|
206 | 271 |
|
207 |
| - <target name="apply-patches" if="has-patches"> |
208 |
| - <echo>${patches}</echo> |
| 272 | + |
| 273 | + <target name = "git-patch" if="${has-git-patches}" > |
| 274 | + <echo>${git-patches-list}</echo> |
209 | 275 | <exec executable="git" failonerror="true">
|
210 | 276 | <arg value="apply"/>
|
211 |
| - <arg value="--directory=netbeans"/> |
| 277 | + <arg value="--directory=${git-dir}"/> |
212 | 278 | <arg value="--whitespace=nowarn"/>
|
213 |
| - <arg line="${patches}"/> |
| 279 | + <arg line="${git-patches-list}"/> |
214 | 280 | </exec>
|
215 | 281 | </target>
|
216 | 282 |
|
217 |
| - <target name="unapply-patches" if="has-patches"> |
| 283 | + <target name="apply-patches"> |
| 284 | + <ant target="git-patch"> |
| 285 | + <property name="git-patches-list" value="${patches}"/> |
| 286 | + <property name="has-git-patches" value="${has-patches}"/> |
| 287 | + <property name="git-dir" value="netbeans"/> |
| 288 | + </ant> |
| 289 | + |
| 290 | + <condition value="true" property="should-apply"> |
| 291 | + <and> |
| 292 | + <istrue value="${has-l10n-patches}"/> |
| 293 | + <isfalse value="${javavscode.disablel0n}"/> |
| 294 | + </and> |
| 295 | + </condition> |
| 296 | + <ant target="git-patch"> |
| 297 | + <property name="git-patches-list" value="${patches-l10n}"/> |
| 298 | + <property name="has-git-patches" value="${should-apply}"/> |
| 299 | + <property name="git-dir" value="netbeans-l10n"/> |
| 300 | + </ant> |
| 301 | + </target> |
| 302 | + |
| 303 | + <target name = "git-un-patch" if="${has-git-patches}" > |
218 | 304 | <!--in the reverse order:-->
|
219 | 305 | <echo file="${build.dir}/Reverse.java">
|
220 | 306 | import java.util.Arrays;
|
221 | 307 | import java.util.Collections;
|
222 | 308 | import java.util.List;
|
223 | 309 | import java.util.stream.Collectors;
|
224 | 310 | public class Reverse {
|
225 |
| - public static void main(String[] args) { |
226 |
| - List<String> patches = Arrays.asList(args[0].split(" ")); |
227 |
| - Collections.reverse(patches); |
228 |
| - System.out.print(patches.stream().collect(Collectors.joining(" "))); |
229 |
| - } |
| 311 | + public static void main(String[] args) { |
| 312 | + List<String> patches = Arrays.asList(args[0].split(" ")); |
| 313 | + Collections.reverse(patches); |
| 314 | + System.out.print(patches.stream().collect(Collectors.joining(" "))); |
| 315 | + } |
230 | 316 | }
|
231 | 317 | </echo>
|
232 | 318 | <java sourcefile="${build.dir}/Reverse.java"
|
233 | 319 | outputproperty="reverse.patches"
|
234 | 320 | fork="true">
|
235 |
| - <arg value="${patches}" /> |
| 321 | + <arg value="${git-patches-list}" /> |
236 | 322 | </java>
|
237 | 323 | <echo>${reverse.patches}</echo>
|
238 | 324 | <exec executable="git" failonerror="true">
|
239 | 325 | <arg value="apply"/>
|
240 |
| - <arg value="--directory=netbeans"/> |
| 326 | + <arg value="--directory=${git-dir}"/> |
241 | 327 | <arg value="--whitespace=nowarn"/>
|
242 | 328 | <arg value="--reverse"/>
|
243 | 329 | <arg line="${reverse.patches}"/>
|
244 | 330 | </exec>
|
245 | 331 | </target>
|
246 | 332 |
|
| 333 | + <target name="unapply-patches"> |
| 334 | + <ant target="git-un-patch"> |
| 335 | + <property name="git-patches-list" value="${patches}"/> |
| 336 | + <property name="has-git-patches" value="${has-patches}"/> |
| 337 | + <property name="git-dir" value="netbeans"/> |
| 338 | + </ant> |
| 339 | + <condition value="true" property="should-apply"> |
| 340 | + <and> |
| 341 | + <istrue value="${has-l10n-patches}"/> |
| 342 | + <isfalse value="${javavscode.disablel0n}"/> |
| 343 | + </and> |
| 344 | + </condition> |
| 345 | + <ant target="git-un-patch"> |
| 346 | + <property name="git-patches-list" value="${patches-l10n}"/> |
| 347 | + <property name="has-git-patches" value="${should-apply}"/> |
| 348 | + <property name="git-dir" value="netbeans-l10n"/> |
| 349 | + </ant> |
| 350 | + </target> |
| 351 | + |
247 | 352 | <target name="build-netbeans">
|
248 | 353 | <ant dir="netbeans" inheritAll="false" inheritRefs="false" useNativeBasedir="true"/>
|
249 | 354 | </target>
|
|
0 commit comments