-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProject+Packages.swift
More file actions
104 lines (92 loc) · 3.49 KB
/
Copy pathProject+Packages.swift
File metadata and controls
104 lines (92 loc) · 3.49 KB
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import ProjectDescription
public enum DevLogPackages {
public static let markdownUIPackage: Package = .package(
url: "https://github.com/gonzalezreal/swift-markdown-ui.git",
.upToNextMajor(from: "2.4.1")
)
public static let swiftCollectionsPackage: Package = .package(
url: "https://github.com/apple/swift-collections.git",
.upToNextMajor(from: "1.3.0")
)
public static let composableArchitecturePackage: Package = .package(
url: "https://github.com/pointfreeco/swift-composable-architecture",
.upToNextMajor(from: "1.25.5")
)
public static let firebasePackage: Package = .package(
url: "https://github.com/firebase/firebase-ios-sdk",
.upToNextMajor(from: "11.15.0")
)
public static let googleSignInPackage: Package = .package(
url: "https://github.com/google/GoogleSignIn-iOS",
.revision("02616ac6b469e8f00212436d2cac16e6efad7954")
)
public static let nexaPackage: Package = .package(
url: "https://github.com/opficdev/Nexa",
.upToNextMajor(from: "1.1.0")
)
public static let presentationPackageDependencies: [TargetDependency] = [
.package(product: "ComposableArchitecture"),
.package(product: "MarkdownUI"),
.package(product: "OrderedCollections"),
]
public static let infraPackageDependencies: [TargetDependency] = [
.package(product: "FirebaseAnalyticsCore"),
.package(product: "FirebaseCore"),
.package(product: "FirebaseFunctions"),
.package(product: "FirebaseAuth"),
.package(product: "FirebaseMessaging"),
.package(product: "FirebaseFirestore"),
.package(product: "GoogleSignIn"),
.package(product: "Nexa"),
]
public static let defaultPackages: [Package] = []
public static let presentationPackages: [Package] = [
composableArchitecturePackage,
markdownUIPackage,
swiftCollectionsPackage,
]
public static let infraPackages: [Package] = [
firebasePackage,
googleSignInPackage,
nexaPackage,
]
}
public enum DevLogScripts {
public static func swiftLint(
sourcePath: String,
configPath: String = "../../.swiftlint.yml"
) -> TargetScript {
TargetScript.pre(
script: """
export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH"
swiftLintPath="$(command -v swiftlint || true)"
if [ -z "$swiftLintPath" ]; then
echo "error: SwiftLint is not installed. Run 'brew install swiftlint'."
exit 1
fi
configPath="${SRCROOT}/\(configPath)"
sourcePathName="\(sourcePath)"
lintSourcePath="${SRCROOT}/${sourcePathName}"
if [ "$sourcePathName" != "." ]; then
"$swiftLintPath" lint --config "$configPath" "$lintSourcePath"
else
swiftFilePaths=()
while IFS= read -r -d '' swiftFilePath; do
swiftFilePaths+=("$swiftFilePath")
done < <(find "$lintSourcePath" -name "*.swift" -not -path "*/Derived/*" -not -name "Project.swift" -print0)
if [ ${#swiftFilePaths[@]} -lt 1 ]; then
exit 0
fi
"$swiftLintPath" lint --config "$configPath" "${swiftFilePaths[@]}"
fi
""",
name: "SwiftLint",
inputPaths: [
"$(SRCROOT)/\(configPath)",
"$(SRCROOT)/\(sourcePath)",
],
basedOnDependencyAnalysis: false,
shellPath: "/bin/bash"
)
}
}