This repository has been archived by the owner on Apr 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathPackage.swift
100 lines (94 loc) · 3.01 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
// swift-tools-version:5.2
// The swift-tools-version declares the minimum version of Swift required to build this package.
//
// Copyright 2018 Vinicius Jorge Vendramini
//
// Gryphon - Copyright (2018) Vinícius Jorge Vendramini (“Licensor”)
// Licensed under the Hippocratic License, Version 2.1 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://firstdonoharm.dev/version/2/1/license
//
// To the full extent allowed by law, this software comes "AS IS,"
// WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED, and licensor and any other
// contributor shall not be liable to anyone for any damages or other
// liability arising from, out of, or in connection with the sotfware
// or this license, under any kind of legal claim.
// See the License for the specific language governing permissions and
// limitations under the License.
//
import PackageDescription
// To use a beta version of SwiftSyntax:
//
//let swiftSyntaxPackage = Package.Dependency.package(
// url: "https://github.com/apple/swift-syntax.git",
// .revision("release/5.6")) // <- git branch name
// Which SwiftSyntax version to use
#if swift(>=5.6)
let swiftSyntaxPackage = Package.Dependency.package(
name: "SwiftSyntax",
url: "https://github.com/apple/swift-syntax.git",
.exact("0.50600.1"))
#elseif swift(>=5.5)
let swiftSyntaxPackage = Package.Dependency.package(
name: "SwiftSyntax",
url: "https://github.com/apple/swift-syntax.git",
.exact("0.50500.0"))
#elseif swift(>=5.4)
let swiftSyntaxPackage = Package.Dependency.package(
name: "SwiftSyntax",
url: "https://github.com/apple/swift-syntax.git",
.exact("0.50400.0"))
#elseif swift(>=5.3)
let swiftSyntaxPackage = Package.Dependency.package(
name: "SwiftSyntax",
url: "https://github.com/apple/swift-syntax.git",
.exact("0.50300.0"))
#else
let swiftSyntaxPackage = Package.Dependency.package(
name: "SwiftSyntax",
url: "https://github.com/apple/swift-syntax.git",
.exact("0.50200.0"))
#endif
// Which modules to import from SwiftSyntax (and SourceKitten)
#if swift(>=5.6)
let gryphonLibDependencies: [Target.Dependency] = [
.product(name: "SwiftSyntax", package: "SwiftSyntax"),
.product(name: "SwiftSyntaxParser", package: "SwiftSyntax"),
.product(name: "SourceKittenFramework", package: "SourceKitten")
]
#else
let gryphonLibDependencies: [Target.Dependency] = [
.product(name: "SwiftSyntax", package: "SwiftSyntax"),
.product(name: "SourceKittenFramework", package: "SourceKitten")
]
#endif
let package = Package(
name: "Gryphon",
platforms: [
.macOS(.v10_13)
/* Linux */
],
products: [
.executable(name: "gryphon", targets: ["Gryphon"])
],
dependencies: [
swiftSyntaxPackage,
.package(
url: "https://github.com/jpsim/SourceKitten",
from: "0.31.1"),
],
targets: [
.target(
name: "GryphonLib",
dependencies: gryphonLibDependencies),
.target(
name: "Gryphon",
dependencies: ["GryphonLib"]),
.testTarget(
name: "GryphonLibTests",
dependencies: ["GryphonLib"])
],
swiftLanguageVersions: [.v5]
)