Skip to content

Commit

Permalink
Update #hotReloadable to take a trailing view builder closure, and up…
Browse files Browse the repository at this point in the history
…date all examples to support hot reloading

Includes adding a Bundler.toml for the examples
  • Loading branch information
stackotter committed May 20, 2024
1 parent 4ae350d commit 174f8e2
Show file tree
Hide file tree
Showing 16 changed files with 532 additions and 179 deletions.
46 changes: 46 additions & 0 deletions Examples/Bundler.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
format_version = 2

[apps.ControlsExample]
identifier = 'dev.stackotter.ControlsExample'
product = 'ControlsExample'
version = '0.1.0'

[apps.CounterExample]
identifier = 'dev.stackotter.CounterExample'
product = 'CounterExample'
version = '0.1.0'

[apps.RandomNumberGeneratorExample]
identifier = 'dev.stackotter.RandomNumberGeneratorE'
product = 'RandomNumberGeneratorE'
version = '0.1.0'

[apps.WindowingExample]
identifier = 'dev.stackotter.WindowingExample'
product = 'WindowingExample'
version = '0.1.0'

[apps.GreetingGeneratorExample]
identifier = 'dev.stackotter.GreetingGeneratorExamp'
product = 'GreetingGeneratorExamp'
version = '0.1.0'

[apps.NavigationExample]
identifier = 'dev.stackotter.NavigationExample'
product = 'NavigationExample'
version = '0.1.0'

[apps.SplitExample]
identifier = 'dev.stackotter.SplitExample'
product = 'SplitExample'
version = '0.1.0'

[apps.SpreadsheetExample]
identifier = 'dev.stackotter.SpreadsheetExample'
product = 'SpreadsheetExample'
version = '0.1.0'

