1- // swift-tools-version:5.5
1+ // swift-tools-version: 5.6
22
33import PackageDescription
44
@@ -14,100 +14,99 @@ let package = Package(
1414 . library( name: " SwiftStandAlone " , targets: [ " SwiftStandAlone " ] ) ,
1515 . library( name: " KotlinStandAlone " , targets: [ " KotlinStandAlone " ] ) ,
1616 . library( name: " LexiconGenerators " , targets: [ " LexiconGenerators " ] ) ,
17+ . executable( name: " lexicon-generate " , targets: [ " lexicon-generate " ] ) ,
18+ . plugin( name: " SwiftStandAloneGeneratorPlugin " , targets: [ " SwiftStandAloneGeneratorPlugin " ] ) ,
19+ . plugin( name: " SwiftLibraryGeneratorPlugin " , targets: [ " SwiftLibraryGeneratorPlugin " ] ) ,
1720 ] ,
1821 dependencies: [
19- . package ( url: " https://github.com/screensailor/Hope " , . branch( " trunk " ) ) ,
22+ . package ( url: " https://github.com/screensailor/Hope " , branch: " trunk " ) ,
2023 . package ( url: " https://github.com/apple/swift-collections " , from: " 1.0.0 " ) ,
24+ . package ( url: " https://github.com/apple/swift-argument-parser " , from: " 1.1.2 " )
2125 ] ,
2226 targets: [
23-
24- // MARK: Lexicon
25-
2627 . target(
2728 name: " Lexicon " ,
2829 dependencies: [
2930 . product( name: " Collections " , package : " swift-collections " )
3031 ] ,
31- swiftSettings: [ . define( " EDITOR " ) ] // TODO: meke this opt in
32+ swiftSettings: [ . define( " EDITOR " ) ] // TODO: make this opt in
3233 ) ,
3334 . testTarget(
3435 name: " LexiconTests " ,
3536 dependencies: [
3637 " Hope " ,
3738 " Lexicon "
3839 ] ,
39- resources: [
40- . copy( " Resources " )
40+ resources: [ . copy( " Resources " ) ]
41+ ) ,
42+ . target(
43+ name: " LexiconGenerators " ,
44+ dependencies: [
45+ " Lexicon " ,
46+ " SwiftLexicon " ,
47+ " SwiftStandAlone " ,
48+ " KotlinStandAlone "
49+ ]
50+ ) ,
51+ . target(
52+ name: " SwiftLexicon " ,
53+ dependencies: [
54+ " Lexicon "
4155 ]
4256 ) ,
43-
44- // MARK: LexiconGenerators
45-
46- . target(
47- name: " LexiconGenerators " ,
48- dependencies: [
49- " Lexicon " ,
50- " SwiftLexicon " ,
51- " SwiftStandAlone " ,
52- " KotlinStandAlone "
53- ]
54- ) ,
55-
56- // MARK: SwiftLexicon
57-
58- . target(
59- name: " SwiftLexicon " ,
60- dependencies: [
61- " Lexicon " ,
62- ]
63- ) ,
6457 . testTarget(
6558 name: " SwiftLexiconTests " ,
6659 dependencies: [
6760 " Hope " ,
6861 " SwiftLexicon "
6962 ] ,
70- resources: [
71- . copy( " Resources " ) ,
63+ resources: [ . copy( " Resources " ) ]
64+ ) ,
65+ . target(
66+ name: " SwiftStandAlone " ,
67+ dependencies: [
68+ " Lexicon " ,
7269 ]
7370 ) ,
74-
75- // MARK: SwiftStandAlone
76-
77- . target(
78- name: " SwiftStandAlone " ,
79- dependencies: [
80- " Lexicon " ,
81- ]
82- ) ,
8371 . testTarget(
8472 name: " SwiftStandAloneTests " ,
8573 dependencies: [
8674 " Hope " ,
8775 " SwiftStandAlone "
8876 ] ,
89- resources: [
90- . copy( " Resources " ) ,
77+ resources: [ . copy( " Resources " ) ]
78+ ) ,
79+ . target(
80+ name: " KotlinStandAlone " ,
81+ dependencies: [
82+ " Lexicon " ,
9183 ]
9284 ) ,
93-
94- // MARK: KotlinStandAlones
95-
96- . target(
97- name: " KotlinStandAlone " ,
98- dependencies: [
99- " Lexicon " ,
100- ]
101- ) ,
10285 . testTarget(
10386 name: " KotlinStandAloneTests " ,
10487 dependencies: [
10588 " Hope " ,
10689 " KotlinStandAlone "
10790 ] ,
108- resources: [
109- . copy( " Resources " ) ,
91+ resources: [ . copy( " Resources " ) ]
92+ ) ,
93+ . executableTarget(
94+ name: " lexicon-generate " ,
95+ dependencies: [
96+ . target( name: " LexiconGenerators " ) ,
97+ . product( name: " ArgumentParser " , package : " swift-argument-parser " ) ,
98+ . product( name: " Collections " , package : " swift-collections " )
11099 ]
111100 ) ,
101+ . plugin(
102+ name: " SwiftStandAloneGeneratorPlugin " ,
103+ capability: . buildTool( ) ,
104+ dependencies: [ " lexicon-generate " ]
105+ ) ,
106+ . plugin(
107+ name: " SwiftLibraryGeneratorPlugin " ,
108+ capability: . buildTool( ) ,
109+ dependencies: [ " lexicon-generate " ]
110+ )
112111 ]
113112)
0 commit comments