Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
91dfca5
LinuxPackagingPipeline, WinPackagingPipeline: add normalizeShortcuts()
alexeysemenyukoracle Oct 28, 2025
be6d513
LauncherStartupInfoBuilder: bugfix; CfgFile: remove null defaults
alexeysemenyukoracle Jun 25, 2025
3ecd492
Add LauncherModularStartupInfoMixin.moduleVersion()
alexeysemenyukoracle Jun 10, 2025
8636750
FileAssociationGroup: add FileAssociationGroup.Builder.description()
alexeysemenyukoracle Jun 13, 2025
53fbadb
Add JPackageException to the model
alexeysemenyukoracle Jun 6, 2025
5f075a7
Make ConfigException and PackagerException extend RuntimeException; F…
alexeysemenyukoracle Jun 5, 2025
629510f
ConfigException: extend JPackageException; JPackageException: update …
alexeysemenyukoracle Nov 7, 2025
2bf3f38
Add a builder for LauncherStartupInfo with the unit tests.
alexeysemenyukoracle May 13, 2025
faa0175
Add SetBuilder utility class
alexeysemenyukoracle May 17, 2025
07186c0
Use I18N.buildConfigException() to create ConfigException instances
alexeysemenyukoracle Jun 5, 2025
b2a40e5
Better exception handling in AppImageFile. Better test coverage. Use …
alexeysemenyukoracle Jun 5, 2025
5a5aa0e
the cli: old help output
alexeysemenyukoracle Oct 13, 2025
ac22bca
the cli: old help output reordered and trailing whitespace trimmed
alexeysemenyukoracle Oct 13, 2025
358754d
the cli: new help output
alexeysemenyukoracle Oct 13, 2025
3cb2cdc
Add the "cli".
alexeysemenyukoracle Oct 14, 2025
614518b
ApplicationBuilder: add externalApplication()
alexeysemenyukoracle Oct 21, 2025
b2f2287
Get rid of BundlingOperation and BundleCreator classe. Add BundlingOp…
alexeysemenyukoracle Jun 10, 2025
2b76f8b
Add *FromOptions, OptionUtils, DefaultBundlingEnvironment, and TempDi…
alexeysemenyukoracle Jun 10, 2025
f0340d9
Update module-info.java files
alexeysemenyukoracle Jun 10, 2025
c03dbb6
Use cli to parse app image file
alexeysemenyukoracle Sep 24, 2025
33d59cc
Follow up change for ExternalApplication.LauncherInfo change
alexeysemenyukoracle Sep 9, 2025
668395f
Follow up change for ExternalApplication changes
alexeysemenyukoracle Sep 9, 2025
7dfeba6
ModelAsserter: adhoc comparison of model classes created from params …
alexeysemenyukoracle Aug 4, 2025
4906fd5
Remove "params"-related classes
alexeysemenyukoracle Sep 23, 2025
d2c8cc6
WinExeBundler: Strip all but native library specific code
alexeysemenyukoracle Oct 9, 2025
cf08c87
LauncherFromOptions2 -> LauncherFromOptions
alexeysemenyukoracle Sep 23, 2025
dd628a8
Strip ModelAsserter from the DefaultBundlingEnvironment and make it f…
alexeysemenyukoracle Sep 23, 2025
e0512e1
Remove PackagerException
alexeysemenyukoracle Oct 28, 2025
912f428
Remove ApplicationLayoutUtils
alexeysemenyukoracle Sep 23, 2025
7d7efb2
module-info.java cleanup
alexeysemenyukoracle Sep 23, 2025
788b1bf
ApplicationBuilder: simplify; use `error.launcher-duplicate-name` ins…
alexeysemenyukoracle Sep 23, 2025
7e581ab
*Resources.properties: remove obsolete IDs
alexeysemenyukoracle Sep 24, 2025
7d5bdb4
main/Main.java: make it a proxy for the cli's Main
alexeysemenyukoracle Sep 24, 2025
66e2df2
Make jtreg tests work with the cli
alexeysemenyukoracle Sep 24, 2025
b567bea
JPackageToolProvider.java: remove
alexeysemenyukoracle Sep 24, 2025
fc97f88
ErrorTest: follow up for changes in jpackage because of the cli; Main…
alexeysemenyukoracle Sep 24, 2025
c06fca1
Remove redundant copy of ObjectMapper.java
alexeysemenyukoracle Sep 29, 2025
b289bf3
MainResources.properties, MacResources.properties: remove obsolete IDs
alexeysemenyukoracle Sep 30, 2025
e8e2344
Add test to run multiple instances of jpackage tool provider asynchro…
alexeysemenyukoracle Oct 2, 2025
1b88f47
the cli: after params removed
alexeysemenyukoracle Oct 15, 2025
da39bcc
Rework ExternalApplication and AppImageFile
alexeysemenyukoracle Nov 7, 2025
bfa308d
OptionSpecBuilder: bugfix
alexeysemenyukoracle Nov 11, 2025
a041411
StandardOption, HelpResources.properties: split description of the "a…
alexeysemenyukoracle Nov 11, 2025
0448168
Update cli-*.txt help output files
alexeysemenyukoracle Nov 11, 2025
f7de264
MainResources.properties: remove unreferenced L10N key
alexeysemenyukoracle Nov 12, 2025
470d74c
Validator: formatting
alexeysemenyukoracle Nov 13, 2025
54e5fb2
StandardValidator: expose
alexeysemenyukoracle Nov 13, 2025
4dc4c67
Fix findings in the code review
alexeysemenyukoracle Nov 14, 2025
cfe8693
Fix typo and trailing whitespace
alexeysemenyukoracle Nov 14, 2025
862285d
Removed commented out code
alexeysemenyukoracle Nov 14, 2025
a926aaa
StandardValidator: rename IS_EXISTENT_NOT_DIRECTORY into IS_FILE_OR_S…
alexeysemenyukoracle Nov 15, 2025
1892798
"main.option." -> "help.option."
alexeysemenyukoracle Nov 15, 2025
b7a176b
PackageType: minor
alexeysemenyukoracle Nov 16, 2025
474d0af
the cli: Options: add copyWithDefaultValue(WithOptionIdentifier withI…
alexeysemenyukoracle Nov 16, 2025
aa57979
Merge branch 'master' into JDK-8333727
alexeysemenyukoracle Nov 17, 2025
bee331c
AsyncTest: call javac and jar tool providers only once for all async …
alexeysemenyukoracle Nov 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/jdk.internal.opt/share/classes/module-info.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -32,6 +32,7 @@
exports jdk.internal.joptsimple to
jdk.jlink,
jdk.jshell,
jdk.jpackage,
jdk.jdeps;
exports jdk.internal.opt to
jdk.compiler,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
/*
* Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package jdk.jpackage.internal;

import static java.util.stream.Collectors.toMap;
import static jdk.jpackage.internal.LinuxFromOptions.createLinuxApplication;
import static jdk.jpackage.internal.LinuxPackagingPipeline.APPLICATION_LAYOUT;
import static jdk.jpackage.internal.cli.StandardBundlingOperation.CREATE_LINUX_APP_IMAGE;
import static jdk.jpackage.internal.cli.StandardBundlingOperation.CREATE_LINUX_DEB;
import static jdk.jpackage.internal.cli.StandardBundlingOperation.CREATE_LINUX_RPM;

import java.util.Map;
import java.util.Optional;
import java.util.stream.Stream;
import jdk.jpackage.internal.cli.Options;
import jdk.jpackage.internal.cli.StandardBundlingOperation;
import jdk.jpackage.internal.model.BundlingOperationDescriptor;
import jdk.jpackage.internal.model.LinuxPackage;
import jdk.jpackage.internal.model.PackageType;
import jdk.jpackage.internal.util.Result;

public class LinuxBundlingEnvironment extends DefaultBundlingEnvironment {

public LinuxBundlingEnvironment() {
super(build()
.defaultOperation(() -> {
return LazyLoad.SYS_ENV.value().map(LinuxSystemEnvironment::nativePackageType).map(DESCRIPTORS::get);
})
.bundler(CREATE_LINUX_APP_IMAGE, LinuxBundlingEnvironment::createAppImage)
.bundler(CREATE_LINUX_DEB, LazyLoad::debSysEnv, LinuxBundlingEnvironment::createDebPackage)
.bundler(CREATE_LINUX_RPM, LazyLoad::rpmSysEnv, LinuxBundlingEnvironment::createRpmPackage));
}

private static void createDebPackage(Options options, LinuxDebSystemEnvironment sysEnv) {

createNativePackage(options,
LinuxFromOptions::createLinuxDebPackage,
buildEnv()::create,
LinuxBundlingEnvironment::buildPipeline,
(env, pkg, outputDir) -> {
return new LinuxDebPackager(env, pkg, outputDir, sysEnv);
});
}

private static void createRpmPackage(Options options, LinuxRpmSystemEnvironment sysEnv) {

createNativePackage(options,
LinuxFromOptions::createLinuxRpmPackage,
buildEnv()::create,
LinuxBundlingEnvironment::buildPipeline,
(env, pkg, outputDir) -> {
return new LinuxRpmPackager(env, pkg, outputDir, sysEnv);
});
}

private static void createAppImage(Options options) {

final var app = createLinuxApplication(options);

createApplicationImage(options, app, LinuxPackagingPipeline.build(Optional.empty()));
}

private static PackagingPipeline.Builder buildPipeline(LinuxPackage pkg) {
return LinuxPackagingPipeline.build(Optional.of(pkg));
}

private static BuildEnvFromOptions buildEnv() {
return new BuildEnvFromOptions().predefinedAppImageLayout(APPLICATION_LAYOUT);
}

private static final class LazyLoad {

static Result<LinuxDebSystemEnvironment> debSysEnv() {
return DEB_SYS_ENV;
}

static Result<LinuxRpmSystemEnvironment> rpmSysEnv() {
return RPM_SYS_ENV;
}

private static final Result<LinuxSystemEnvironment> SYS_ENV = LinuxSystemEnvironment.create();

private static final Result<LinuxDebSystemEnvironment> DEB_SYS_ENV = LinuxDebSystemEnvironment.create(SYS_ENV);

private static final Result<LinuxRpmSystemEnvironment> RPM_SYS_ENV = LinuxRpmSystemEnvironment.create(SYS_ENV);
}

private static final Map<PackageType, BundlingOperationDescriptor> DESCRIPTORS = Stream.of(
CREATE_LINUX_DEB,
CREATE_LINUX_RPM
).collect(toMap(StandardBundlingOperation::packageType, StandardBundlingOperation::descriptor));
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
/*
* Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package jdk.jpackage.internal;

import static jdk.jpackage.internal.FromOptions.buildApplicationBuilder;
import static jdk.jpackage.internal.FromOptions.createPackageBuilder;
import static jdk.jpackage.internal.LinuxPackagingPipeline.APPLICATION_LAYOUT;
import static jdk.jpackage.internal.cli.StandardOption.LINUX_APP_CATEGORY;
import static jdk.jpackage.internal.cli.StandardOption.LINUX_DEB_MAINTAINER_EMAIL;
import static jdk.jpackage.internal.cli.StandardOption.LINUX_MENU_GROUP;
import static jdk.jpackage.internal.cli.StandardOption.LINUX_PACKAGE_DEPENDENCIES;
import static jdk.jpackage.internal.cli.StandardOption.LINUX_PACKAGE_NAME;
import static jdk.jpackage.internal.cli.StandardOption.LINUX_RELEASE;
import static jdk.jpackage.internal.cli.StandardOption.LINUX_RPM_LICENSE_TYPE;
import static jdk.jpackage.internal.cli.StandardOption.LINUX_SHORTCUT_HINT;
import static jdk.jpackage.internal.model.StandardPackageType.LINUX_DEB;
import static jdk.jpackage.internal.model.StandardPackageType.LINUX_RPM;

import jdk.jpackage.internal.cli.Options;
import jdk.jpackage.internal.model.Launcher;
import jdk.jpackage.internal.model.LinuxApplication;
import jdk.jpackage.internal.model.LinuxDebPackage;
import jdk.jpackage.internal.model.LinuxLauncher;
import jdk.jpackage.internal.model.LinuxLauncherMixin;
import jdk.jpackage.internal.model.LinuxRpmPackage;
import jdk.jpackage.internal.model.StandardPackageType;

final class LinuxFromOptions {

static LinuxApplication createLinuxApplication(Options options) {

final var launcherFromOptions = new LauncherFromOptions().faWithDefaultDescription();

final var appBuilder = buildApplicationBuilder().create(options, launcherOptions -> {

final var launcher = launcherFromOptions.create(launcherOptions);

final var shortcut = LINUX_SHORTCUT_HINT.findIn(launcherOptions);

return LinuxLauncher.create(launcher, new LinuxLauncherMixin.Stub(shortcut));

}, (LinuxLauncher linuxLauncher, Launcher launcher) -> {
return LinuxLauncher.create(launcher, linuxLauncher);
}, APPLICATION_LAYOUT);

appBuilder.launchers().map(LinuxPackagingPipeline::normalizeShortcuts).ifPresent(appBuilder::launchers);

return LinuxApplication.create(appBuilder.create());
}

static LinuxRpmPackage createLinuxRpmPackage(Options options) {

final var superPkgBuilder = createLinuxPackageBuilder(options, LINUX_RPM);

final var pkgBuilder = new LinuxRpmPackageBuilder(superPkgBuilder);

LINUX_RPM_LICENSE_TYPE.ifPresentIn(options, pkgBuilder::licenseType);

return pkgBuilder.create();
}

static LinuxDebPackage createLinuxDebPackage(Options options) {

final var superPkgBuilder = createLinuxPackageBuilder(options, LINUX_DEB);

final var pkgBuilder = new LinuxDebPackageBuilder(superPkgBuilder);

LINUX_DEB_MAINTAINER_EMAIL.ifPresentIn(options, pkgBuilder::maintainerEmail);

final var pkg = pkgBuilder.create();

// Show warning if license file is missing
if (pkg.licenseFile().isEmpty()) {
Log.verbose(I18N.getString("message.debs-like-licenses"));
}

return pkg;
}

private static LinuxPackageBuilder createLinuxPackageBuilder(Options options, StandardPackageType type) {

final var app = createLinuxApplication(options);

final var superPkgBuilder = createPackageBuilder(options, app, type);

final var pkgBuilder = new LinuxPackageBuilder(superPkgBuilder);

LINUX_PACKAGE_DEPENDENCIES.ifPresentIn(options, pkgBuilder::additionalDependencies);
LINUX_APP_CATEGORY.ifPresentIn(options, pkgBuilder::category);
LINUX_MENU_GROUP.ifPresentIn(options, pkgBuilder::menuGroupName);
LINUX_RELEASE.ifPresentIn(options, pkgBuilder::release);
LINUX_PACKAGE_NAME.ifPresentIn(options, pkgBuilder::literalName);

return pkgBuilder;
}

}
Loading