[apps.StressTestExample]
identifier = 'dev.stackotter.StressTestExample'
product = 'StressTestExample'
version = '0.1.0'
270 changes: 261 additions & 9 deletions Examples/Package.resolved
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
{
"pins" : [
{
"identity" : "asyncextensions",
"identity" : "aexml",
"kind" : "remoteSourceControl",
"location" : "https://github.com/lhoward/AsyncExtensions",
"location" : "https://github.com/tadija/AEXML.git",
"state" : {
"branch" : "linux",
"revision" : "2218eaa30dbdb39b063e92644fc28ed22e2cb942"
"revision" : "38f7d00b23ecd891e1ee656fa6aeebd6ba04ecc3",
"version" : "4.6.1"
}
},
{
"identity" : "lvglswift",
"identity" : "graphviz",
"kind" : "remoteSourceControl",
"location" : "https://github.com/PADL/LVGLSwift",
"location" : "https://github.com/SwiftDocOrg/GraphViz.git",
"state" : {
"revision" : "19c19a942153b50d61486faf1d0d45daf79e7be5"
"revision" : "70bebcf4597b9ce33e19816d6bbd4ba9b7bdf038",
"version" : "0.2.0"
}
},
{
"identity" : "jsonutilities",
"kind" : "remoteSourceControl",
"location" : "https://github.com/yonaskolb/JSONUtilities.git",
"state" : {
"revision" : "128d2ffc22467f69569ef8ff971683e2393191a0",
"version" : "4.2.0"
}
},
{
Expand All @@ -26,6 +36,15 @@
"version" : "0.14.0"
}
},
{
"identity" : "pathkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/kylef/PathKit.git",
"state" : {
"revision" : "3bfd2737b700b9a36565a8c94f4ad2b050a5e574",
"version" : "1.0.1"
}
},
{
"identity" : "qlift",
"kind" : "remoteSourceControl",
Expand All @@ -34,13 +53,192 @@
"revision" : "ddab1f1ecc113ad4f8e05d2999c2734cdf706210"
}
},
{
"identity" : "rainbow",
"kind" : "remoteSourceControl",
"location" : "https://github.com/onevcat/Rainbow",
"state" : {
"revision" : "626c3d4b6b55354b4af3aa309f998fae9b31a3d9",
"version" : "3.2.0"
}
},
{
"identity" : "socket",
"kind" : "remoteSourceControl",
"location" : "https://github.com/stackotter/Socket",
"state" : {
"revision" : "9945adfb7b2b089b1f9963db31544f604d260293",
"version" : "0.3.3"
}
},
{
"identity" : "spectre",
"kind" : "remoteSourceControl",
"location" : "https://github.com/kylef/Spectre.git",
"state" : {
"revision" : "26cc5e9ae0947092c7139ef7ba612e34646086c7",
"version" : "0.10.1"
}
},
{
"identity" : "swift-arg-parser",
"kind" : "remoteSourceControl",
"location" : "https://github.com/stackotter/swift-arg-parser",
"state" : {
"branch" : "b1b5373",
"revision" : "b1b53732a64467ea95618222913d6ff81e4e6d6a"
}
},
{
"identity" : "swift-argument-parser",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-argument-parser.git",
"state" : {
"revision" : "46989693916f56d1186bd59ac15124caef896560",
"version" : "1.3.1"
}
},
{
"identity" : "swift-async-algorithms",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-async-algorithms.git",
"state" : {
"revision" : "9cfed92b026c524674ed869a4ff2dcfdeedf8a2a",
"version" : "0.1.0"
}
},
{
"identity" : "swift-bundler",
"kind" : "remoteSourceControl",
"location" : "https://github.com/stackotter/swift-bundler",
"state" : {
"revision" : "5ba9c04744efd3815ba5578193c3cfa9a011bee3"
}
},
{
"identity" : "swift-case-paths",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-case-paths",
"state" : {
"revision" : "8d712376c99fc0267aa0e41fea732babe365270a",
"version" : "1.3.3"
}
},
{
"identity" : "swift-cmark",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-cmark.git",
"state" : {
"revision" : "f218e5d7691f78b55bfa39b367763f4612486c35",
"version" : "0.3.0"
}
},
{
"identity" : "swift-collections",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-collections.git",
"state" : {
"revision" : "d029d9d39c87bed85b1c50adee7c41795261a192",
"version" : "1.0.6"
"revision" : "94cf62b3ba8d4bed62680a282d4c25f9c63c2efb",
"version" : "1.1.0"
}
},
{
"identity" : "swift-filestreamer",
"kind" : "remoteSourceControl",
"location" : "https://github.com/sersoft-gmbh/swift-filestreamer",
"state" : {
"revision" : "3505dfa1e2fdba28d0b8a599ac979240d970a362",
"version" : "0.8.1"
}
},
{
"identity" : "swift-format",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-format",
"state" : {
"revision" : "7c60a5d1f508965a87ed66b6e58e9392af4b36af",
"version" : "510.0.1"
}
},
{
"identity" : "swift-inotify",
"kind" : "remoteSourceControl",
"location" : "https://github.com/sersoft-gmbh/swift-inotify",
"state" : {
"revision" : "cdfd330424b976416722ee28d1ccbb2c74059dd7",
"version" : "0.6.0"
}
},
{
"identity" : "swift-log",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-log",
"state" : {
"revision" : "e97a6fcb1ab07462881ac165fdbb37f067e205d5",
"version" : "1.5.4"
}
},
{
"identity" : "swift-macro-toolkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/stackotter/swift-macro-toolkit",
"state" : {
"revision" : "687075e7bf976e121d083e922a07c7a9350ca85d",
"version" : "0.4.0"
}
},
{
"identity" : "swift-markdown",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-markdown.git",
"state" : {
"revision" : "e4f95e2dc23097a1a9a1dfdfe3fe3ee44de77378",
"version" : "0.3.0"
}
},
{
"identity" : "swift-overture",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-overture",
"state" : {
"revision" : "7977acd7597f413717058acc1e080731249a1d7e",
"version" : "0.5.0"
}
},
{
"identity" : "swift-parsing",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-parsing",
"state" : {
"revision" : "a0e7d73f462c1c38c59dc40a3969ac40cea42950",
"version" : "0.13.0"
}
},
{
"identity" : "swift-syntax",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-syntax.git",
"state" : {
"revision" : "fa8f95c2d536d6620cc2f504ebe8a6167c9fc2dd",
"version" : "510.0.1"
}
},
{
"identity" : "swift-system",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-system.git",
"state" : {
"revision" : "f9266c85189c2751589a50ea5aec72799797e471",
"version" : "1.3.0"
}
},
{
"identity" : "swiftcli",
"kind" : "remoteSourceControl",
"location" : "https://github.com/jakeheis/SwiftCLI.git",
"state" : {
"revision" : "2e949055d9797c1a6bddcda0e58dada16cc8e970",
"version" : "6.0.3"
}
},
{
Expand All @@ -52,6 +250,15 @@
"version" : "1.2.5"
}
},
{
"identity" : "swiftxcodeproj",
"kind" : "remoteSourceControl",
"location" : "https://github.com/stackotter/SwiftXcodeProj.git",
"state" : {
"revision" : "46e9b907e3ec66010cf2204594549ff1dc195032",
"version" : "8.10.1"
}
},
{
"identity" : "termkit",
"kind" : "remoteSourceControl",
Expand All @@ -68,6 +275,51 @@
"revision" : "7f3ed5b1d7288de34ad853544d802647be11cfcf",
"version" : "0.3.0"
}
},
{
"identity" : "tomlkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/furby-tm/TOMLKit",
"state" : {
"revision" : "f2b3e80a19c7fb3d42e3cfda98076cef8f0d1bd7",
"version" : "0.5.6"
}
},
{
"identity" : "version",
"kind" : "remoteSourceControl",
"location" : "https://github.com/mxcl/Version.git",
"state" : {
"revision" : "1fe824b80d89201652e7eca7c9252269a1d85e25",
"version" : "2.0.1"
}
},
{
"identity" : "xcodegen",
"kind" : "remoteSourceControl",
"location" : "https://github.com/stackotter/XcodeGen",
"state" : {
"revision" : "adbf99beb7afb4844774d14e9275da9a503a427c",
"version" : "2.35.1"
}
},
{
"identity" : "xctest-dynamic-overlay",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/xctest-dynamic-overlay",
"state" : {
"revision" : "6f30bdba373bbd7fbfe241dddd732651f2fbd1e2",
"version" : "1.1.2"
}
},
{
"identity" : "yams",
"kind" : "remoteSourceControl",
"location" : "https://github.com/jpsim/Yams.git",
"state" : {
"revision" : "9234124cff5e22e178988c18d8b95a8ae8007f76",
"version" : "5.1.2"
}
}
],
"version" : 2
Expand Down
9 changes: 7 additions & 2 deletions Examples/Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.6
// swift-tools-version: 5.9

import Foundation
import PackageDescription
Expand All @@ -8,13 +8,18 @@ let backend = ProcessInfo.processInfo.environment["SCUI_BACKEND"] ?? "GtkBackend
let exampleDependencies: [Target.Dependency] = [
"SwiftCrossUI",
"SelectedBackend",
.product(name: "SwiftBundlerRuntime", package: "swift-bundler"),
]

let package = Package(
name: "Examples",
platforms: [.macOS(.v10_15)],
dependencies: [
.package(name: "SwiftCrossUI", path: "..")
.package(name: "SwiftCrossUI", path: ".."),
.package(
url: "https://github.com/stackotter/swift-bundler",
revision: "5ba9c04744efd3815ba5578193c3cfa9a011bee3"
),
],
targets: [
.executableTarget(
Expand Down
Loading

0 comments on commit 174f8e2

Please sign in to comment.