Skip to content

Commit

Permalink
Hide the following holder from Swift SPM: src, tests, scripts, exampl…
Browse files Browse the repository at this point in the history
…es by using empty dummy Package.swift hack.
  • Loading branch information
Sajjon committed Feb 21, 2024
1 parent 73a1c04 commit 4d933dc
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 23 deletions.
23 changes: 0 additions & 23 deletions BuildProcess.md

This file was deleted.

13 changes: 13 additions & 0 deletions examples/Package.swift
Original file line number Diff line number Diff line change
@@ -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()
13 changes: 13 additions & 0 deletions scripts/Package.swift
Original file line number Diff line number Diff line change
@@ -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()
13 changes: 13 additions & 0 deletions src/Package.swift
Original file line number Diff line number Diff line change
@@ -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()
13 changes: 13 additions & 0 deletions tests/Package.swift
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit 4d933dc

Please sign in to comment.