diff --git a/elixirkit/demo/rel/swiftui/Demo.xcodeproj/project.pbxproj b/elixirkit/demo/rel/swiftui/Demo.xcodeproj/project.pbxproj index a07fa4989..480f6f47f 100644 --- a/elixirkit/demo/rel/swiftui/Demo.xcodeproj/project.pbxproj +++ b/elixirkit/demo/rel/swiftui/Demo.xcodeproj/project.pbxproj @@ -13,6 +13,7 @@ 2E7CBC1E2A3B3343001253E3 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E7CBC0C2A3B3340001253E3 /* ContentView.swift */; }; 2E7CBC1F2A3B3343001253E3 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2E7CBC0D2A3B3343001253E3 /* Assets.xcassets */; }; 2E7CBC202A3B3343001253E3 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2E7CBC0D2A3B3343001253E3 /* Assets.xcassets */; }; + 2E951DDB2A3B507700C64042 /* ElixirKit in Frameworks */ = {isa = PBXBuildFile; productRef = 2E951DDA2A3B507700C64042 /* ElixirKit */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -22,6 +23,7 @@ 2E7CBC122A3B3343001253E3 /* Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Demo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 2E7CBC182A3B3343001253E3 /* Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Demo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 2E7CBC1A2A3B3343001253E3 /* macOS.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = macOS.entitlements; sourceTree = ""; }; + 2E951DD82A3B502900C64042 /* elixirkit_swift */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = elixirkit_swift; path = ../../../elixirkit_swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -36,6 +38,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 2E951DDB2A3B507700C64042 /* ElixirKit in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -45,9 +48,11 @@ 2E7CBC052A3B3340001253E3 = { isa = PBXGroup; children = ( + 2E951DD72A3B502900C64042 /* Packages */, 2E7CBC0A2A3B3340001253E3 /* Shared */, 2E7CBC192A3B3343001253E3 /* macOS */, 2E7CBC132A3B3343001253E3 /* Products */, + 2E951DD92A3B507700C64042 /* Frameworks */, ); sourceTree = ""; }; @@ -78,6 +83,21 @@ path = macOS; sourceTree = ""; }; + 2E951DD72A3B502900C64042 /* Packages */ = { + isa = PBXGroup; + children = ( + 2E951DD82A3B502900C64042 /* elixirkit_swift */, + ); + name = Packages; + sourceTree = ""; + }; + 2E951DD92A3B507700C64042 /* Frameworks */ = { + isa = PBXGroup; + children = ( + ); + name = Frameworks; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -112,6 +132,9 @@ dependencies = ( ); name = "Demo (macOS)"; + packageProductDependencies = ( + 2E951DDA2A3B507700C64042 /* ElixirKit */, + ); productName = "Demo (macOS)"; productReference = 2E7CBC182A3B3343001253E3 /* Demo.app */; productType = "com.apple.product-type.application"; @@ -124,7 +147,7 @@ attributes = { BuildIndependentTargetsInParallel = 1; LastSwiftUpdateCheck = 1320; - LastUpgradeCheck = 1320; + LastUpgradeCheck = 1430; TargetAttributes = { 2E7CBC112A3B3343001253E3 = { CreatedOnToolsVersion = 13.2.1; @@ -175,6 +198,7 @@ /* Begin PBXShellScriptBuildPhase section */ 2E24F3522A3B3CFD0056A207 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -248,6 +272,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; @@ -307,6 +332,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -393,6 +419,7 @@ CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 1; + DEAD_CODE_STRIPPING = YES; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_NSHumanReadableCopyright = ""; @@ -419,6 +446,7 @@ CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 1; + DEAD_CODE_STRIPPING = YES; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_NSHumanReadableCopyright = ""; @@ -467,6 +495,13 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCSwiftPackageProductDependency section */ + 2E951DDA2A3B507700C64042 /* ElixirKit */ = { + isa = XCSwiftPackageProductDependency; + productName = ElixirKit; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 2E7CBC062A3B3340001253E3 /* Project object */; } diff --git a/elixirkit/demo/rel/swiftui/Shared/DemoApp.swift b/elixirkit/demo/rel/swiftui/Shared/DemoApp.swift index 470184c6a..58c671ea5 100644 --- a/elixirkit/demo/rel/swiftui/Shared/DemoApp.swift +++ b/elixirkit/demo/rel/swiftui/Shared/DemoApp.swift @@ -1,7 +1,17 @@ import SwiftUI +import ElixirKit @main struct DemoApp: App { + init() { + ElixirKit.API.start( + name: "demo", + readyHandler: { +// ElixirKit.API.publish("log", "Hello from SwiftUI!") + } + ) + } + var body: some Scene { WindowGroup { ContentView() diff --git a/elixirkit/demo/rel/swiftui/build_release.sh b/elixirkit/demo/rel/swiftui/build_release.sh index 49f7a986e..e5698f60d 100755 --- a/elixirkit/demo/rel/swiftui/build_release.sh +++ b/elixirkit/demo/rel/swiftui/build_release.sh @@ -1,4 +1,14 @@ #!/bin/sh set -euo pipefail -(cd ../.. && mix release --overwrite) +# this script is executed by Xcode. + +if ! which elixir; then + if [ -d /opt/homebrew/opt/asdf ]; then + . /opt/homebrew/opt/asdf/libexec/asdf.sh + fi +fi + +app_dir=$BUILT_PRODUCTS_DIR/$FULL_PRODUCT_NAME +resources_dir=$app_dir/Contents/Resources +(cd ../.. && mix release --overwrite --path=$resources_dir/rel) diff --git a/elixirkit/demo/rel/swiftui/run_macos.sh b/elixirkit/demo/rel/swiftui/run_macos.sh index a7facf817..74406540f 100755 --- a/elixirkit/demo/rel/swiftui/run_macos.sh +++ b/elixirkit/demo/rel/swiftui/run_macos.sh @@ -9,4 +9,6 @@ mkdir -p tmp xcodebuild -configuration "$configuration" -scheme "$scheme" -destination "$destination" -showBuildSettings -json > tmp/build.json app_dir=`cat tmp/build.json | jq --raw-output '.[0].buildSettings.CODESIGNING_FOLDER_PATH'` -open -W --stdout=`tty` --stderr=`tty` $app_dir +xcodebuild -configuration "$configuration" -scheme "$scheme" -destination "$destination" + +# open -W --stdout=`tty` --stderr=`tty` $app_dir