< prev index next >
src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacPkgBundler.java
Print this page
*** 325,349 ****
private void patchCPLFile(File cpl) throws IOException {
String cplData = Files.readString(cpl.toPath());
String[] lines = cplData.split("\n");
try (PrintWriter out = new PrintWriter(Files.newBufferedWriter(
cpl.toPath()))) {
! boolean skip = false; // Used to skip Java.runtime bundle, since
// pkgbuild with --root will find two bundles app and Java runtime.
// We cannot generate component proprty list when using
// --component argument.
for (int i = 0; i < lines.length; i++) {
if (lines[i].trim().equals("<key>BundleIsRelocatable</key>")) {
out.println(lines[i]);
out.println("<false/>");
i++;
} else if (lines[i].trim().equals("<key>ChildBundles</key>")) {
! skip = true;
! } else if (skip && lines[i].trim().equals("</array>")) {
! skip = false;
} else {
! if (!skip) {
out.println(lines[i]);
}
}
}
}
--- 325,350 ----
private void patchCPLFile(File cpl) throws IOException {
String cplData = Files.readString(cpl.toPath());
String[] lines = cplData.split("\n");
try (PrintWriter out = new PrintWriter(Files.newBufferedWriter(
cpl.toPath()))) {
! int skip = 0;
! // Used to skip Java.runtime bundle, since
// pkgbuild with --root will find two bundles app and Java runtime.
// We cannot generate component proprty list when using
// --component argument.
for (int i = 0; i < lines.length; i++) {
if (lines[i].trim().equals("<key>BundleIsRelocatable</key>")) {
out.println(lines[i]);
out.println("<false/>");
i++;
} else if (lines[i].trim().equals("<key>ChildBundles</key>")) {
! ++skip;
! } else if ((skip > 0) && lines[i].trim().equals("</array>")) {
! --skip;
} else {
! if (skip == 0) {
out.println(lines[i]);
}
}
}
}
< prev index next >