diff --git a/BuildProcess.md b/BuildProcess.md deleted file mode 100644 index 65954093d..000000000 --- a/BuildProcess.md +++ /dev/null @@ -1,23 +0,0 @@ -# Swift - -## Build script -Ah nevermind the build script in [uniffi-starter/../build-ios.sh](https://github.com/ianthetechie/uniffi-starter/blob/main/rust/build-ios.sh) already contained code to update checksum. - -[Blog post about automating checksum update in Package.swift](https://blog.eidinger.info/distribute-binary-frameworks-in-swift-packages-and-how-to-automate-the-process) and here is a [Github Gist which looks nice](https://gist.github.com/litoarias/23bca22bb6161625484b4fb8cd245fe8) - -This would allow for us to use a similar pattern like [`ferrostar`'s `Package.swift`](https://github.com/stadiamaps/ferrostar/blob/main/Package.swift) which has a nice `useLocalFramework` setup, and when NOT local uses SPM's setup: - -```swift -let releaseTag = "0.1.0" -let releaseChecksum = "deadbeefdeadbeef..." -.binaryTarget( - name: "SargonCoreRS", - url: "https://github.com/radixdlt/sargon/releases/download/\(releaseTag)/libsargon-rs.xcframework.zip", - checksum: releaseChecksum -) -``` - -The advantage of this over what we are [doing today in Swift-Engine-Toolkit](https://github.com/radixdlt/swift-engine-toolkit/blob/main/Package.swift#L23C3-L23C78) is that the .xcframework files need not be part of Git! They can be put in Github! This will allow for much much faster git clone! - -# Android -[See `uniffi-starter`](https://github.com/ianthetechie/uniffi-starter) (also contains Swift, but `@IanTheTech` has also created `ferrostar` which contains more advanced Swift setup). \ No newline at end of file diff --git a/examples/Package.swift b/examples/Package.swift new file mode 100644 index 000000000..9a7fcd3ba --- /dev/null +++ b/examples/Package.swift @@ -0,0 +1,13 @@ +// swift-tools-version:5.9 + +// This is a HACKY workaround the fact that SPM does not allow for Package level exclusion +// of files/folders. SPM actually HAD support for it but it was removed in 2017, in PR +// https://github.com/apple/swift-package-manager/commit/cb69accf41da55386f9703308958aa49ca2a4c5f +// +// So instead we have to add an empty dummy Package.swift to each folder we wanna hide, as per: +// See: https://github.com/apple/swift-package-manager/issues/4460#issuecomment-1475025748 +// And: https://stackoverflow.com/questions/69382302/swift-package-how-to-exclude-files-in-root-git-directory-from-the-actual-swift/70990534#70990534 +// And: https://github.com/tuist/tuist/pull/2058 +import PackageDescription + +let package = Package() \ No newline at end of file diff --git a/scripts/Package.swift b/scripts/Package.swift new file mode 100644 index 000000000..9a7fcd3ba --- /dev/null +++ b/scripts/Package.swift @@ -0,0 +1,13 @@ +// swift-tools-version:5.9 + +// This is a HACKY workaround the fact that SPM does not allow for Package level exclusion +// of files/folders. SPM actually HAD support for it but it was removed in 2017, in PR +// https://github.com/apple/swift-package-manager/commit/cb69accf41da55386f9703308958aa49ca2a4c5f +// +// So instead we have to add an empty dummy Package.swift to each folder we wanna hide, as per: +// See: https://github.com/apple/swift-package-manager/issues/4460#issuecomment-1475025748 +// And: https://stackoverflow.com/questions/69382302/swift-package-how-to-exclude-files-in-root-git-directory-from-the-actual-swift/70990534#70990534 +// And: https://github.com/tuist/tuist/pull/2058 +import PackageDescription + +let package = Package() \ No newline at end of file diff --git a/src/Package.swift b/src/Package.swift new file mode 100644 index 000000000..9a7fcd3ba --- /dev/null +++ b/src/Package.swift @@ -0,0 +1,13 @@ +// swift-tools-version:5.9 + +// This is a HACKY workaround the fact that SPM does not allow for Package level exclusion +// of files/folders. SPM actually HAD support for it but it was removed in 2017, in PR +// https://github.com/apple/swift-package-manager/commit/cb69accf41da55386f9703308958aa49ca2a4c5f +// +// So instead we have to add an empty dummy Package.swift to each folder we wanna hide, as per: +// See: https://github.com/apple/swift-package-manager/issues/4460#issuecomment-1475025748 +// And: https://stackoverflow.com/questions/69382302/swift-package-how-to-exclude-files-in-root-git-directory-from-the-actual-swift/70990534#70990534 +// And: https://github.com/tuist/tuist/pull/2058 +import PackageDescription + +let package = Package() \ No newline at end of file diff --git a/tests/Package.swift b/tests/Package.swift new file mode 100644 index 000000000..9a7fcd3ba --- /dev/null +++ b/tests/Package.swift @@ -0,0 +1,13 @@ +// swift-tools-version:5.9 + +// This is a HACKY workaround the fact that SPM does not allow for Package level exclusion +// of files/folders. SPM actually HAD support for it but it was removed in 2017, in PR +// https://github.com/apple/swift-package-manager/commit/cb69accf41da55386f9703308958aa49ca2a4c5f +// +// So instead we have to add an empty dummy Package.swift to each folder we wanna hide, as per: +// See: https://github.com/apple/swift-package-manager/issues/4460#issuecomment-1475025748 +// And: https://stackoverflow.com/questions/69382302/swift-package-how-to-exclude-files-in-root-git-directory-from-the-actual-swift/70990534#70990534 +// And: https://github.com/tuist/tuist/pull/2058 +import PackageDescription + +let package = Package() \ No newline at end of file