mirror of
https://github.com/mas-cli/mas
synced 2024-11-25 04:50:24 +00:00
Merge branch 'main' into quick
This commit is contained in:
commit
97f026309d
14 changed files with 112 additions and 93 deletions
|
@ -1,6 +1,35 @@
|
|||
{
|
||||
"entries": {
|
||||
"brew": {
|
||||
"markdownlint-cli": {
|
||||
"version": "0.27.1",
|
||||
"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/markdownlint-cli/blobs/sha256:ed9779fa2a2cc0141debd2c61501681dcd2c78741ee47ea90726e65f52515d81",
|
||||
"sha256": "ed9779fa2a2cc0141debd2c61501681dcd2c78741ee47ea90726e65f52515d81"
|
||||
},
|
||||
"big_sur": {
|
||||
"cellar": ":any_skip_relocation",
|
||||
"url": "https://ghcr.io/v2/homebrew/core/markdownlint-cli/blobs/sha256:d6454296ad369bb59d89724a04b36374946d5880eaaefc9690f617f5a74ff310",
|
||||
"sha256": "d6454296ad369bb59d89724a04b36374946d5880eaaefc9690f617f5a74ff310"
|
||||
},
|
||||
"catalina": {
|
||||
"cellar": ":any_skip_relocation",
|
||||
"url": "https://ghcr.io/v2/homebrew/core/markdownlint-cli/blobs/sha256:b005b2342165d9c7dbd528d57659fa4bbe6615c2fc6f7ea87fbec39cdb7857a5",
|
||||
"sha256": "b005b2342165d9c7dbd528d57659fa4bbe6615c2fc6f7ea87fbec39cdb7857a5"
|
||||
},
|
||||
"mojave": {
|
||||
"cellar": ":any_skip_relocation",
|
||||
"url": "https://ghcr.io/v2/homebrew/core/markdownlint-cli/blobs/sha256:802003979b630f36bfce119b8cd8a05ce34a006e19d94bbceb2040944167233b",
|
||||
"sha256": "802003979b630f36bfce119b8cd8a05ce34a006e19d94bbceb2040944167233b"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"shfmt": {
|
||||
"version": "3.2.4",
|
||||
"bottle": {
|
||||
|
@ -97,12 +126,12 @@
|
|||
"system": {
|
||||
"macos": {
|
||||
"big_sur": {
|
||||
"HOMEBREW_VERSION": "3.1.3-107-g1157a97",
|
||||
"HOMEBREW_VERSION": "3.1.5",
|
||||
"HOMEBREW_PREFIX": "/opt/homebrew",
|
||||
"Homebrew/homebrew-core": "1da7ce26f5cfa33eec131571755152680a5321b7",
|
||||
"Homebrew/homebrew-core": "e6c5a215e70e758472a62b1ff0a1ecdf94facc61",
|
||||
"CLT": "12.5.0.0.1.1617976050",
|
||||
"Xcode": "12.5",
|
||||
"macOS": "11.3"
|
||||
"macOS": "11.3.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ has_test_changes = !git.modified_files.grep(/Tests/).empty?
|
|||
|
||||
is_version_bump = git.modified_files.sort == [
|
||||
"Package.swift",
|
||||
"MasKit/SupportingFiles/Package.swift"
|
||||
"MasKit/Package.swift"
|
||||
].sort
|
||||
message(":bookmark: Version bump!") if is_version_bump
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@ class Mas < Formula
|
|||
desc "Mac App Store command-line interface"
|
||||
homepage "https://github.com/mas-cli/mas"
|
||||
url "https://github.com/mas-cli/mas.git",
|
||||
tag: "v1.8.1",
|
||||
revision: "23a36b4555f5625fe29915b31b8b101064452dca"
|
||||
tag: "v1.8.2",
|
||||
revision: "c88a98892e52a0ad8527a532aaa5dd1a2dd19635"
|
||||
license "MIT"
|
||||
head "https://github.com/mas-cli/mas.git"
|
||||
|
||||
|
@ -26,7 +26,8 @@ class Mas < Formula
|
|||
end
|
||||
|
||||
def install
|
||||
system "script/install", prefix
|
||||
system "script/build", "--universal"
|
||||
system "script/install", "--universal", prefix
|
||||
|
||||
bash_completion.install "contrib/completion/mas-completion.bash" => "mas"
|
||||
fish_completion.install "contrib/completion/mas.fish"
|
||||
|
@ -34,6 +35,6 @@ class Mas < Formula
|
|||
|
||||
test do
|
||||
assert_equal version.to_s, shell_output("#{bin}/mas version").chomp
|
||||
assert_include shell_output("#{bin}/mas info 497799835"), "Xcode"
|
||||
assert_includes shell_output("#{bin}/mas info 497799835"), "Xcode"
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,15 +2,15 @@ class Mas < Formula
|
|||
desc "Mac App Store command-line interface"
|
||||
homepage "https://github.com/mas-cli/mas"
|
||||
url "https://github.com/mas-cli/mas.git",
|
||||
tag: "v1.8.1",
|
||||
revision: "23a36b4555f5625fe29915b31b8b101064452dca"
|
||||
tag: "v1.8.2",
|
||||
revision: "c88a98892e52a0ad8527a532aaa5dd1a2dd19635"
|
||||
license "MIT"
|
||||
head "https://github.com/mas-cli/mas.git"
|
||||
|
||||
bottle do
|
||||
sha256 cellar: :any, arm64_big_sur: "ef2ed904d1283722af006811471484cb1c9c73b255a766b5c0c65ecd1654c8d8"
|
||||
sha256 cellar: :any, big_sur: "dc98d69cfa94467e046b443c088a6097fe0ce0d2935e37046815fa3a984a0ca4"
|
||||
sha256 cellar: :any, catalina: "2e7ffedf674543f98c2b95868b6a23db208cb2e6a3ec1ddbb3553ddab0cf9a68"
|
||||
sha256 cellar: :any, arm64_big_sur: "f5ef4f44057f43ecc14f970687d832bd152bc6142c0ad848977f0a6527aa934f"
|
||||
sha256 cellar: :any, big_sur: "d92cfc734e730fde87b29c6bf4a50ce63a78b9e505f464dc557eee128aa06d05"
|
||||
sha256 cellar: :any, catalina: "163eb9cfdfed3d8fbda133b4079d104ad687f1ddb71d70d5661d02b22f562e76"
|
||||
end
|
||||
|
||||
depends_on :macos
|
||||
|
@ -21,6 +21,7 @@ class Mas < Formula
|
|||
end
|
||||
|
||||
def install
|
||||
system "script/build"
|
||||
system "script/install", prefix
|
||||
|
||||
bash_completion.install "contrib/completion/mas-completion.bash" => "mas"
|
||||
|
@ -29,6 +30,6 @@ class Mas < Formula
|
|||
|
||||
test do
|
||||
assert_equal version.to_s, shell_output("#{bin}/mas version").chomp
|
||||
assert_include shell_output("#{bin}/mas info 497799835"), "Xcode"
|
||||
assert_includes shell_output("#{bin}/mas info 497799835"), "Xcode"
|
||||
end
|
||||
end
|
||||
|
|
73
Makefile
73
Makefile
|
@ -26,17 +26,13 @@ SWIFT_VERSION = 5.3.2
|
|||
|
||||
# OS specific differences
|
||||
UNAME = ${shell uname}
|
||||
ARCH = ${shell uname -m}
|
||||
|
||||
ifeq ($(UNAME), Darwin)
|
||||
SWIFTC_FLAGS =
|
||||
LINKER_FLAGS = -Xlinker -L/usr/local/lib
|
||||
PLATFORM = x86_64-apple-macosx
|
||||
PLATFORM = $(ARCH)-apple-macosx
|
||||
EXECUTABLE_DIRECTORY = ./.build/${PLATFORM}/debug
|
||||
TEST_BUNDLE = ${CMD_NAME}PackageTests.xctest
|
||||
TEST_RESOURCES_DIRECTORY = ./.build/${PLATFORM}/debug/${TEST_BUNDLE}/Contents/Resources
|
||||
endif
|
||||
|
||||
RUN_RESOURCES_DIRECTORY = ${EXECUTABLE_DIRECTORY}
|
||||
|
||||
################################################################################
|
||||
#
|
||||
|
@ -49,7 +45,7 @@ version:
|
|||
xcodebuild -version
|
||||
swiftenv version
|
||||
swift --version
|
||||
# swift package tools-version
|
||||
swift package tools-version
|
||||
|
||||
.PHONY: init
|
||||
init:
|
||||
|
@ -63,38 +59,21 @@ bootstrap:
|
|||
.PHONY: clean
|
||||
clean:
|
||||
script/clean
|
||||
xcodebuild clean
|
||||
# swift package clean
|
||||
# swift package reset
|
||||
|
||||
.PHONY: distclean
|
||||
distclean:
|
||||
rm -rf Packages
|
||||
# swift package clean
|
||||
distclean: clean
|
||||
|
||||
.PHONY: updateHeaders
|
||||
updateHeaders:
|
||||
script/update_headers
|
||||
|
||||
.PHONY: build
|
||||
build: #copyRunResources
|
||||
build:
|
||||
script/build
|
||||
# swift build $(SWIFTC_FLAGS) $(LINKER_FLAGS)
|
||||
|
||||
.PHONY: test
|
||||
test: build #copyTestResources
|
||||
test: build
|
||||
script/test
|
||||
# swift test --enable-test-discovery
|
||||
|
||||
.PHONY: copyRunResources
|
||||
copyRunResources:
|
||||
mkdir -p ${RUN_RESOURCES_DIRECTORY}
|
||||
cp -r Resources/* ${RUN_RESOURCES_DIRECTORY}
|
||||
|
||||
.PHONY: copyTestResources
|
||||
copyTestResources:
|
||||
mkdir -p ${TEST_RESOURCES_DIRECTORY}
|
||||
cp -r Resources/* ${TEST_RESOURCES_DIRECTORY}
|
||||
|
||||
# make run ARGS="asdf"
|
||||
.PHONY: run
|
||||
|
@ -109,6 +88,10 @@ install:
|
|||
uninstall:
|
||||
script/uninstall
|
||||
|
||||
.PHONY: format
|
||||
lint:
|
||||
script/format
|
||||
|
||||
.PHONY: lint
|
||||
lint:
|
||||
script/lint
|
||||
|
@ -117,10 +100,6 @@ lint:
|
|||
danger:
|
||||
script/danger
|
||||
|
||||
.PHONY: archive
|
||||
archive:
|
||||
script/archive
|
||||
|
||||
# Builds bottles
|
||||
.PHONY: bottles
|
||||
bottles:
|
||||
|
@ -138,26 +117,18 @@ package:
|
|||
packageInstall:
|
||||
script/package_install
|
||||
|
||||
.PHONY: release
|
||||
release:
|
||||
script/release
|
||||
.PHONY: describe
|
||||
describe:
|
||||
swift package describe
|
||||
|
||||
# .PHONY: describe
|
||||
# describe:
|
||||
# swift package describe
|
||||
.PHONY: resolve
|
||||
resolve:
|
||||
swift package resolve
|
||||
|
||||
# .PHONY: resolve
|
||||
# resolve:
|
||||
# swift package resolve
|
||||
.PHONY: dependencies
|
||||
dependencies: resolve
|
||||
swift package show-dependencies
|
||||
|
||||
# .PHONY: dependencies
|
||||
# dependencies: resolve
|
||||
# swift package show-dependencies
|
||||
|
||||
# .PHONY: update
|
||||
# update: resolve
|
||||
# swift package update
|
||||
|
||||
# .PHONY: xcproj
|
||||
# xcproj:
|
||||
# swift package generate-xcodeproj
|
||||
.PHONY: update
|
||||
update: resolve
|
||||
swift package update
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
#!/bin/bash -e
|
||||
#
|
||||
# script/archive
|
||||
# mas
|
||||
#
|
||||
# Compresses artifacts so the can be archived more easily.
|
||||
#
|
||||
|
||||
echo "==> 🗜️ Compressing mas"
|
||||
zip .build/mas.zip .build/apple/Products/Release/mas
|
||||
|
||||
echo "==> 🔢 File Hash"
|
||||
shasum -a 256 .build/mas.zip
|
|
@ -18,6 +18,13 @@ main() {
|
|||
rm -f Brewfile.lock.json
|
||||
brew bundle install --no-upgrade --verbose
|
||||
|
||||
if [[ "CI" != "true" ]]; then
|
||||
# Already installed on GitHub Actions runner.
|
||||
if ! command -v swiftlint >/dev/null; then
|
||||
brew install swiftlint
|
||||
fi
|
||||
fi
|
||||
|
||||
# Generate Package.swift
|
||||
script/version
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
# brew bump-formula-pr --help
|
||||
#
|
||||
|
||||
BREW_CORE_PATH="$(brew --prefix)/Homebrew/Library/Taps/homebrew/homebrew-core/Formula"
|
||||
BREW_CORE_PATH="$(brew --prefix)/Library/Taps/homebrew/homebrew-core/Formula"
|
||||
|
||||
function usage {
|
||||
echo "Usage: brew_formula_bump [v1.0] [sha1_hash]"
|
||||
|
|
19
script/build
19
script/build
|
@ -6,8 +6,21 @@
|
|||
# Builds the Swift Package.
|
||||
#
|
||||
|
||||
script/clean
|
||||
script/lint
|
||||
# Build for the host architecture by default.
|
||||
ARCH=
|
||||
if [[ "$1" == '--universal' ]]; then
|
||||
ARCH='--arch arm64 --arch x86_64'
|
||||
fi
|
||||
|
||||
# Disable the manifest cache on Xcode 12.5 and later.
|
||||
CACHE=
|
||||
if [[ "$(swift build --help)" =~ manifest-cache ]]; then
|
||||
CACHE='--manifest-cache none'
|
||||
fi
|
||||
|
||||
echo "==> 🏗️ Building mas ($(script/version))"
|
||||
swift build --configuration release --arch arm64 --arch x86_64
|
||||
swift build \
|
||||
--configuration release \
|
||||
${ARCH} \
|
||||
--disable-sandbox \
|
||||
${CACHE}
|
||||
|
|
|
@ -11,6 +11,5 @@ VERSION=$(script/version)
|
|||
echo "Building mas $VERSION artifacts"
|
||||
|
||||
script/clean
|
||||
script/build
|
||||
script/archive
|
||||
script/build --universal
|
||||
script/package
|
||||
|
|
|
@ -6,5 +6,5 @@
|
|||
# Deletes the build directory.
|
||||
#
|
||||
|
||||
BUILD_DIR=.build
|
||||
rm -rf ${BUILD_DIR:?}
|
||||
swift package clean
|
||||
swift package reset
|
||||
|
|
|
@ -10,18 +10,29 @@
|
|||
# https://github.com/Homebrew/homebrew-core/blob/master/Formula/mas.rb
|
||||
#
|
||||
|
||||
ARCH=$(uname -m)
|
||||
RELEASE=.build/${ARCH}-apple-macosx/release
|
||||
VERSION=$(script/version)
|
||||
|
||||
# Override default prefix path with optional 1st arg
|
||||
if test -n "$1"; then
|
||||
PREFIX="$1"
|
||||
elif [[ $(uname -m) == 'arm64' ]]; then
|
||||
if [[ $(uname -m) == 'arm64' ]]; then
|
||||
PREFIX=/opt/homebrew
|
||||
else
|
||||
PREFIX=/usr/local
|
||||
fi
|
||||
|
||||
while test -n "$1"; do
|
||||
if [[ "$1" == '--universal' ]]; then
|
||||
ARCH=universal
|
||||
RELEASE=.build/apple/Products/Release
|
||||
else
|
||||
# Override default prefix path with optional arg
|
||||
PREFIX="$1"
|
||||
fi
|
||||
|
||||
shift
|
||||
done
|
||||
|
||||
echo "==> 📲 Installing mas ($VERSION) for $ARCH to $PREFIX"
|
||||
ditto -v \
|
||||
".build/apple/Products/Release/mas" \
|
||||
"$RELEASE/mas" \
|
||||
"$PREFIX/bin/"
|
||||
|
|
|
@ -18,7 +18,7 @@ DISTRIBUTION_PLIST="Package/Distribution.plist"
|
|||
|
||||
# Destination for install root
|
||||
DSTROOT=.build/distributions
|
||||
script/install "$DSTROOT/usr/local"
|
||||
script/install "$DSTROOT/usr/local" --universal
|
||||
|
||||
VERSION=$(script/version)
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# script/uninstall
|
||||
# mas
|
||||
#
|
||||
# Removes mas and MasKit from PREFIX.
|
||||
# Removes mas from PREFIX.
|
||||
#
|
||||
|
||||
# Override default prefix path with optional 1st arg
|
||||
|
|
Loading…
Reference in a new issue