Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set macOS min version in plist #1275

Merged
merged 1 commit into from
Sep 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@

public class MacOSTargetConfiguration extends DarwinTargetConfiguration {

private static final String MIN_MACOS_VERSION_AMD64 = "11";
private static final String MIN_MACOS_VERSION_AARCH64 = "12";
public static final String MIN_MACOS_AMD64_VERSION = "11";
public static final String MIN_MACOS_AARCH64_VERSION = "12";

private static final List<String> javaDarwinLibs = Arrays.asList("pthread", "z", "dl", "stdc++");
private static final List<String> javaDarwinFrameworks = Arrays.asList("Foundation", "AppKit");
Expand All @@ -71,7 +71,7 @@ public class MacOSTargetConfiguration extends DarwinTargetConfiguration {

public MacOSTargetConfiguration(ProcessPaths paths, InternalProjectConfiguration configuration) {
super(paths, configuration);
minVersion = Constants.ARCH_AMD64.equals(projectConfiguration.getTargetTriplet().getArch()) ? MIN_MACOS_VERSION_AMD64 : MIN_MACOS_VERSION_AARCH64;
minVersion = Constants.ARCH_AMD64.equals(projectConfiguration.getTargetTriplet().getArch()) ? MIN_MACOS_AMD64_VERSION : MIN_MACOS_AARCH64_VERSION;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, 2021, Gluon
* Copyright (c) 2019, 2024, Gluon
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -36,6 +36,7 @@
import com.gluonhq.substrate.model.InternalProjectConfiguration;
import com.gluonhq.substrate.model.ProcessPaths;
import com.gluonhq.substrate.model.ReleaseConfiguration;
import com.gluonhq.substrate.target.MacOSTargetConfiguration;
import com.gluonhq.substrate.util.FileOps;
import com.gluonhq.substrate.util.Logger;
import com.gluonhq.substrate.util.ProcessRunner;
Expand Down Expand Up @@ -93,6 +94,8 @@ public Path processInfoPlist() throws IOException, InterruptedException {
String appName = projectConfiguration.getAppName();
String executableName = getExecutableName(appName, sourceOS);
String bundleIdName = getBundleId(getPlistPath(paths, sourceOS), projectConfiguration.getAppId());
String minVersion = Constants.ARCH_AMD64.equals(projectConfiguration.getTargetTriplet().getArch()) ?
MacOSTargetConfiguration.MIN_MACOS_AMD64_VERSION : MacOSTargetConfiguration.MIN_MACOS_AARCH64_VERSION;
ReleaseConfiguration releaseConfiguration = projectConfiguration.getReleaseConfiguration();
String bundleName = Objects.requireNonNullElse(releaseConfiguration.getBundleName(), appName);
String bundleVersion = releaseConfiguration.getBundleVersion();
Expand Down Expand Up @@ -162,6 +165,7 @@ public Path processInfoPlist() throws IOException, InterruptedException {
dict.put("CFBundleVersion", bundleVersion);
dict.put("CFBundleShortVersionString", bundleShortVersion);
dict.put("LSApplicationCategoryType", appCategory);
dict.put("LSMinimumSystemVersion", minVersion);
dict.saveAsXML(plist);
} else {
boolean modified = false;
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/native/macosx/assets/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<key>LSApplicationCategoryType</key>
<string>$appCategory</string>
<key>LSMinimumSystemVersion</key>
<string>10.11</string>
<string>$minimumSystemVersion</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleAllowMixedLocalizations</key>
Expand Down
Loading