From 9b94b71a7158452399cce3163e22e38f0a48193c Mon Sep 17 00:00:00 2001 From: Yoshi Sugawara Date: Wed, 15 Dec 2021 22:36:43 -1000 Subject: [PATCH] Add script to build all release IPA/app files --- .gitignore | 1 + xcode/MAME4iOS/MAME4iOS-latest.xcconfig | 52 +++++++++++++++++++++++++ xcode/MAME4iOS/build-release-ipas.sh | 42 ++++++++++++++++++++ xcode/MAME4iOS/exportOptions.plist | 10 +++++ 4 files changed, 105 insertions(+) create mode 100644 xcode/MAME4iOS/MAME4iOS-latest.xcconfig create mode 100755 xcode/MAME4iOS/build-release-ipas.sh create mode 100644 xcode/MAME4iOS/exportOptions.plist diff --git a/.gitignore b/.gitignore index 37cdbf06..d43e42ae 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ libmame-dist/* xcuserdata obj .vscode/* +xcode/dist diff --git a/xcode/MAME4iOS/MAME4iOS-latest.xcconfig b/xcode/MAME4iOS/MAME4iOS-latest.xcconfig new file mode 100644 index 00000000..c234cda8 --- /dev/null +++ b/xcode/MAME4iOS/MAME4iOS-latest.xcconfig @@ -0,0 +1,52 @@ +// +// MAME4iOS.xcconfig +// MAME4iOS +// +// Created by Todd Laney on 10/10/20. +// Copyright © 2020 Seleuco. All rights reserved. +// +// Configuration settings file format documentation can be found at: +// https://help.apple.com/xcode/#/dev745c5c974 +// http://codeworkshop.net/posts/xcode-build-setting-transformations +// https://nshipster.com/xcconfig/ + + +// 1. change ORG_IDENTIFIER and DEVELOPMENT_TEAM +// the `ORG_IDENTIFIER` is a reverse DNS string that uniquely identifies your organization. +// you can also set the Development Team via the drop down in the Xcode project editor, for each Target. +// you can find your TeamID [here](https://developer.apple.com/account/#/membership) + +ORG_IDENTIFIER = com.example // CHANGE this to your Organization Identifier. +DEVELOPMENT_TEAM = R72X3BF4KE // CHANGE this to your Team ID. (or select in Xcode project editor) +CURRENT_PROJECT_VERSION = 2021.8 +MARKETING_VERSION = 2021.8 + +// 2. enable or disable entitlements +// tvOS TopShelf and iCloud import/export require special app entitlements + +ENTITLEMENTS_TYPE = -Base +// UN-COMMENT NEXT LINE if you want a build with full entitlements +// ENTITLEMENTS_TYPE = -Full +// UN-COMMENT PREV LINE if you want a build with full entitlements + +// 3. Select the MAME binary to link to. +// 139u1 or latest MAME version + +// USE THIS LINE for a local build of 139u1 MAME. (via make-ios.sh, make-tvos.sh, or make-mac.sh) +// MAMELIB = libmame-139u1 +// USE THIS LINE for a build of current latest MAME (via get-libmame.sh) +MAMELIB = libmame + +// these should not be changed. +PRODUCT_BUNDLE_IDENTIFIER = $(ORG_IDENTIFIER).$(PROJECT_NAME:lower) +APP_GROUP_IDENTIFIER = group.$(ORG_IDENTIFIER).$(PROJECT_NAME:lower) +ICLOUD_CONTAINER_IDENTIFIER = iCloud.$(ORG_IDENTIFIER).$(PROJECT_NAME:lower) +CODE_SIGN_ENTITLEMENTS = $(TARGET_NAME)/$(TARGET_NAME)$(ENTITLEMENTS_TYPE).entitlements + +MAMELIB_IOS = $(MAMELIB)-ios.a +MAMELIB_TVOS = $(MAMELIB)-tvos.a +MAMELIB_MACOS = $(MAMELIB)-mac.a + +MAMELIB_IOS[sdk=iphonesimulator*] = $(MAMELIB)-ios-simulator.a +MAMELIB_TVOS[sdk=appletvsimulator*] = $(MAMELIB)-tvos-simulator.a + diff --git a/xcode/MAME4iOS/build-release-ipas.sh b/xcode/MAME4iOS/build-release-ipas.sh new file mode 100755 index 00000000..8b79b9ae --- /dev/null +++ b/xcode/MAME4iOS/build-release-ipas.sh @@ -0,0 +1,42 @@ +#!/bin/sh + +C_RED="\033[0;31m" +C_BLUE="\033[0;34m" +C_RESET="\033[0m" + +echo "${C_RED}Before running, edit the TEAM identifier in the .xcconfig files so that code signing works.${C_RESET}\n\n" + +declare -a SCHEMES=("MAME4iOS Release" "MAME tvOS Release" "MAME4mac Release") +declare -a SCHEME_NAMES=("MAME4iOS" "MAME4tvOS" "MAME4mac") +declare -a CONFIGS=("MAME4iOS.xcconfig" "MAME4iOS-latest.xcconfig") +declare -a CONFIG_NAMES=("139" "latest") + +for i in "${!SCHEMES[@]}" +do + SCHEME="${SCHEMES[$i]}" + NAME="${SCHEME_NAMES[$i]}" + echo "${C_BLUE}Scheme: ${SCHEME}${C_RESET}" + for j in "${!CONFIGS[@]}" + do + CONFIG="${CONFIGS[$j]}" + ARCHIVE_NAME="${NAME}-${CONFIG_NAMES[$j]}" + echo "${C_BLUE}Config: ${CONFIG} Archive: ${ARCHIVE_NAME}${C_RESET}" + xcodebuild -project MAME4iOS.xcodeproj \ + -config Release -scheme "${SCHEME}" \ + -archivePath "../dist/${ARCHIVE_NAME}" \ + -xcconfig ${CONFIG} \ + -allowProvisioningUpdates \ + archive + + xcodebuild -exportArchive \ + -archivePath "../dist/${ARCHIVE_NAME}.xcarchive" \ + -exportOptionsPlist exportOptions.plist \ + -exportPath ../dist \ + -allowProvisioningUpdates + + # exportArchive will create an IPA file named: ${PRODUCT_NAME}.ipa (you can't specify the filename of the IPA) + mv ../dist/${NAME}.ipa ../dist/${ARCHIVE_NAME}.ipa + # do the mac app too + mv ../dist/${NAME}.app ../dist/${ARCHIVE_NAME}.app + done +done diff --git a/xcode/MAME4iOS/exportOptions.plist b/xcode/MAME4iOS/exportOptions.plist new file mode 100644 index 00000000..576ee534 --- /dev/null +++ b/xcode/MAME4iOS/exportOptions.plist @@ -0,0 +1,10 @@ + + + + + method + development + teamID + R72X3BF4KE + +