diff options
Diffstat (limited to 'scripts/create_framework.sh')
-rwxr-xr-x | scripts/create_framework.sh | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/scripts/create_framework.sh b/scripts/create_framework.sh index 952e45adb..93796dc42 100755 --- a/scripts/create_framework.sh +++ b/scripts/create_framework.sh @@ -2,16 +2,16 @@ # George Miller # 07-07-2022 -# If you don't have permission to run, try: chmod u+x create_framework.sh +# If you do not have permission to run, try: chmod u+x create_framework.sh -# utility function for prompting the user Y/N -# takes in a string promt for the input -# returns 1 for yes/true or 0 for no/false +# A utility function for prompting the user Y/N +# This takes in a string prompt for the input +# This returns 1 for yes/true or 0 for no/false prompt_user() { user_input="g" echo - echo $1" (Y/N)" + echo $1" (Y/N)?" read user_input while [[ ! $user_input == [YyNn] ]]; do echo $1" (Y/N)?" @@ -24,7 +24,7 @@ prompt_user() { fi } -# 1 make sure we are in teh correct directory +# 1 Make sure we are in the correct directory # If we are running from the scripts directory, we want to pop back to the project root to do everything. if [[ $PWD == *"scripts" ]]; then cd .. @@ -36,17 +36,16 @@ if [[ $PWD != *"sdl_ios" ]]; then fi -# if there is no command line ask for a version number +# If there is no command line ask for a version number if [ -z $1 ]; then - # 2 get the verison number - # get the verison number - # at this point the version in the project file should be correct, so use it. + # Get the version number + # At this point the version in the project file should be correct, so use it. project_file="./SmartDeviceLink-iOS.xcodeproj/project.pbxproj" current_version_number=$(sed -n '/MARKETING_VERSION/{s/MARKETING_VERSION = //;s/;//;s/^[[:space:]]*//;p;q;}' $project_file) if [ -z $current_version_number ]; then current_version_number="1.0.0"; fi echo "Current Version: "$current_version_number - # todo - we can streamline this by trusting the project file to always have the correct version (bail out if project file missing) + # TODO - we can streamline this by trusting the project file to always have the correct version (bail out if project file missing) prompt_user "Is this version correct" if [[ $? == 0 ]]; then # Prompt user for new version @@ -62,28 +61,28 @@ if [ -z $1 ]; then else new_version_number=$1 fi -# 3 Add a binary xcframework archive for manual installation with the following commands +# Add a binary xcframework archive for manual installation with the following commands echo echo "Creating a binary xcframework for manual installation" -# this builds the framework +# This builds the framework xcodebuild archive -project 'SmartDeviceLink-iOS.xcodeproj/' -scheme 'SmartDeviceLink' -configuration Release -destination 'generic/platform=iOS' -archivePath './SmartDeviceLink-Device.xcarchive' SKIP_INSTALL=NO xcodebuild archive -project 'SmartDeviceLink-iOS.xcodeproj/' -scheme 'SmartDeviceLink' -configuration Release -destination 'generic/platform=iOS Simulator' -archivePath './SmartDeviceLink-Simulator.xcarchive' SKIP_INSTALL=NO xcodebuild -create-xcframework -framework './SmartDeviceLink-Device.xcarchive/Products/Library/Frameworks/SmartDeviceLink.framework/' -framework './SmartDeviceLink-Simulator.xcarchive/Products/Library/Frameworks/SmartDeviceLink.framework/' -output './SmartDeviceLink.xcframework' -# todo - is there a way we can test that the build was successful. +# TODO - is there a way we can test that the build was successful. folder="SmartDeviceLink.xcframework" zip_file_name="SmartDeviceLink-$new_version_number.xcframework.zip" -# kill the old zip if present. Useful for re-running the script +# Kill the old zip if present. Useful for re-running the script if [ -f $zip_file_name ]; then rm $zip_file_name; fi -# verify folder exists before acting on it. +# Verify folder exists before acting on it. if [ -d "$folder" ]; then zip $zip_file_name $folder # Check to see if the zip exists, and then remove old files. if [ -f "$zip_file_name" ]; then rm -r $folder; fi fi -#cleanup artifacts +# Cleanup artifacts folder="SmartDeviceLink-Device.xcarchive" if [ -d "$folder" ]; then rm -r $folder; fi @@ -91,6 +90,5 @@ folder="SmartDeviceLink-Simulator.xcarchive" if [ -d "$folder" ]; then rm -r $folder; fi echo -echo "The xcframework zip file was created at $zip_file_name. Please add it to the Github Release, then press enter..." -read user_input +echo "The xcframework zip file was created at $zip_file_name." |