From 3293905ad0922b13bbc071650c99a2eb50786244 Mon Sep 17 00:00:00 2001 From: Richard Wei Date: Fri, 15 Apr 2022 22:03:03 -0700 Subject: [PATCH] Fix release build. Move Prototypes to a test target so that it's not built under the release configuration. Disable the PEG prototype in Exercises since it depends on Prototypes. Resolves #288. --- Package.swift | 4 ++-- Sources/Exercises/Exercises.swift | 1 - Sources/Exercises/Participants/PEGParticipant.swift | 4 ++++ {Sources => Tests}/Prototypes/CMakeLists.txt | 0 {Sources => Tests}/Prototypes/Combinators/Combinators.swift | 0 {Sources => Tests}/Prototypes/PEG/PEG.swift | 0 {Sources => Tests}/Prototypes/PEG/PEGCode.swift | 0 {Sources => Tests}/Prototypes/PEG/PEGCompile.swift | 0 {Sources => Tests}/Prototypes/PEG/PEGCore.swift | 0 {Sources => Tests}/Prototypes/PEG/PEGInterpreter.swift | 0 {Sources => Tests}/Prototypes/PEG/PEGTranspile.swift | 0 {Sources => Tests}/Prototypes/PEG/PEGVM.swift | 0 {Sources => Tests}/Prototypes/PEG/PEGVMExecute.swift | 0 {Sources => Tests}/Prototypes/PEG/Printing.swift | 0 {Sources => Tests}/Prototypes/PTCaRet/Interpreter.swift | 0 {Sources => Tests}/Prototypes/PTCaRet/PTCaRet.swift | 0 .../Prototypes/TourOfTypes/CharacterClass.swift | 0 {Sources => Tests}/Prototypes/TourOfTypes/Literal.swift | 0 18 files changed, 6 insertions(+), 3 deletions(-) rename {Sources => Tests}/Prototypes/CMakeLists.txt (100%) rename {Sources => Tests}/Prototypes/Combinators/Combinators.swift (100%) rename {Sources => Tests}/Prototypes/PEG/PEG.swift (100%) rename {Sources => Tests}/Prototypes/PEG/PEGCode.swift (100%) rename {Sources => Tests}/Prototypes/PEG/PEGCompile.swift (100%) rename {Sources => Tests}/Prototypes/PEG/PEGCore.swift (100%) rename {Sources => Tests}/Prototypes/PEG/PEGInterpreter.swift (100%) rename {Sources => Tests}/Prototypes/PEG/PEGTranspile.swift (100%) rename {Sources => Tests}/Prototypes/PEG/PEGVM.swift (100%) rename {Sources => Tests}/Prototypes/PEG/PEGVMExecute.swift (100%) rename {Sources => Tests}/Prototypes/PEG/Printing.swift (100%) rename {Sources => Tests}/Prototypes/PTCaRet/Interpreter.swift (100%) rename {Sources => Tests}/Prototypes/PTCaRet/PTCaRet.swift (100%) rename {Sources => Tests}/Prototypes/TourOfTypes/CharacterClass.swift (100%) rename {Sources => Tests}/Prototypes/TourOfTypes/Literal.swift (100%) diff --git a/Package.swift b/Package.swift index 26b7f90af..f8162e762 100644 --- a/Package.swift +++ b/Package.swift @@ -76,7 +76,7 @@ let package = Package( .unsafeFlags(["-Xfrontend", "-enable-experimental-pairwise-build-block"]), .unsafeFlags(["-Xfrontend", "-disable-availability-checking"]) ]), - .target( + .testTarget( name: "Prototypes", dependencies: ["_RegexParser", "_StringProcessing"], swiftSettings: [ @@ -100,7 +100,7 @@ let package = Package( // MARK: Exercises .target( name: "Exercises", - dependencies: ["_RegexParser", "Prototypes", "_StringProcessing", "RegexBuilder"], + dependencies: ["_RegexParser", "_StringProcessing", "RegexBuilder"], swiftSettings: [ .unsafeFlags(["-Xfrontend", "-enable-experimental-pairwise-build-block"]), .unsafeFlags(["-Xfrontend", "-disable-availability-checking"]) diff --git a/Sources/Exercises/Exercises.swift b/Sources/Exercises/Exercises.swift index f9801ca90..17c1eeb56 100644 --- a/Sources/Exercises/Exercises.swift +++ b/Sources/Exercises/Exercises.swift @@ -16,7 +16,6 @@ public enum Exercises { HandWrittenParticipant.self, RegexDSLParticipant.self, RegexLiteralParticipant.self, - PEGParticipant.self, NSREParticipant.self, ] } diff --git a/Sources/Exercises/Participants/PEGParticipant.swift b/Sources/Exercises/Participants/PEGParticipant.swift index 21bec6a7c..8987b6b0c 100644 --- a/Sources/Exercises/Participants/PEGParticipant.swift +++ b/Sources/Exercises/Participants/PEGParticipant.swift @@ -9,6 +9,9 @@ // //===----------------------------------------------------------------------===// +// Disabled because Prototypes is a test target. +#if false + struct PEGParticipant: Participant { static var name: String { "PEG" } } @@ -51,3 +54,4 @@ private func graphemeBreakPropertyData(forLine line: String) -> GraphemeBreakEnt } +#endif diff --git a/Sources/Prototypes/CMakeLists.txt b/Tests/Prototypes/CMakeLists.txt similarity index 100% rename from Sources/Prototypes/CMakeLists.txt rename to Tests/Prototypes/CMakeLists.txt diff --git a/Sources/Prototypes/Combinators/Combinators.swift b/Tests/Prototypes/Combinators/Combinators.swift similarity index 100% rename from Sources/Prototypes/Combinators/Combinators.swift rename to Tests/Prototypes/Combinators/Combinators.swift diff --git a/Sources/Prototypes/PEG/PEG.swift b/Tests/Prototypes/PEG/PEG.swift similarity index 100% rename from Sources/Prototypes/PEG/PEG.swift rename to Tests/Prototypes/PEG/PEG.swift diff --git a/Sources/Prototypes/PEG/PEGCode.swift b/Tests/Prototypes/PEG/PEGCode.swift similarity index 100% rename from Sources/Prototypes/PEG/PEGCode.swift rename to Tests/Prototypes/PEG/PEGCode.swift diff --git a/Sources/Prototypes/PEG/PEGCompile.swift b/Tests/Prototypes/PEG/PEGCompile.swift similarity index 100% rename from Sources/Prototypes/PEG/PEGCompile.swift rename to Tests/Prototypes/PEG/PEGCompile.swift diff --git a/Sources/Prototypes/PEG/PEGCore.swift b/Tests/Prototypes/PEG/PEGCore.swift similarity index 100% rename from Sources/Prototypes/PEG/PEGCore.swift rename to Tests/Prototypes/PEG/PEGCore.swift diff --git a/Sources/Prototypes/PEG/PEGInterpreter.swift b/Tests/Prototypes/PEG/PEGInterpreter.swift similarity index 100% rename from Sources/Prototypes/PEG/PEGInterpreter.swift rename to Tests/Prototypes/PEG/PEGInterpreter.swift diff --git a/Sources/Prototypes/PEG/PEGTranspile.swift b/Tests/Prototypes/PEG/PEGTranspile.swift similarity index 100% rename from Sources/Prototypes/PEG/PEGTranspile.swift rename to Tests/Prototypes/PEG/PEGTranspile.swift diff --git a/Sources/Prototypes/PEG/PEGVM.swift b/Tests/Prototypes/PEG/PEGVM.swift similarity index 100% rename from Sources/Prototypes/PEG/PEGVM.swift rename to Tests/Prototypes/PEG/PEGVM.swift diff --git a/Sources/Prototypes/PEG/PEGVMExecute.swift b/Tests/Prototypes/PEG/PEGVMExecute.swift similarity index 100% rename from Sources/Prototypes/PEG/PEGVMExecute.swift rename to Tests/Prototypes/PEG/PEGVMExecute.swift diff --git a/Sources/Prototypes/PEG/Printing.swift b/Tests/Prototypes/PEG/Printing.swift similarity index 100% rename from Sources/Prototypes/PEG/Printing.swift rename to Tests/Prototypes/PEG/Printing.swift diff --git a/Sources/Prototypes/PTCaRet/Interpreter.swift b/Tests/Prototypes/PTCaRet/Interpreter.swift similarity index 100% rename from Sources/Prototypes/PTCaRet/Interpreter.swift rename to Tests/Prototypes/PTCaRet/Interpreter.swift diff --git a/Sources/Prototypes/PTCaRet/PTCaRet.swift b/Tests/Prototypes/PTCaRet/PTCaRet.swift similarity index 100% rename from Sources/Prototypes/PTCaRet/PTCaRet.swift rename to Tests/Prototypes/PTCaRet/PTCaRet.swift diff --git a/Sources/Prototypes/TourOfTypes/CharacterClass.swift b/Tests/Prototypes/TourOfTypes/CharacterClass.swift similarity index 100% rename from Sources/Prototypes/TourOfTypes/CharacterClass.swift rename to Tests/Prototypes/TourOfTypes/CharacterClass.swift diff --git a/Sources/Prototypes/TourOfTypes/Literal.swift b/Tests/Prototypes/TourOfTypes/Literal.swift similarity index 100% rename from Sources/Prototypes/TourOfTypes/Literal.swift rename to Tests/Prototypes/TourOfTypes/Literal.swift