Skip to content

Commit

Permalink
Merge pull request #350 from mas-cli/spm
Browse files Browse the repository at this point in the history
📦 Declare mas as a Swift Package
  • Loading branch information
phatblat authored May 3, 2021
2 parents 16821a3 + 3059bf3 commit 9277a8b
Show file tree
Hide file tree
Showing 179 changed files with 285 additions and 2,426 deletions.
2 changes: 0 additions & 2 deletions .github/config.yml

This file was deleted.

6 changes: 2 additions & 4 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,14 @@ jobs:
# https://github.com/actions/checkout#usage
- uses: actions/checkout@master
with:
# Fetch tags for script/version
fetch-depth: 0
# https://docs.github.com/en/actions/reference/authentication-in-a-workflow
token: ${{ secrets.GITHUB_TOKEN }}

- name: Bootstrap
run: script/bootstrap
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepsenv
env:
# Carthage looks for GITHUB_ACCESS_TOKEN
# https://github.com/Carthage/Carthage/blob/master/Source/CarthageKit/GitHub.swift#L118
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build
run: script/build
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@
.VolumeIcon.icns
._*
.apdisk
.build/
.envrc
.fseventsd
.rubygems/
.swiftpm/
Carthage/
DerivedData
Pods/
Expand All @@ -34,3 +36,4 @@ build/
default.profraw
releases/
xcuserdata
Sources/MasKit/Package.swift
3 changes: 3 additions & 0 deletions .hound.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ rubocop:

shellcheck:
enabled: true

