Skip to content

Commit

Permalink
Mom Customizations
Browse files Browse the repository at this point in the history
  • Loading branch information
gestrich committed Apr 18, 2024
1 parent 69e36c1 commit 38bf2f3
Show file tree
Hide file tree
Showing 8 changed files with 154 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,6 @@
[submodule "LibreTransmitter"]
path = LibreTransmitter
url = https://github.com/LoopKit/LibreTransmitter.git
[submodule "SugarMonitorService"]
path = SugarMonitorService
url = https://github.com/gestrich/SugarMonitorService.git
2 changes: 1 addition & 1 deletion Loop
2 changes: 1 addition & 1 deletion LoopKit
3 changes: 3 additions & 0 deletions LoopWorkspace.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 29 additions & 1 deletion LoopWorkspace.xcworkspace/xcshareddata/swiftpm/Package.resolved
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"originHash" : "ff4ca06bf6a09d91b0401825dc466b55672f36331eab10789bcc55575e63476c",
"pins" : [
{
"identity" : "amplitude-ios",
Expand All @@ -18,6 +19,15 @@
"version" : "1.0.1"
}
},
{
"identity" : "appcenter-sdk-apple",
"kind" : "remoteSourceControl",
"location" : "https://github.com/microsoft/appcenter-sdk-apple",
"state" : {
"revision" : "b2dc99cfedead0bad4e6573d86c5228c89cff332",
"version" : "4.4.3"
}
},
{
"identity" : "base32",
"kind" : "remoteSourceControl",
Expand Down Expand Up @@ -71,6 +81,15 @@
"revision" : "8e4022f2852d77240d0a17482cbfe325354aac70"
}
},
{
"identity" : "plcrashreporter",
"kind" : "remoteSourceControl",
"location" : "https://github.com/microsoft/PLCrashReporter.git",
"state" : {
"revision" : "81cdec2b3827feb03286cb297f4c501a8eb98df1",
"version" : "1.10.2"
}
},
{
"identity" : "slidebutton",
"kind" : "remoteSourceControl",
Expand All @@ -80,6 +99,15 @@
"revision" : "5eacebba4d7deeb693592bc9a62ab2d2181e133b"
}
},
{
"identity" : "sugar_service",
"kind" : "remoteSourceControl",
"location" : "https://github.com/gestrich/sugar_service.git",
"state" : {
"branch" : "main",
"revision" : "06c3ca689c59178d27108e50c88f807730681def"
}
},
{
"identity" : "swiftcharts",
"kind" : "remoteSourceControl",
Expand Down Expand Up @@ -108,5 +136,5 @@
}
}
],
"version" : 2
"version" : 3
}
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,20 @@
ReferencedContainer = "container:TidepoolService/TidepoolService.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A99C711A233965F000AB9035"
BuildableName = "SugarMonitorServiceKitPlugin.loopplugin"
BlueprintName = "SugarMonitorServiceKitPlugin"
ReferencedContainer = "container:SugarMonitorService/SugarMonitorService.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
Expand Down
1 change: 1 addition & 0 deletions SugarMonitorService
Submodule SugarMonitorService added at 699724
102 changes: 102 additions & 0 deletions tools.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
#!/bin/bash

set -e
set -u

#From https://www.bluelabellabs.com/blog/generate-apple-certificates-provisioning-profiles/

APP_NAME=Loop
TEAM_ID="5K844XFC6W"
BUNDLE_ID="com.$TEAM_ID.loopkit.Loop"
WORKSPACE_NAME="LoopWorkspace"
SCHEME_NAME="LoopWorkspace"
DISTRIBUTION_GROUP="Collaborators"

PROVISIONING_PROFILE_NAME="Apple Development" #How does this work when you have multiple extensions that use different provisioning profiles?
CODE_SIGNING_IDENTITY="Apple Development"
CODE_SIGNING_STYLE="Automatic"

RESULT_PATH="/Users/bill/dev/personal/loop/archives/$APP_NAME"
ARCHIVE_PATH="$RESULT_PATH/build.xcarchive"
EXPORT_PATH="$RESULT_PATH/adhocexport"
EXPORT_OPTIONS_PATH="$RESULT_PATH/exportOptions.plist"
EXPORT_METHOD="ad-hoc"
UPLOAD_SYMBOLS=false

function archive(){
rm -rf "$RESULT_PATH"
mkdir "$RESULT_PATH"
DERIVED_DATA_PATH="$RESULT_PATH/derived_data"
RESULT_BUNDLE_PATH="$RESULT_PATH/resultbundle.xcresult"
xcodebuild archive \
-workspace ${WORKSPACE_NAME}.xcworkspace \
-scheme ${SCHEME_NAME} \
-destination generic/platform=iOS \
-archivePath $ARCHIVE_PATH \
-derivedDataPath $DERIVED_DATA_PATH \
-resultBundleVersion 3 \
-resultBundlePath $RESULT_BUNDLE_PATH \
-IDEPostProgressNotifications=YES \
CODE_SIGN_IDENTITY="$CODE_SIGNING_IDENTITY" \
AD_HOC_CODE_SIGNING_ALLOWED=YES \
CODE_SIGN_STYLE=$CODE_SIGNING_STYLE \
DEVELOPMENT_TEAM=$TEAM_ID \
COMPILER_INDEX_STORE_ENABLE=NO \
-hideShellScriptEnvironment \
-configuration Release
}

function exportAll(){
# Create exportOptions.plist
cat > "$EXPORT_OPTIONS_PATH" <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>compileBitcode</key>
<false/>
<key>teamID</key>
<string>${TEAM_ID}</string>
<key>method</key>
<string>${EXPORT_METHOD}</string>
<key>uploadSymbols</key>
<${UPLOAD_SYMBOLS}/>
<key>provisioningProfiles</key>
<dict>
<key>${BUNDLE_ID}</key>
<string>${PROVISIONING_PROFILE_NAME}</string>
</dict>
</dict>
</plist>
EOF
xcodebuild -exportArchive \
-archivePath $ARCHIVE_PATH \
-exportPath $EXPORT_PATH \
-exportOptionsPlist "$EXPORT_OPTIONS_PATH" \
-allowProvisioningUpdates
}

function appCenterUploads {
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
"../LoopRepoManagement/app-center-upload.sh" uploadIPA "${EXPORT_PATH}/${APP_NAME}.ipa" $APP_NAME "$DISTRIBUTION_GROUP"
"../LoopRepoManagement/app-center-upload.sh" uploadSymbols "${ARCHIVE_PATH}/dSYMs" $APP_NAME
}

function runAll(){
archive
exportAll
appCenterUploads
}

# Check if the function exists
if [ $# -gt 0 ]; then
#if declare -f "$1" > /dev/null
# call arguments verbatim
"$@"
else
# Show a helpful error
echo "Functions Available:"
typeset -f | awk '!/^main[ (]/ && /^[^ {}]+ *\(\)/ { gsub(/[()]/, "", $1); print $1}'
exit 1
fi

0 comments on commit 38bf2f3

Please sign in to comment.