-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathPackage.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 = "ed8625487e49f2fb5d4c816a0dd568e1c8eff1e8d2f74ec842423da39223be0a"
let version = "136.0.20250129050329"
let url = "https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/project.application-services.v2.swift.136.20250129050329/artifacts/public/build/MozillaRustComponents.xcframework.zip"
// Focus xcframework
let focusChecksum = "5525071b621a9107412ef967f614365ff53ab99c6df91affd2b505d50a13fbc5"
let focusUrl = "https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/project.application-services.v2.swift.136.20250129050329/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"
),
]
)