Skip to content

Commit

Permalink
Set macOS min version in plist (#1275)
Browse files Browse the repository at this point in the history
  • Loading branch information
jperedadnr authored Sep 8, 2024
1 parent 28e2103 commit 2851322
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
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

0 comments on commit 2851322

Please sign in to comment.