Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
bb2c491
Make Launcher interface provide complete information about the source…
alexeysemenyukoracle Oct 17, 2025
3dc46b3
LauncherStartupInfoBuilder: bugfix; CfgFile: remove null defaults
alexeysemenyukoracle Jun 25, 2025
8afbd8f
Add LauncherModularStartupInfoMixin.moduleVersion()
alexeysemenyukoracle Jun 10, 2025
2af85ef
FileAssociationGroup: add FileAssociationGroup.Builder.description()
alexeysemenyukoracle Jun 13, 2025
7163799
Add JPackageException to the model
alexeysemenyukoracle Jun 6, 2025
16c6204
Make ConfigException and PackagerException extend RuntimeException; F…
alexeysemenyukoracle Jun 5, 2025
c217ce1
Add a builder for LauncherStartupInfo with the unit tests.
alexeysemenyukoracle May 13, 2025
41d9397
Add SetBuilder utility class
alexeysemenyukoracle May 17, 2025
55db526
Use I18N.buildConfigException() to create ConfigException instances
alexeysemenyukoracle Jun 5, 2025
acfd263
Better exception handling in AppImageFile. Better test coverage. Use …
alexeysemenyukoracle Jun 5, 2025
a7cf7c0
the cli: old help output
alexeysemenyukoracle Oct 13, 2025
e7a70bb
the cli: old help output reordered and trailing whitespace trimmed
alexeysemenyukoracle Oct 13, 2025
2237322
the cli: new help output
alexeysemenyukoracle Oct 13, 2025
5a47732
Add the "cli".
alexeysemenyukoracle Oct 14, 2025
5b84887
ApplicationBuilder: add externalApplication()
alexeysemenyukoracle Oct 21, 2025
26f1af7
Get rid of BundlingOperation and BundleCreator classe. Add BundlingOp…
alexeysemenyukoracle Jun 10, 2025
85d5063
Add *FromOptions, OptionUtils, DefaultBundlingEnvironment, and TempDi…
alexeysemenyukoracle Jun 10, 2025
707cced
Update module-info.java files
alexeysemenyukoracle Jun 10, 2025
41cec17
Use cli to parse app image file
alexeysemenyukoracle Sep 24, 2025
9896b2c
Follow up change for ExternalApplication.LauncherInfo change
alexeysemenyukoracle Sep 9, 2025
344d01b
Follow up change for ExternalApplication changes
alexeysemenyukoracle Sep 9, 2025
bca7f35
ModelAsserter: adhoc comparison of model classes created from params …
alexeysemenyukoracle Aug 4, 2025
b9fbe2f
Remove "params"-related classes
alexeysemenyukoracle Sep 23, 2025
bf158aa
WinExeBundler: Strip all but native library specific code
alexeysemenyukoracle Oct 9, 2025
44a8674
LauncherFromOptions2 -> LauncherFromOptions
alexeysemenyukoracle Sep 23, 2025
3d6f3d4
Strip ModelAsserter from the DefaultBundlingEnvironment and make it f…
alexeysemenyukoracle Sep 23, 2025
1f8ec4b
Remove PackagerException
alexeysemenyukoracle Sep 23, 2025
695adba
Remove ApplicationLayoutUtils
alexeysemenyukoracle Sep 23, 2025
cf31b9f
module-info.java cleanup
alexeysemenyukoracle Sep 23, 2025
b7b468b
ApplicationBuilder: simplify; use `error.launcher-duplicate-name` ins…
alexeysemenyukoracle Sep 23, 2025
4b9bf0f
*Resources.properties: remove obsolete IDs
alexeysemenyukoracle Sep 24, 2025
131f7d1
main/Main.java: make it a proxy for the cli's Main
alexeysemenyukoracle Sep 24, 2025
80c7057
Make jtreg tests work with the cli
alexeysemenyukoracle Sep 24, 2025
ce52a9b
JPackageToolProvider.java: remove
alexeysemenyukoracle Sep 24, 2025
a52d9c2
ErrorTest: follow up for changes in jpackage because of the cli; Main…
alexeysemenyukoracle Sep 24, 2025
76129b8
Remove redundant copy of ObjectMapper.java
alexeysemenyukoracle Sep 29, 2025
da1ac2d
MainResources.properties, MacResources.properties: remove obsolete IDs
alexeysemenyukoracle Sep 30, 2025
1339971
Add test to run multiple instances of jpackage tool provider asynchro…
alexeysemenyukoracle Oct 2, 2025
0e7334e
the cli: after params removed
alexeysemenyukoracle Oct 15, 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
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,10 @@

import static jdk.jpackage.internal.ApplicationImageUtils.createLauncherIconResource;
import static jdk.jpackage.internal.model.LauncherShortcut.toRequest;
import static jdk.jpackage.internal.util.function.ThrowingFunction.toFunction;

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Arrays;
Expand Down Expand Up @@ -82,22 +80,12 @@ private DesktopIntegration(BuildEnv env, LinuxPackage pkg, LinuxLauncher launche
// - user explicitly requested to create a shortcut
boolean withDesktopFile = !associations.isEmpty() || toRequest(launcher.shortcut()).orElse(false);

var curIconResource = createLauncherIconResource(pkg.app(), launcher,
env::createResource);

if (curIconResource.isEmpty()) {
if (!launcher.hasIcon()) {
// This is additional launcher with explicit `no icon` configuration.
withDesktopFile = false;
} else {
try {
if (curIconResource.get().saveToFile((Path)null) != OverridableResource.Source.DefaultResource) {
// This launcher has custom icon configured.
withDesktopFile = true;
}
} catch (IOException ex) {
// Should never happen as `saveToFile((Path)null)` should not perform any actual I/O operations.
throw new UncheckedIOException(ex);
}
} else if (launcher.hasCustomIcon()) {
// This launcher has custom icon configured.
withDesktopFile = true;
}

desktopFileResource = env.createResource("template.desktop")
Expand All @@ -119,17 +107,12 @@ private DesktopIntegration(BuildEnv env, LinuxPackage pkg, LinuxLauncher launche
if (withDesktopFile) {
desktopFile = Optional.of(createDesktopFile(desktopFileName));
iconFile = Optional.of(createDesktopFile(escapedAppFileName + ".png"));

if (curIconResource.isEmpty()) {
// Create default icon.
curIconResource = createLauncherIconResource(pkg.app(), pkg.app().mainLauncher().orElseThrow(), env::createResource);
}
} else {
desktopFile = Optional.empty();
iconFile = Optional.empty();
}

iconResource = curIconResource;
iconResource = createLauncherIconResource(launcher, env::createResource);

desktopFileData = createDataForDesktopFile();

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());
}

private static PackagingPipeline.Builder buildPipeline(LinuxPackage pkg) {
return 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 static final Map<PackageType, BundlingOperationDescriptor> DESCRIPTORS = Stream.of(
CREATE_LINUX_DEB,
CREATE_LINUX_RPM
).collect(toMap(StandardBundlingOperation::packageType, StandardBundlingOperation::descriptor));
}

This file was deleted.

Loading