swiftlint:
enabled: false
2 changes: 0 additions & 2 deletions Brewfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
brew "carthage"
brew "make"
brew "shfmt"
brew "swift-format"
brew "swiftformat"
Expand Down
63 changes: 0 additions & 63 deletions Brewfile.lock.json
Original file line number Diff line number Diff line change
@@ -1,69 +1,6 @@
{
"entries": {
"brew": {
"carthage": {
"version": "0.37.0",
"bottle": {
"rebuild": 0,
"root_url": "https://ghcr.io/v2/homebrew/core",
"files": {
"arm64_big_sur": {
"cellar": ":any_skip_relocation",
"url": "https://ghcr.io/v2/homebrew/core/carthage/blobs/sha256:cd0c716682b5b094b82a589fb79def4eb696f70a3fd92423923a5cb86c2c79b3",
"sha256": "cd0c716682b5b094b82a589fb79def4eb696f70a3fd92423923a5cb86c2c79b3"
},
"big_sur": {
"cellar": ":any_skip_relocation",
"url": "https://ghcr.io/v2/homebrew/core/carthage/blobs/sha256:0770b4dd885f3018031c2d27fc090a34027d5856a248f33fa2a415d58da74632",
"sha256": "0770b4dd885f3018031c2d27fc090a34027d5856a248f33fa2a415d58da74632"
},
"catalina": {
"cellar": ":any_skip_relocation",
"url": "https://ghcr.io/v2/homebrew/core/carthage/blobs/sha256:8a07c198835cb179d4054313b199ce126e64bb9414eaaa91f55162a4aed63134",
"sha256": "8a07c198835cb179d4054313b199ce126e64bb9414eaaa91f55162a4aed63134"
},
"mojave": {
"cellar": ":any_skip_relocation",
"url": "https://ghcr.io/v2/homebrew/core/carthage/blobs/sha256:7fb777ac169aa4cb05683f0f8bfb5b56dbb0b0e8b673df995ef2fb2bbe0d90d2",
"sha256": "7fb777ac169aa4cb05683f0f8bfb5b56dbb0b0e8b673df995ef2fb2bbe0d90d2"
}
}
}
},
"make": {
"version": "4.3",
"bottle": {
"rebuild": 1,
"root_url": "https://ghcr.io/v2/homebrew/core",
"files": {
"arm64_big_sur": {
"cellar": "/opt/homebrew/Cellar",
"url": "https://ghcr.io/v2/homebrew/core/make/blobs/sha256:eab3fbc3688aecec0fe90b8d0fe3cb7beb84ed773ba0411fc2f855c66deaf882",
"sha256": "eab3fbc3688aecec0fe90b8d0fe3cb7beb84ed773ba0411fc2f855c66deaf882"
},
"big_sur": {
"cellar": "/usr/local/Cellar",
"url": "https://ghcr.io/v2/homebrew/core/make/blobs/sha256:2019ba646e4471d42e09c28a0992c59dd82e292bf8275b0b3bfcce3220ef9c1b",
"sha256": "2019ba646e4471d42e09c28a0992c59dd82e292bf8275b0b3bfcce3220ef9c1b"
},
"catalina": {
"cellar": "/usr/local/Cellar",
"url": "https://ghcr.io/v2/homebrew/core/make/blobs/sha256:39fc5ebff5ff708c2e3eea597b9f2eb79b910a122d30c3ac9bb93ebe313f030c",
"sha256": "39fc5ebff5ff708c2e3eea597b9f2eb79b910a122d30c3ac9bb93ebe313f030c"
},
"mojave": {
"cellar": "/usr/local/Cellar",
"url": "https://ghcr.io/v2/homebrew/core/make/blobs/sha256:0c0a08eef68bcd78b0345f5f57a6efffcc7be877bcb3b803f39ac8916b882477",
"sha256": "0c0a08eef68bcd78b0345f5f57a6efffcc7be877bcb3b803f39ac8916b882477"
},
"high_sierra": {
"cellar": "/usr/local/Cellar",
"url": "https://ghcr.io/v2/homebrew/core/make/blobs/sha256:429177235322c3209e1657bea36364cd84222075b636939f6ed93a1cd04aeb21",
"sha256": "429177235322c3209e1657bea36364cd84222075b636939f6ed93a1cd04aeb21"
}
}
}
},
"shfmt": {
"version": "3.2.4",
"bottle": {
Expand Down
1 change: 0 additions & 1 deletion Cartfile

This file was deleted.

2 changes: 0 additions & 2 deletions Cartfile.private

This file was deleted.

3 changes: 0 additions & 3 deletions Cartfile.resolved

This file was deleted.

10 changes: 4 additions & 6 deletions Dangerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@

# Sometimes it's a README fix, or something like that - which isn't relevant for
# including in a project's CHANGELOG for example
has_app_changes = !git.modified_files.grep(/MasKit/).empty?
has_test_changes = !git.modified_files.grep(/MasKitTests/).empty?
has_app_changes = !git.modified_files.grep(/Sources/).empty?
has_test_changes = !git.modified_files.grep(/Tests/).empty?

is_version_bump = git.modified_files.sort == [
"mas/mas-Info.plist",
"mas-cli.xcodeproj/project.pbxproj",
"MasKit/SupportingFiles/Info.plist",
"MasKitTests/SupportingFiles/Info.plist"
"Package.swift",
"MasKit/SupportingFiles/Package.swift"
].sort
message(":bookmark: Version bump!") if is_version_bump

Expand Down
10 changes: 7 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,17 @@ GEM
no_proxy_fix
octokit (~> 4.7)
terminal-table (>= 1, < 4)
faraday (1.3.0)
faraday (1.4.1)
faraday-excon (~> 1.1)
faraday-net_http (~> 1.0)
faraday-net_http_persistent (~> 1.1)
multipart-post (>= 1.2, < 3)
ruby2_keywords
ruby2_keywords (>= 0.0.4)
faraday-excon (1.1.0)
faraday-http-cache (2.2.0)
faraday (>= 0.8)
faraday-net_http (1.0.1)
faraday-net_http_persistent (1.1.0)
git (1.8.1)
rchardet (~> 1.8)
kramdown (2.3.1)
Expand All @@ -40,7 +44,7 @@ GEM
multipart-post (2.1.1)
nap (1.1.0)
no_proxy_fix (0.1.2)
octokit (4.20.0)
octokit (4.21.0)
faraday (>= 0.9)
sawyer (~> 0.8.0, >= 0.5.3)
open4 (1.3.4)
Expand Down
15 changes: 1 addition & 14 deletions Homebrew/mas-tap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,14 @@ class Mas < Formula
sha256 cellar: :any, el_capitan: "d54d864976f78665d5175fd9e69ab81b3911fa28fd6ae627b61a18d55d68191a"
end

depends_on "carthage" => :build
depends_on :macos
if Hardware::CPU.arm?
depends_on xcode: ["12.2", :build]
else
depends_on xcode: ["11.4", :build]
depends_on xcode: ["12.0", :build]
end

def install
# Working around build issues in dependencies
# - Prevent warnings from causing build failures
# - Prevent linker errors by telling all lib builds to use max size install names
xcconfig = buildpath/"Overrides.xcconfig"
xcconfig.write <<~EOS
GCC_TREAT_WARNINGS_AS_ERRORS = NO
OTHER_LDFLAGS = -headerpad_max_install_names
EOS
ENV["XCODE_XCCONFIG_FILE"] = xcconfig

# Only build necessary dependencies
system "carthage", "bootstrap", "--platform", "macOS", "Commandant"
system "script/install", prefix

bash_completion.install "contrib/completion/mas-completion.bash" => "mas"
Expand Down
15 changes: 1 addition & 14 deletions Homebrew/mas.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,14 @@ class Mas < Formula
sha256 cellar: :any, catalina: "2e7ffedf674543f98c2b95868b6a23db208cb2e6a3ec1ddbb3553ddab0cf9a68"
end

depends_on "carthage" => :build
depends_on :macos
if Hardware::CPU.arm?
depends_on xcode: ["12.2", :build]
else
depends_on xcode: ["11.4", :build]
depends_on xcode: ["12.0", :build]
end

def install
# Working around build issues in dependencies
# - Prevent warnings from causing build failures
# - Prevent linker errors by telling all lib builds to use max size install names
xcconfig = buildpath/"Overrides.xcconfig"
xcconfig.write <<~EOS
GCC_TREAT_WARNINGS_AS_ERRORS = NO
OTHER_LDFLAGS = -headerpad_max_install_names
EOS
ENV["XCODE_XCCONFIG_FILE"] = xcconfig

# Only build necessary dependencies
system "carthage", "bootstrap", "--platform", "macOS", "Commandant"
system "script/install", prefix

bash_completion.install "contrib/completion/mas-completion.bash" => "mas"
Expand Down
24 changes: 0 additions & 24 deletions MasKit/SupportingFiles/Info.plist

This file was deleted.

17 changes: 0 additions & 17 deletions MasKit/SupportingFiles/MasKit.h

This file was deleted.

85 changes: 0 additions & 85 deletions MasKitTests/OutputListener.swift

This file was deleted.

22 changes: 0 additions & 22 deletions MasKitTests/SupportingFiles/Info.plist

This file was deleted.

Loading

0 comments on commit 9277a8b

Please sign in to comment.