diff --git a/Makefile b/Makefile index 18fe17b..d95f808 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ srcdir = Sources REPODIR = $(shell pwd) BUILDDIR = $(REPODIR)/.build SOURCES = $(wildcard $(srcdir)/**/*.swift) - +RELEASEBUILDDIR = $(BUILDDIR)/apple/Products/Release/xcodes .DEFAULT_GOAL = all .PHONY: all @@ -33,19 +33,19 @@ sign: xcodes --prefix com.robotsandpencils. \ --options runtime \ --timestamp \ - "$(BUILDDIR)/release/xcodes" + "$(RELEASEBUILDDIR)" .PHONY: zip zip: sign @rm xcodes.zip 2> /dev/null || true - @zip --junk-paths xcodes.zip "$(BUILDDIR)/release/xcodes" + @zip --junk-paths xcodes.zip "$(RELEASEBUILDDIR)" @open -R xcodes.zip # E.g. -# make notarize USERNAME="test@example.com" PASSWORD="@keychain:altool" ASC_PROVIDER=MyOrg +# make notarize TEAMID="ABCD123" .PHONY: notarize notarize: zip - ./notarize.sh "$(USERNAME)" "$(PASSWORD)" "$(ASC_PROVIDER)" xcodes.zip + ./notarize.sh xcodes.zip "$(TEAMID)" # E.g. # make bottle VERSION=0.4.0 @@ -54,7 +54,7 @@ bottle: sign @rm -r xcodes 2> /dev/null || true @rm *.tar.gz 2> /dev/null || true @mkdir -p xcodes/$(VERSION)/bin - @cp "$(BUILDDIR)/release/xcodes" xcodes/$(VERSION)/bin + @cp "$(RELEASEBUILDDIR)" xcodes/$(VERSION)/bin @tar -zcvf xcodes-$(VERSION).mojave.bottle.tar.gz -C "$(REPODIR)" xcodes shasum -a 256 xcodes-$(VERSION).mojave.bottle.tar.gz | cut -f1 -d' ' @open -R xcodes-$(VERSION).mojave.bottle.tar.gz @@ -62,7 +62,7 @@ bottle: sign .PHONY: install install: xcodes @install -d "$(bindir)" - @install "$(BUILDDIR)/release/xcodes" "$(bindir)" + @install "$(RELEASEBUILDDIR)" "$(bindir)" .PHONY: uninstall uninstall: @@ -70,7 +70,7 @@ uninstall: .PHONY: distclean distclean: - @rm -f $(BUILDDIR)/release + @rm -f $(RELEASEBUILDDIR) .PHONY: clean clean: distclean diff --git a/README.md b/README.md index 0b0ce97..c8b13b5 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,7 @@ xcodes install 11.2 GM seed xcodes install 9.0 --path ~/Archive/Xcode_9.xip xcodes install --latest-prerelease xcodes install --latest --directory "/Volumes/Bag Of Holding/" +xcodes install --latest --experimental-unxip ``` You'll then be prompted to enter your Apple ID username and password. You can also provide these with the `XCODES_USERNAME` and `XCODES_PASSWORD` environment variables. @@ -106,6 +107,14 @@ Xcode will be installed to /Applications by default, but you can provide the pat - `version`: Print the version number of xcodes itself - `signout`: Clears the stored username and password +### Experimental Unxip - for faster unxipping + +Thanks to the amazing work by [saagarjhi](https://github.com/saagarjha/unxip) - Xcodes now includes the ability to unxip up to 70% faster on some systems. + +``` +xcodes install --latest --experimental-unxip +``` + ### Shell Completion Scripts xcodes can generate completion scripts which allow you to press the tab key on your keyboard to autocomplete commands and arguments when typing an xcodes command. The steps to install a completion script depend on the shell that you use. More information about installation instructions for different shells and the underlying implementation is available in the [swift-argument-parser repo](https://github.com/apple/swift-argument-parser/blob/main/Sources/ArgumentParser/Documentation.docc/Articles/InstallingCompletionScripts.md). @@ -123,7 +132,7 @@ xcodes --generate-completion-script > ~/.oh-my-zsh/completions/_xcodes ## Development -You'll need Xcode 12 in order to build and run xcodes. +You'll need Xcode 13 in order to build and run xcodes.
Using Xcode @@ -166,9 +175,7 @@ make bottle VERSION="$VERSION" # Notarize the release build # This can take a while make notarize \ - USERNAME="user@example.com" \ - PASSWORD="@keychain:ALTool Notarization" \ - ASC_PROVIDER="YourAppStoreConnectTeamName" + TEAMID="ABC123" # Push the new version bump commit and tag git push --follow-tags diff --git a/Sources/XcodesKit/Version.swift b/Sources/XcodesKit/Version.swift index 62fcb1b..e722549 100644 --- a/Sources/XcodesKit/Version.swift +++ b/Sources/XcodesKit/Version.swift @@ -1,3 +1,3 @@ import Version -public let version = Version("0.19.0")! +public let version = Version("0.20.0")! diff --git a/notarize.sh b/notarize.sh index b2d4e68..fa438f0 100755 --- a/notarize.sh +++ b/notarize.sh @@ -6,43 +6,14 @@ # # Adapted from https://github.com/keybase/client/blob/46f5df0aa64ff19198ba7b044bbb7cd907c0be9f/packaging/desktop/package_darwin.sh -username="$1" -password="$2" -asc_provider="$3" -file="$4" +file="$1" +team_id="$2" echo "Uploading to notarization service" -uuid=$(xcrun altool \ - --notarize-app \ - --primary-bundle-id "com.robotsandpencils.xcodes.zip" \ - --username "$username" \ - --password "$password" \ - --asc-provider "$asc_provider" \ - --file "$file" 2>&1 | \ - grep 'RequestUUID' | \ - awk '{ print $3 }') +result=$(xcrun notarytool submit "$file" \ + --keychain-profile "AC_PASSWORD" \ + --team-id "$team_id" \ + --wait) -echo "Successfully uploaded to notarization service, polling for result: $uuid" - -sleep 15 - while : - do - fullstatus=$(xcrun altool \ - --notarization-info "$uuid" \ - --username "$username" \ - --password "$password" \ - --asc-provider "$asc_provider" 2>&1) - status=$(echo "$fullstatus" | grep 'Status\:' | awk '{ print $2 }') - if [ "$status" = "success" ]; then - echo "Notarization success" - exit 0 - elif [ "$status" = "in" ]; then - echo "Notarization still in progress, sleeping for 15 seconds and trying again" - sleep 15 - else - echo "Notarization failed, full status below" - echo "$fullstatus" - exit 1 - fi - done +echo $result