< prev index next >
src/jdk.jpackage/share/classes/jdk/jpackage/internal/Arguments.java
Print this page
*** 123,133 ****
private boolean hasMainJar = false;
private boolean hasMainClass = false;
private boolean hasMainModule = false;
private boolean hasTargetFormat = false;
private boolean hasAppImage = false;
! private boolean retainBuildRoot = false;
private String buildRoot = null;
private String mainJarPath = null;
private static boolean jreInstaller = false;
--- 123,133 ----
private boolean hasMainJar = false;
private boolean hasMainClass = false;
private boolean hasMainModule = false;
private boolean hasTargetFormat = false;
private boolean hasAppImage = false;
! public boolean userProvidedBuildRoot = false;
private String buildRoot = null;
private String mainJarPath = null;
private static boolean jreInstaller = false;
*** 308,318 ****
new SecondaryLauncherArguments(popArg()));
}),
BUILD_ROOT ("build-root", OptionCategories.PROPERTY, () -> {
context().buildRoot = popArg();
! context().retainBuildRoot = true;
setOptionValue("build-root", context().buildRoot);
}),
INSTALL_DIR ("install-dir", OptionCategories.PROPERTY),
--- 308,318 ----
new SecondaryLauncherArguments(popArg()));
}),
BUILD_ROOT ("build-root", OptionCategories.PROPERTY, () -> {
context().buildRoot = popArg();
! context().userProvidedBuildRoot = true;
setOptionValue("build-root", context().buildRoot);
}),
INSTALL_DIR ("install-dir", OptionCategories.PROPERTY),
*** 436,446 ****
static void setContext(Arguments context) {
argContext = context;
}
! private static Arguments context() {
if (argContext != null) {
return argContext;
} else {
throw new RuntimeException("Argument context is not set.");
}
--- 436,446 ----
static void setContext(Arguments context) {
argContext = context;
}
! public static Arguments context() {
if (argContext != null) {
return argContext;
} else {
throw new RuntimeException("Argument context is not set.");
}
*** 735,745 ****
Map<String, ? super Object> localParams = new HashMap<>(params);
try {
if (bundler.validate(localParams)) {
File result =
bundler.execute(localParams, deployParams.outdir);
! if (!retainBuildRoot) {
bundler.cleanup(localParams);
}
if (result == null) {
throw new PackagerException("MSG_BundlerFailed",
bundler.getID(), bundler.getName());
--- 735,745 ----
Map<String, ? super Object> localParams = new HashMap<>(params);
try {
if (bundler.validate(localParams)) {
File result =
bundler.execute(localParams, deployParams.outdir);
! if (!userProvidedBuildRoot) {
bundler.cleanup(localParams);
}
if (result == null) {
throw new PackagerException("MSG_BundlerFailed",
bundler.getID(), bundler.getName());
*** 765,775 ****
Log.error(MessageFormat.format(
I18N.getString("MSG_BundlerRuntimeException"),
bundler.getName(), re.toString()));
Log.debug(re);
} finally {
! if (retainBuildRoot) {
Log.verbose(MessageFormat.format(
I18N.getString("message.debug-working-directory"),
(new File(buildRoot)).getAbsolutePath()));
}
}
--- 765,775 ----
Log.error(MessageFormat.format(
I18N.getString("MSG_BundlerRuntimeException"),
bundler.getName(), re.toString()));
Log.debug(re);
} finally {
! if (userProvidedBuildRoot) {
Log.verbose(MessageFormat.format(
I18N.getString("message.debug-working-directory"),
(new File(buildRoot)).getAbsolutePath()));
}
}
< prev index next >