11/* ******************************************************************************
2- * Copyright (c) 2025 IBM Corporation and others.
2+ * Copyright (c) 2025, 2026 IBM Corporation and others.
33 * All rights reserved. This program and the accompanying materials
44 * are made available under the terms of the Eclipse Public License 2.0
55 * which accompanies this distribution, and is available at
@@ -20,69 +20,49 @@ def commonOptionsFile = project.file("${sourceJavaOptionsFilesDirectory}/common_
2020def lineSeparator = System . getProperty(" line.separator" )
2121
2222/*
23- * Delete any existing java options files in wlp/lib/platform/java directory
24- */
25- task deleteJavaOptionsFiles (type : Delete ) {
26- delete fileTree(dir : buildImage. file(" ${ destinationJavaOptionsFilesDirectory} " ), include : ' **/java*.options' )
27- }
28-
29- /*
30- * Create java options files in wlp/lib/platform/java directory
23+ * Build java9 and java24 options files in wlp/lib/platform/java directory
24+ *
25+ * Build the java9.options file by taking the contents of the extra_java_9_23.options
26+ * file and appending the contents of the common_java.options file
27+ *
28+ * Build the java24.options file by appending the contents of the common_java.options file
3129 */
32- task createJavaOptionsFiles (type : Copy ) {
33- dependsOn deleteJavaOptionsFiles
30+ task buildJavaOptionsFiles (type : Copy ) {
3431 doFirst {
35- if (! buildImage. file(" ${ destinationJavaOptionsFilesDirectory} " ). exists()) {
32+ if (! buildImage. file(" ${ destinationJavaOptionsFilesDirectory} " ). exists()) {
3633 mkdir buildImage. file(" ${ destinationJavaOptionsFilesDirectory} " )
3734 }
3835 }
3936 from project. file(" ${ sourceJavaOptionsFilesDirectory} " )
4037 into buildImage. file(" ${ destinationJavaOptionsFilesDirectory} " )
4138 include ' java*.options'
42- }
43-
44- /*
45- * Build the java9.options file by taking the contents of the extra_java_9_23.options
46- * file and appending the contents of the common_java.options file
47- */
48- task buildJava9OptionsFile () {
49- dependsOn createJavaOptionsFiles
5039 doLast {
51- def optionsFile = buildImage. file(" ${ destinationJavaOptionsFilesDirectory} /${ java9OptionsFile} " )
40+ def options9File = buildImage. file(" ${ destinationJavaOptionsFilesDirectory} /${ java9OptionsFile} " )
5241
5342 // Before appending the extra_java_9_23.options file contents,
5443 // insert a line separator if the file doesn't already end with one
55- if (optionsFile . text && ! optionsFile . text. endsWith(lineSeparator)) {
56- optionsFile . append(lineSeparator + java9Through23OptionsFile. text)
44+ if (options9File . text && ! options9File . text. endsWith(lineSeparator)) {
45+ options9File . append(lineSeparator + java9Through23OptionsFile. text)
5746 } else {
58- optionsFile . append(java9Through23OptionsFile. text)
47+ options9File . append(java9Through23OptionsFile. text)
5948 }
6049
6150 // Before appending the common_java.options file contents,
6251 // insert a line separator if the file doesn't already end with one
63- if (optionsFile . text && ! optionsFile . text. endsWith(lineSeparator)) {
64- optionsFile . append(lineSeparator + commonOptionsFile. text)
52+ if (options9File . text && ! options9File . text. endsWith(lineSeparator)) {
53+ options9File . append(lineSeparator + commonOptionsFile. text)
6554 } else {
66- optionsFile . append(commonOptionsFile. text)
55+ options9File . append(commonOptionsFile. text)
6756 }
68- }
69- }
7057
71-
72- /*
73- * Build the java24.options file by appending the contents of the common_java.options file
74- */
75- task buildJava24OptionsFile () {
76- dependsOn buildJava9OptionsFile
77- doLast {
78- def optionsFile = buildImage. file(" ${ destinationJavaOptionsFilesDirectory} /${ java24OptionsFile} " )
58+ def options24File = buildImage. file(" ${ destinationJavaOptionsFilesDirectory} /${ java24OptionsFile} " )
7959
8060 // Before appending the common_java.options file contents,
8161 // insert a line separator if the file doesn't already end with one
82- if (optionsFile . text && ! optionsFile . text. endsWith(lineSeparator)) {
83- optionsFile . append(lineSeparator + commonOptionsFile. text)
62+ if (options24File . text && ! options24File . text. endsWith(lineSeparator)) {
63+ options24File . append(lineSeparator + commonOptionsFile. text)
8464 } else {
85- optionsFile . append(commonOptionsFile. text)
65+ options24File . append(commonOptionsFile. text)
8666 }
8767 }
8868}
@@ -91,4 +71,4 @@ task buildJava24OptionsFile() {
9171/* *****************************************************************
9272 ** Create and populate java option files
9373 ******************************************************************/
94- assemble. dependsOn buildJava24OptionsFile
74+ assemble. dependsOn buildJavaOptionsFiles
0 commit comments