diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0453133d..15363756 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,3 +15,16 @@ jobs: - uses: swiftwasm/swiftwasm-action@master with: shell-action: swift build --triple wasm32-unknown-wasi --product TokamakDemo + + macos_demo_build: + runs-on: macos-10.15 + + steps: + - uses: actions/checkout@v2 + - name: Build macOS demo code to test compatibility with SwiftUI + shell: bash + run: | + set -ex + sudo xcode-select --switch /Applications/Xcode_12_beta.app/Contents/Developer/ + cd "TokamakDemo Native" + xcodebuild -scheme macOS diff --git a/Sources/TokamakDemo/ListDemo.swift b/Sources/TokamakDemo/ListDemo.swift index 6935e4b8..46332fa0 100644 --- a/Sources/TokamakDemo/ListDemo.swift +++ b/Sources/TokamakDemo/ListDemo.swift @@ -49,6 +49,5 @@ public struct ListDemo: View { } } } - .listStyle(InsetGroupedListStyle()) } } diff --git a/Sources/TokamakDemo/OutlineGroupDemo.swift b/Sources/TokamakDemo/OutlineGroupDemo.swift index 5b1ce318..bcc4627d 100644 --- a/Sources/TokamakDemo/OutlineGroupDemo.swift +++ b/Sources/TokamakDemo/OutlineGroupDemo.swift @@ -15,7 +15,11 @@ // Created by Carson Katri on 7/3/20. // +#if canImport(SwiftUI) +import SwiftUI +#else import TokamakDOM +#endif struct File: Identifiable { let id: Int @@ -23,6 +27,7 @@ struct File: Identifiable { let children: [File]? } +@available(OSX 10.16, *) struct OutlineGroupDemo: View { let fs: [File] = [ .init(id: 0, name: "Users", children: [ diff --git a/Sources/TokamakDemo/TokamakDemo.swift b/Sources/TokamakDemo/TokamakDemo.swift index 8db66ad7..5e56f0af 100644 --- a/Sources/TokamakDemo/TokamakDemo.swift +++ b/Sources/TokamakDemo/TokamakDemo.swift @@ -51,8 +51,14 @@ struct TokamakDemoView: View { SpacerDemo() EnvironmentDemo() .font(.system(size: 8)) + #if canImport(TokamakDOM) + ListDemo().listStyle(InsetGroupedListStyle()) + #else ListDemo() - OutlineGroupDemo() + #endif + if #available(OSX 10.16, *) { + OutlineGroupDemo() + } } } } diff --git a/TokamakDemo Native/TokamakDemo Native.xcodeproj/project.pbxproj b/TokamakDemo Native/TokamakDemo Native.xcodeproj/project.pbxproj index 0bd67c0c..0f9f63a5 100644 --- a/TokamakDemo Native/TokamakDemo Native.xcodeproj/project.pbxproj +++ b/TokamakDemo Native/TokamakDemo Native.xcodeproj/project.pbxproj @@ -25,6 +25,10 @@ 85ED18AF24AD425E0085DFA0 /* EnvironmentDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85ED18A024AD425E0085DFA0 /* EnvironmentDemo.swift */; }; 85ED18B024AD425E0085DFA0 /* EnvironmentDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85ED18A024AD425E0085DFA0 /* EnvironmentDemo.swift */; }; 85ED18B624AD42D70085DFA0 /* NSAppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85ED189424AD41B90085DFA0 /* NSAppDelegate.swift */; }; + D1B4229024B3B9BB00682F74 /* ListDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1B4228E24B3B9BB00682F74 /* ListDemo.swift */; }; + D1B4229124B3B9BB00682F74 /* ListDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1B4228E24B3B9BB00682F74 /* ListDemo.swift */; }; + D1B4229224B3B9BB00682F74 /* OutlineGroupDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1B4228F24B3B9BB00682F74 /* OutlineGroupDemo.swift */; }; + D1B4229324B3B9BB00682F74 /* OutlineGroupDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1B4228F24B3B9BB00682F74 /* OutlineGroupDemo.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -43,6 +47,8 @@ 85ED18A024AD425E0085DFA0 /* EnvironmentDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EnvironmentDemo.swift; sourceTree = ""; }; 85ED18BD24AD46340085DFA0 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 85ED18BF24AD464B0085DFA0 /* iOS Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "iOS Info.plist"; sourceTree = ""; }; + D1B4228E24B3B9BB00682F74 /* ListDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListDemo.swift; sourceTree = ""; }; + D1B4228F24B3B9BB00682F74 /* OutlineGroupDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OutlineGroupDemo.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -89,6 +95,8 @@ 85ED189924AD425E0085DFA0 /* TokamakDemo */ = { isa = PBXGroup; children = ( + D1B4228E24B3B9BB00682F74 /* ListDemo.swift */, + D1B4228F24B3B9BB00682F74 /* OutlineGroupDemo.swift */, 85ED189A24AD425E0085DFA0 /* SpacerDemo.swift */, 85ED189B24AD425E0085DFA0 /* TextDemo.swift */, 85ED189C24AD425E0085DFA0 /* ForEachDemo.swift */, @@ -201,8 +209,10 @@ buildActionMask = 2147483647; files = ( 85ED186A24AD38F20085DFA0 /* UIAppDelegate.swift in Sources */, + D1B4229224B3B9BB00682F74 /* OutlineGroupDemo.swift in Sources */, 85ED18AF24AD425E0085DFA0 /* EnvironmentDemo.swift in Sources */, 85ED18A324AD425E0085DFA0 /* SpacerDemo.swift in Sources */, + D1B4229024B3B9BB00682F74 /* ListDemo.swift in Sources */, 85ED18A924AD425E0085DFA0 /* TokamakDemo.swift in Sources */, 85ED18AD24AD425E0085DFA0 /* TextFieldDemo.swift in Sources */, 85ED18A724AD425E0085DFA0 /* ForEachDemo.swift in Sources */, @@ -216,8 +226,10 @@ buildActionMask = 2147483647; files = ( 85ED18AA24AD425E0085DFA0 /* TokamakDemo.swift in Sources */, + D1B4229324B3B9BB00682F74 /* OutlineGroupDemo.swift in Sources */, 85ED18A424AD425E0085DFA0 /* SpacerDemo.swift in Sources */, 85ED18B024AD425E0085DFA0 /* EnvironmentDemo.swift in Sources */, + D1B4229124B3B9BB00682F74 /* ListDemo.swift in Sources */, 85ED18B624AD42D70085DFA0 /* NSAppDelegate.swift in Sources */, 85ED18AC24AD425E0085DFA0 /* Counter.swift in Sources */, 85ED18A824AD425E0085DFA0 /* ForEachDemo.swift in Sources */, @@ -348,7 +360,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 288H3WAR3W; + DEVELOPMENT_TEAM = ""; ENABLE_PREVIEWS = YES; INFOPLIST_FILE = "iOS Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 13.0; @@ -370,7 +382,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 288H3WAR3W; + DEVELOPMENT_TEAM = ""; ENABLE_PREVIEWS = YES; INFOPLIST_FILE = "iOS Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 13.0; @@ -394,7 +406,7 @@ CODE_SIGN_ENTITLEMENTS = ""; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - DEVELOPMENT_TEAM = 288H3WAR3W; + DEVELOPMENT_TEAM = ""; ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; INFOPLIST_FILE = Info.plist;