Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📦 Declare mas as a Swift Package #350

Merged
merged 33 commits into from
May 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
969f4e4
📦 Declare Swift Package dependencies
chris-araman Apr 26, 2021
d287c5c
🚧 Move sources to typical SPM locations
chris-araman Apr 26, 2021
7a7f36a
📦 Declare mas as a Swift Package
chris-araman Apr 26, 2021
944a873
♻️ Remove previously removed headers from Xcode project
chris-araman Apr 27, 2021
f0bf27a
♻️ Remove redundant declarations
chris-araman Apr 27, 2021
0a506b1
♻️ Simplify max identifier length calculation
chris-araman Apr 27, 2021
2cf5ce3
⌨️ Fix typo
chris-araman Apr 27, 2021
65b3763
🧹 Prefer isEmpty to equality check
chris-araman Apr 27, 2021
5df17f7
📦 Embed version string as Swift code
chris-araman Apr 28, 2021
c936940
📜 Build Swift Package from scripts
chris-araman Apr 28, 2021
424db2e
🧹 Update paths to sources
chris-araman Apr 28, 2021
7318f41
🛠 Remove Xcode project and workspace
chris-araman Apr 28, 2021
d8ccec1
🏛 Remove reference to Carthage
chris-araman Apr 28, 2021
707c839
🛠 Remove xcconfig overrides
chris-araman Apr 28, 2021
a45487e
📜 Remove unused release script
chris-araman Apr 28, 2021
923fb18
🛠 Remove remnants of Xcode project
chris-araman Apr 28, 2021
e28c67e
⬆️ Update minimum macOS for mas.pkg
chris-araman Apr 28, 2021
d9c6c1d
🐶 Stop running old version of SwiftLint
chris-araman Apr 28, 2021
5f1e3af
🦺 Remove redundant framework paths
chris-araman Apr 28, 2021
c238585
🔍 Simplify test resource lookup
chris-araman Apr 28, 2021
64e1cb4
♻️ Simplify OutputListener
chris-araman Apr 29, 2021
fec4360
♻️ Remove unused import
chris-araman Apr 29, 2021
d0738e5
♻️ Append terminator
chris-araman Apr 29, 2021
a3e3265
🗜 Update mas.pkg build
chris-araman Apr 29, 2021
43ea739
📄 Update build instructions
chris-araman Apr 29, 2021
635d5e1
🚨 Update source paths in Dangerfile
chris-araman Apr 29, 2021
688900f
🤖 Determine version from latest git tag
chris-araman Apr 29, 2021
5a2d771
♻️ Remove generated source file
chris-araman Apr 29, 2021
3e027db
🏷 Fetch tags
chris-araman Apr 29, 2021
5f6618c
🚦 Update Build & Test badge
chris-araman Apr 29, 2021
6163d7c
💎 Update ruby gems bundle
chris-araman Apr 29, 2021
66b61c6
⬆️ Require Xcode 12.0 for Swift 5.3
chris-araman May 2, 2021
3059bf3
🖨 Fix print override
chris-araman May 2, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
12 changes: 8 additions & 4 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,13 +44,13 @@ 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)
public_suffix (4.0.6)
rchardet (1.8.0)
rexml (3.2.4)
rexml (3.2.5)
rouge (2.0.7)
ruby2_keywords (0.0.4)
sawyer (0.8.2)
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