-
Notifications
You must be signed in to change notification settings - Fork 10
/
Package.swift
79 lines (75 loc) · 3.44 KB
/
Package.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// swift-tools-version:5.4
import PackageDescription
let checksum = "8cf167e95133f3ae9433a7b26aa5d072d67c5328206b7d9a469d0988c92b4462"
let version = "134.0.20241116050309"
let url = "https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/project.application-services.v2.swift.134.20241116050309/artifacts/public/build/MozillaRustComponents.xcframework.zip"
// Focus xcframework
let focusChecksum = "343b226297c57e3197b76100190ee48d74bc40d00e15a46697b8a3bb823ee5d1"
let focusUrl = "https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/project.application-services.v2.swift.134.20241116050309/artifacts/public/build/FocusRustComponents.xcframework.zip"
let package = Package(
name: "MozillaRustComponentsSwift",
platforms: [.iOS(.v14)],
products: [
.library(name: "MozillaAppServices", targets: ["MozillaAppServices"]),
.library(name: "FocusAppServices", targets: ["FocusAppServices"]),
],
dependencies: [
],
targets: [
/*
* A placeholder wrapper for our binaryTarget so that Xcode will ensure this is
* downloaded/built before trying to use it in the build process
* A bit hacky but necessary for now https://github.com/mozilla/application-services/issues/4422
*/
.target(
name: "MozillaRustComponentsWrapper",
dependencies: [
.target(name: "MozillaRustComponents", condition: .when(platforms: [.iOS]))
],
path: "MozillaRustComponentsWrapper"
),
.target(
name: "FocusRustComponentsWrapper",
dependencies: [
.target(name: "FocusRustComponents", condition: .when(platforms: [.iOS]))
],
path: "FocusRustComponentsWrapper"
),
.binaryTarget(
name: "MozillaRustComponents",
//
// For release artifacts, reference the MozillaRustComponents as a URL with checksum.
// IMPORTANT: The checksum has to be on the line directly after the `url`
// this is important for our release script so that all values are updated correctly
url: url,
checksum: checksum
// For local testing, you can point at an (unzipped) XCFramework that's part of the repo.
// Note that you have to actually check it in and make a tag for it to work correctly.
//
//path: "./MozillaRustComponents.xcframework"
),
.binaryTarget(
name: "FocusRustComponents",
//
// For release artifacts, reference the MozillaRustComponents as a URL with checksum.
// IMPORTANT: The checksum has to be on the line directly after the `url`
// this is important for our release script so that all values are updated correctly
url: focusUrl,
checksum: focusChecksum
// For local testing, you can point at an (unzipped) XCFramework that's part of the repo.
// Note that you have to actually check it in and make a tag for it to work correctly.
//
//path: "./FocusRustComponents.xcframework"
),
.target(
name: "MozillaAppServices",
dependencies: ["MozillaRustComponentsWrapper"],
path: "swift-source/all"
),
.target(
name: "FocusAppServices",
dependencies: ["FocusRustComponentsWrapper"],
path: "swift-source/focus"
),
]
)