1111import Basic
1212
1313public enum LibraryType {
14- case Static
15- case Dynamic
14+ case `static`
15+ case `dynamic`
1616}
1717
1818public enum ProductType {
19- case Test
20- case Executable
21- case Library ( LibraryType )
19+ case test
20+ case executable
21+ case library ( LibraryType )
2222}
2323
2424extension ProductType : CustomStringConvertible {
2525 public var description : String {
2626 switch self {
27- case . Test :
27+ case . test :
2828 return " test "
29- case . Executable :
29+ case . executable :
3030 return " exe "
31- case . Library ( . Static ) :
31+ case . library ( . static ) :
3232 return " a "
33- case . Library ( . Dynamic ) :
33+ case . library ( . dynamic ) :
3434 return " dylib "
3535 }
3636 }
@@ -51,7 +51,7 @@ public class Product {
5151
5252 /// Path to the main file for test product on linux.
5353 public var linuxMainTest : AbsolutePath {
54- precondition ( type == . Test , " This property is only valid for test product type " )
54+ precondition ( type == . test , " This property is only valid for test product type " )
5555 // FIXME: This is hacky, we should get this from package builder.
5656 let testDirectory = modules. first { $0. isTest} !. sources. root. parentDirectory
5757 return testDirectory. appending ( component: " LinuxMain.swift " )
@@ -66,13 +66,13 @@ public class Product {
6666
6767 public var outname : RelativePath {
6868 switch type {
69- case . Executable :
69+ case . executable :
7070 return RelativePath ( name)
71- case . Library ( . Static ) :
71+ case . library ( . static ) :
7272 return RelativePath ( " lib \( name) .a " )
73- case . Library ( . Dynamic ) :
73+ case . library ( . dynamic ) :
7474 return RelativePath ( " lib \( name) . \( Product . dynamicLibraryExtension) " )
75- case . Test :
75+ case . test :
7676 let base = " \( name) .xctest "
7777 #if os(macOS)
7878 return RelativePath ( " \( base) /Contents/MacOS/ \( name) " )
@@ -95,7 +95,7 @@ extension Product: CustomStringConvertible {
9595 public var description : String {
9696 let base = outname. basename
9797 switch type {
98- case . Test :
98+ case . test :
9999 return " \( base) .xctest "
100100 default :
101101 return base
@@ -106,17 +106,17 @@ extension Product: CustomStringConvertible {
106106extension ProductType : Equatable { }
107107public func == ( lhs: ProductType , rhs: ProductType ) -> Bool {
108108 switch ( lhs, rhs) {
109- case ( . Executable , . Executable ) :
109+ case ( . executable , . executable ) :
110110 return true
111- case ( . Executable , _) :
111+ case ( . executable , _) :
112112 return false
113- case ( . Test , . Test ) :
113+ case ( . test , . test ) :
114114 return true
115- case ( . Test , _) :
115+ case ( . test , _) :
116116 return false
117- case ( . Library ( let lhsType) , . Library ( let rhsType) ) :
117+ case ( . library ( let lhsType) , . library ( let rhsType) ) :
118118 return lhsType == rhsType
119- case ( . Library ( _) , _) :
119+ case ( . library ( _) , _) :
120120 return false
121121 }
122122}
0 commit comments