-
Notifications
You must be signed in to change notification settings - Fork 2
/
Package.swift
57 lines (55 loc) · 2.67 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
// swift-tools-version:5.0
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "InjectionLite",
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
// A self-contained of injection including log parsing and recompiling
.library(
name: "InjectionLite",
targets: ["InjectionLite"]),
// This is the in-memory substrate of injection loading a dynamic
// libraray, interposing function pointers, updating class vtables
// and performing old-school "Swizzling" of Objective-c methods.
.library(
name: "InjectionImpl",
targets: ["InjectionImpl"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// Abstraction for performing shell command to grep logs and recompile.
.package(url: "https://github.com/johnno1962/Popen",
.upToNextMajor(from: "2.1.6")),
// An interface to in-memory symbol table of loaded images.
.package(url: "https://github.com/johnno1962/DLKit",
.upToNextMajor(from: "3.4.7")),
// No-fuss regular expressions for conditioning Strings.
.package(url: "https://github.com/johnno1962/SwiftRegex5",
.upToNextMajor(from: "6.1.2")),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
// The stand-alone implementation, delegating actual "swizzing" to InjectionImpl
.target(
name: "InjectionLite",
dependencies: ["InjectionImpl",
// DEBUG_ONLY version of abstraction for popen().
.product(name: "PopenD", package: "Popen")]),
// Implementation of "Swizzling for Swift" using interposing et all.
.target(
name: "InjectionImpl",
dependencies: ["InjectionImplC",
.product(name: "DLKitD", package: "DLKit"), // DEBUG_ONLY versions
.product(name: "SwiftRegexD", package: "SwiftRegex")]),
// Boots up standalone injection on load for InjectionLite product
.target(
name: "InjectionImplC"),
// Yes, there are tests.
.testTarget(
name: "InjectionLiteTests",
dependencies: ["InjectionLite"],
linkerSettings: [.unsafeFlags([
"-Xlinker", "-interposable"])])]
)