Skip to content

Commit d4bfcae

Browse files
committed
Update for Swift 6.1
1 parent 609c4dd commit d4bfcae

1 file changed

Lines changed: 3 additions & 39 deletions

File tree

Package.swift

Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,13 @@
1-
// swift-tools-version: 6.0
2-
// The swift-tools-version declares the minimum version of Swift required to build this package.
3-
4-
import CompilerPluginSupport
1+
// swift-tools-version: 6.1
52
import PackageDescription
63

74
import class Foundation.FileManager
85
import class Foundation.ProcessInfo
96

10-
// Note: the JAVA_HOME environment variable must be set to point to where
11-
// Java is installed, e.g.,
12-
// Library/Java/JavaVirtualMachines/openjdk-21.jdk/Contents/Home.
13-
func findJavaHome() -> String {
14-
if let home = ProcessInfo.processInfo.environment["JAVA_HOME"] {
15-
return home
16-
}
17-
18-
// This is a workaround for envs (some IDEs) which have trouble with
19-
// picking up env variables during the build process
20-
let path = "\(FileManager.default.homeDirectoryForCurrentUser.path()).java_home"
21-
if let home = try? String(contentsOfFile: path, encoding: .utf8) {
22-
if let lastChar = home.last, lastChar.isNewline {
23-
return String(home.dropLast())
24-
}
25-
26-
return home
27-
}
28-
29-
fatalError("Please set the JAVA_HOME environment variable to point to where Java is installed.")
30-
}
31-
let javaHome = findJavaHome()
32-
33-
let javaIncludePath = "\(javaHome)/include"
34-
#if os(Linux)
35-
let javaPlatformIncludePath = "\(javaIncludePath)/linux"
36-
#elseif os(macOS)
37-
let javaPlatformIncludePath = "\(javaIncludePath)/darwin"
38-
#elseif os(Windows)
39-
let javaPlatformIncludePath = "\(javaIncludePath)/win32"
40-
#endif
41-
427
let package = Package(
438
name: "AndroidSwiftUI",
449
platforms: [
45-
.macOS(.v10_15)
10+
.macOS(.v15)
4611
],
4712
products: [
4813
.library(
@@ -74,8 +39,7 @@ let package = Package(
7439
)
7540
],
7641
swiftSettings: [
77-
.swiftLanguageMode(.v5),
78-
.unsafeFlags(["-I\(javaIncludePath)", "-I\(javaPlatformIncludePath)"]),
42+
.swiftLanguageMode(.v5)
7943
]
8044
)
8145
]

0 commit comments

Comments
 (0)