Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
3811c02
Support async test execution in jpackage test lib
alexeysemenyukoracle Oct 2, 2025
b1e9f59
LauncherStartupInfoBuilder: bugfix; CfgFile: remove null defaults
alexeysemenyukoracle Jun 25, 2025
2736662
ApplicationBuilder: add externalApplication() and mainLauncherClassNa…
alexeysemenyukoracle Jun 13, 2025
cb34ddb
Add ObjectMapper: map any object into a property map; fully functiona…
alexeysemenyukoracle May 13, 2025
8204895
Add LauncherModularStartupInfoMixin.moduleVersion()
alexeysemenyukoracle Jun 10, 2025
723485d
FileAssociationGroup: add FileAssociationGroup.Builder.description()
alexeysemenyukoracle Jun 13, 2025
18a3baa
Add JPackageException to the model
alexeysemenyukoracle Jun 6, 2025
3bb3fe1
Make ConfigException and PackagerException extend RuntimeException; F…
alexeysemenyukoracle Jun 5, 2025
9fb1fdd
Add a builder for LauncherStartupInfo with the unit tests.
alexeysemenyukoracle May 13, 2025
964d611
Add SetBuilder utility class
alexeysemenyukoracle May 17, 2025
bef114b
Use I18N.buildConfigException() to create ConfigException instances
alexeysemenyukoracle Jun 5, 2025
04976cf
Add misc JUnitUtils test utils class with tests
alexeysemenyukoracle Jun 6, 2025
f84e279
Better exception handling in AppImageFile. Better test coverage. Use …
alexeysemenyukoracle Jun 5, 2025
0a24cc3
Add the "cli".
alexeysemenyukoracle Jun 6, 2025
6ce3332
Add JLinkRuntimeBuilder.ensureBaseModuleInModulePath()
alexeysemenyukoracle Jun 13, 2025
fe4a45c
Get rid of BundlingOperation and BundleCreator classe. Add BundlingOp…
alexeysemenyukoracle Jun 10, 2025
9b97e36
Add *FromOptions, OptionUtils, DefaultBundlingEnvironment, and TempDi…
alexeysemenyukoracle Jun 10, 2025
6167b03
Update module-info.java files
alexeysemenyukoracle Jun 10, 2025
79068b2
Use cli to parse app image file
alexeysemenyukoracle Sep 24, 2025
cfa1798
Follow up change for ExternalApplication.LauncherInfo change
alexeysemenyukoracle Sep 9, 2025
837a259
Follow up change for ExternalApplication changes
alexeysemenyukoracle Sep 9, 2025
980276b
ModelAsserter: adhoc comparison of model classes created from params …
alexeysemenyukoracle Aug 4, 2025
4d54c0a
Remove "params"-related classes
alexeysemenyukoracle Sep 23, 2025
0b6e13e
LauncherFromOptions2 -> LauncherFromOptions
alexeysemenyukoracle Sep 23, 2025
4ac718d
Strip all but native methods from WinExeBundler
alexeysemenyukoracle Sep 23, 2025
42fa844
Strip ModelAsserter from the DefaultBundlingEnvironment and make it f…
alexeysemenyukoracle Sep 23, 2025
24e9726
Remove PackagerException
alexeysemenyukoracle Sep 23, 2025
c49bc36
Remove ApplicationLayoutUtils
alexeysemenyukoracle Sep 23, 2025
f8e6bfd
module-info.java cleanup
alexeysemenyukoracle Sep 23, 2025
7a51ed9
Run more tests
alexeysemenyukoracle Sep 23, 2025
31b7ad0
Use `error.launcher-duplicate-name` instead of `ERR_NoUniqueName` in …
alexeysemenyukoracle Sep 23, 2025
a9870f5
*Resources.properties: remove obsolete IDs
alexeysemenyukoracle Sep 24, 2025
7ec985a
main/Main.java: make it a proxy for the cli's Main
alexeysemenyukoracle Sep 24, 2025
b96eead
Make jtreg tests work with the cli
alexeysemenyukoracle Sep 24, 2025
ff57487
JPackageToolProvider.java: remove
alexeysemenyukoracle Sep 24, 2025
729a08e
ErrorTest: follow up for changes in jpackage because of the cli; Main…
alexeysemenyukoracle Sep 24, 2025
1789035
Remove redundant copy of ObjectMapper.java
alexeysemenyukoracle Sep 29, 2025
77d01a9
MainResources.properties: remove obsolete IDs
alexeysemenyukoracle Sep 30, 2025
b3be7ff
Add test to run multiple instances of jpackage tool provider asynchro…
alexeysemenyukoracle Oct 2, 2025
9bea5fc
Update test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/…
alexeysemenyukoracle Oct 3, 2025
41d82d8
Update test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/…
alexeysemenyukoracle Oct 3, 2025
475ab04
Update test/jdk/tools/jpackage/junit/share/jdk.jpackage/jdk/jpackage/…
alexeysemenyukoracle Oct 3, 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
1 change: 1 addition & 0 deletions src/jdk.internal.opt/share/classes/module-info.java
Original file line number Diff line number Diff line change
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,108 @@
/*
* 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.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 static java.util.stream.Collectors.toMap;
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.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 optionValues, LinuxDebSystemEnvironment sysEnv) {

createNativePackage(optionValues,
LinuxFromOptions::createLinuxDebPackage,
buildEnv()::create,
LinuxPackagingPipeline.build(),
(env, pkg, outputDir) -> {
return new LinuxDebPackager(env, pkg, outputDir, sysEnv);
});
}

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

createNativePackage(optionValues,
LinuxFromOptions::createLinuxRpmPackage,
buildEnv()::create,
LinuxPackagingPipeline.build(),
(env, pkg, outputDir) -> {
return new LinuxRpmPackager(env, pkg, outputDir, sysEnv);
});
}

private static void createAppImage(Options optionValues) {

final var app = createLinuxApplication(optionValues);

createApplicationImage(optionValues, app, LinuxPackagingPipeline.build());
}

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 final static 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,115 @@
/*
* 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.FromOptions.findLauncherShortcut;
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.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 optionValues) {

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

final var app = buildApplicationBuilder().create(optionValues, launcherOptionValues -> {

final var launcher = launcherFromOptions.create(launcherOptionValues);

final var shortcut = findLauncherShortcut(LINUX_SHORTCUT_HINT, optionValues, launcherOptionValues);

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

}, APPLICATION_LAYOUT).create();

return LinuxApplication.create(app);
}

static LinuxRpmPackage createLinuxRpmPackage(Options optionValues) {

final var superPkgBuilder = createLinuxPackageBuilder(optionValues, LINUX_RPM);

final var pkgBuilder = new LinuxRpmPackageBuilder(superPkgBuilder);

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

return pkgBuilder.create();
}

static LinuxDebPackage createLinuxDebPackage(Options optionValues) {

final var superPkgBuilder = createLinuxPackageBuilder(optionValues, LINUX_DEB);

final var pkgBuilder = new LinuxDebPackageBuilder(superPkgBuilder);

LINUX_DEB_MAINTAINER_EMAIL.ifPresentIn(optionValues, 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 optionValues, StandardPackageType type) {

final var app = createLinuxApplication(optionValues);

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

final var pkgBuilder = new LinuxPackageBuilder(superPkgBuilder);

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

return pkgBuilder;
}

}
Loading