diff options
Diffstat (limited to 'misc')
-rw-r--r-- | misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj | 12 | ||||
-rw-r--r-- | misc/dist/ios_xcode/godot_ios/godot_ios-Info.plist | 10 | ||||
-rw-r--r-- | misc/hooks/asmessage.applescript | 59 | ||||
-rwxr-xr-x | misc/hooks/pre-commit-black | 19 | ||||
-rwxr-xr-x | misc/hooks/pre-commit-clang-format | 19 | ||||
-rwxr-xr-x | misc/scripts/file_format.sh | 18 |
6 files changed, 120 insertions, 17 deletions
diff --git a/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj b/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj index e717b501f4..16e58172b2 100644 --- a/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj +++ b/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj @@ -328,7 +328,11 @@ "$(PROJECT_DIR)/**", ); PRODUCT_BUNDLE_IDENTIFIER = $bundle_identifier; - PRODUCT_NAME = "$(TARGET_NAME)"; + INFOPLIST_KEY_CFBundleDisplayName = "$name"; + PRODUCT_NAME = "$binary"; + EXECUTABLE_NAME = "$binary"; + MARKETING_VERSION = $short_version; + CURRENT_PROJECT_VERSION = $version; PROVISIONING_PROFILE = "$provisioning_profile_uuid_debug"; TARGETED_DEVICE_FAMILY = "$targeted_device_family"; VALID_ARCHS = "arm64 x86_64"; @@ -360,7 +364,11 @@ "$(PROJECT_DIR)/**", ); PRODUCT_BUNDLE_IDENTIFIER = $bundle_identifier; - PRODUCT_NAME = "$(TARGET_NAME)"; + INFOPLIST_KEY_CFBundleDisplayName = "$name"; + PRODUCT_NAME = "$binary"; + EXECUTABLE_NAME = "$binary"; + MARKETING_VERSION = $short_version; + CURRENT_PROJECT_VERSION = $version; PROVISIONING_PROFILE = "$provisioning_profile_uuid_release"; TARGETED_DEVICE_FAMILY = "$targeted_device_family"; VALID_ARCHS = "arm64 x86_64"; diff --git a/misc/dist/ios_xcode/godot_ios/godot_ios-Info.plist b/misc/dist/ios_xcode/godot_ios/godot_ios-Info.plist index b88dfae5b2..ee5f1d35ae 100644 --- a/misc/dist/ios_xcode/godot_ios/godot_ios-Info.plist +++ b/misc/dist/ios_xcode/godot_ios/godot_ios-Info.plist @@ -5,9 +5,9 @@ <key>CFBundleDevelopmentRegion</key> <string>en</string> <key>CFBundleDisplayName</key> - <string>$name</string> + <string>$(INFOPLIST_KEY_CFBundleDisplayName)</string> <key>CFBundleExecutable</key> - <string>$binary</string> + <string>$(EXECUTABLE_NAME)</string> <key>CFBundleIcons</key> <dict/> <key>CFBundleIcons~ipad</key> @@ -17,15 +17,15 @@ <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> - <string>$name</string> + <string>$(PRODUCT_NAME)</string> <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> - <string>$short_version</string> + <string>$(MARKETING_VERSION)</string> <key>CFBundleSignature</key> <string>$signature</string> <key>CFBundleVersion</key> - <string>$version</string> + <string>$(CURRENT_PROJECT_VERSION)</string> <key>ITSAppUsesNonExemptEncryption</key> <false /> <key>LSRequiresIPhoneOS</key> diff --git a/misc/hooks/asmessage.applescript b/misc/hooks/asmessage.applescript new file mode 100644 index 0000000000..15ba94dc37 --- /dev/null +++ b/misc/hooks/asmessage.applescript @@ -0,0 +1,59 @@ +on run argv + set vButtons to { "OK" } + set vButtonCodes to { 0 } + set vDbutton to "OK" + set vText to "" + set vTitle to "" + set vTimeout to -1 + + repeat with i from 1 to length of argv + try + set vArg to item i of argv + if vArg = "-buttons" then + set vButtonsAndCodes to my fSplit(item (i + 1) of argv, ",") + set vButtons to {} + set vButtonCodes to {} + repeat with j from 1 to length of vButtonsAndCodes + set vBtn to my fSplit(item j of vButtonsAndCodes, ":") + copy (item 1 of vBtn) to the end of the vButtons + copy (item 2 of vBtn) to the end of the vButtonCodes + end repeat + else if vArg = "-title" then + set vTitle to item (i + 1) of argv + else if vArg = "-center" then + -- not supported + else if vArg = "-default" then + set vDbutton to item (i + 1) of argv + else if vArg = "-geometry" then + -- not supported + else if vArg = "-nearmouse" then + -- not supported + else if vArg = "-timeout" then + set vTimeout to item (i + 1) of argv as integer + else if vArg = "-file" then + set vText to read (item (i + 1) of argv) as string + else if vArg = "-text" then + set vText to item (i + 1) of argv + end if + end try + end repeat + + set vDlg to display dialog vText buttons vButtons default button vDbutton with title vTitle giving up after vTimeout with icon stop + set vRet to button returned of vDlg + repeat with i from 1 to length of vButtons + set vBtn to item i of vButtons + if vBtn = vRet + return item i of vButtonCodes + end if + end repeat + + return 0 +end run + +on fSplit(vString, vDelimiter) + set oldDelimiters to AppleScript's text item delimiters + set AppleScript's text item delimiters to vDelimiter + set vArray to every text item of vString + set AppleScript's text item delimiters to oldDelimiters + return vArray +end fSplit diff --git a/misc/hooks/pre-commit-black b/misc/hooks/pre-commit-black index b7335685ae..bbad6a690a 100755 --- a/misc/hooks/pre-commit-black +++ b/misc/hooks/pre-commit-black @@ -34,6 +34,9 @@ XMSG=`which xmessage 2>/dev/null` # Path to powershell (Windows only) PWSH=`which powershell 2>/dev/null` +# Path to osascript (macOS only) +OSA=`which osascript 2>/dev/null` + ################################################################## # There should be no need to change anything below this line. @@ -69,6 +72,10 @@ if [ ! -x "$BLACK" ] ; then elif [ -x "$XMSG" ] ; then $XMSG -center -title "Error" "Error: black executable not found." exit 1 + elif [ -x "$OSA" ] ; then + asmessage="$(canonicalize_filename "$(dirname -- "$0")/asmessage.applescript")" + $OSA "$asmessage" -center -title "Error" --text "Error: black executable not found." + exit 1 elif [ \( \( "$OSTYPE" = "msys" \) -o \( "$OSTYPE" = "win32" \) \) -a \( -x "$PWSH" \) ]; then winmessage="$(canonicalize_filename "$(dirname -- "$0")/winmessage.ps1")" $PWSH -noprofile -executionpolicy bypass -file "$winmessage" -center -title "Error" --text "Error: black executable not found." @@ -159,6 +166,16 @@ while true; do else yn="N" fi + elif [ -x "$OSA" ] ; then + asmessage="$(canonicalize_filename "$(dirname -- "$0")/asmessage.applescript")" + choice=`$OSA "$asmessage" -file "$patch" -buttons "Apply":100,"Apply and stage":200,"Do not apply":0 -center -default "Do not apply" -geometry 800x600 -title "Do you want to apply that patch?"` + if [ "$choice" = "100" ] ; then + yn="Y" + elif [ "$choice" = "200" ] ; then + yn="S" + else + yn="N" + fi elif [ \( \( "$OSTYPE" = "msys" \) -o \( "$OSTYPE" = "win32" \) \) -a \( -x "$PWSH" \) ]; then winmessage="$(canonicalize_filename "$(dirname -- "$0")/winmessage.ps1")" $PWSH -noprofile -executionpolicy bypass -file "$winmessage" -file "$patch" -buttons "Apply":100,"Apply and stage":200,"Do not apply":0 -center -default "Do not apply" -geometry 800x600 -title "Do you want to apply that patch?" @@ -171,7 +188,7 @@ while true; do yn="N" fi else - printf "Error: zenity, xmessage, or powershell executable not found.\n" + printf "Error: zenity, xmessage, osascript, or powershell executable not found.\n" exit 1 fi else diff --git a/misc/hooks/pre-commit-clang-format b/misc/hooks/pre-commit-clang-format index 9570d5120b..fd0213c175 100755 --- a/misc/hooks/pre-commit-clang-format +++ b/misc/hooks/pre-commit-clang-format @@ -47,6 +47,9 @@ XMSG=`which xmessage 2>/dev/null` # Path to powershell (Windows only) PWSH=`which powershell 2>/dev/null` +# Path to osascript (macOS only) +OSA=`which osascript 2>/dev/null` + ################################################################## # There should be no need to change anything below this line. @@ -89,6 +92,10 @@ if [ ! -x "$CLANG_FORMAT" ] ; then elif [ -x "$XMSG" ] ; then $XMSG -center -title "Error" "$message" exit 1 + elif [ -x "$OSA" ] ; then + asmessage="$(canonicalize_filename "$(dirname -- "$0")/asmessage.applescript")" + $OSA "$asmessage" -center -title "Error" --text "$message" + exit 1 elif [ \( \( "$OSTYPE" = "msys" \) -o \( "$OSTYPE" = "win32" \) \) -a \( -x "$PWSH" \) ]; then winmessage="$(canonicalize_filename "$(dirname -- "$0")/winmessage.ps1")" $PWSH -noprofile -executionpolicy bypass -file "$winmessage" -center -title "Error" --text "$message" @@ -199,6 +206,16 @@ while true; do else yn="N" fi + elif [ -x "$OSA" ] ; then + asmessage="$(canonicalize_filename "$(dirname -- "$0")/asmessage.applescript")" + choice=`$OSA "$asmessage" -file "$patch" -buttons "Apply":100,"Apply and stage":200,"Do not apply":0 -center -default "Do not apply" -geometry 800x600 -title "Do you want to apply that patch?"` + if [ "$choice" = "100" ] ; then + yn="Y" + elif [ "$choice" = "200" ] ; then + yn="S" + else + yn="N" + fi elif [ \( \( "$OSTYPE" = "msys" \) -o \( "$OSTYPE" = "win32" \) \) -a \( -x "$PWSH" \) ]; then winmessage="$(canonicalize_filename "$(dirname -- "$0")/winmessage.ps1")" $PWSH -noprofile -executionpolicy bypass -file "$winmessage" -file "$patch" -buttons "Apply":100,"Apply and stage":200,"Do not apply":0 -center -default "Do not apply" -geometry 800x600 -title "Do you want to apply that patch?" @@ -211,7 +228,7 @@ while true; do yn="N" fi else - printf "Error: zenity, xmessage, or powershell executable not found.\n" + printf "Error: zenity, xmessage, osascript, or powershell executable not found.\n" exit 1 fi else diff --git a/misc/scripts/file_format.sh b/misc/scripts/file_format.sh index a2f33692f9..3ff5798e22 100755 --- a/misc/scripts/file_format.sh +++ b/misc/scripts/file_format.sh @@ -4,9 +4,9 @@ # This is supplementary to clang_format.sh and black_format.sh, but should be # run before them. -# We need dos2unix and recode. -if [ ! -x "$(command -v dos2unix)" -o ! -x "$(command -v recode)" ]; then - printf "Install 'dos2unix' and 'recode' to use this script.\n" +# We need dos2unix and isutf8. +if [ ! -x "$(command -v dos2unix)" -o ! -x "$(command -v isutf8)" ]; then + printf "Install 'dos2unix' and 'isutf8' (moreutils package) to use this script.\n" fi set -uo pipefail @@ -53,22 +53,24 @@ done diff=$(git diff --color) -# If no UTF-8 violations were collected and no diff has been -# generated all is OK, clean up, and exit. if [ ! -s utf8-validation.txt ] && [ -z "$diff" ] ; then + # If no UTF-8 violations were collected (the file is empty) and + # no diff has been generated all is OK, clean up, and exit. printf "Files in this commit comply with the formatting rules.\n" - rm -f utf8-violations.txt + rm -f utf8-validation.txt exit 0 fi -# Violations detected, notify the user, clean up, and exit. if [ -s utf8-validation.txt ] then + # If the file has content and is not empty, violations + # detected, notify the user, clean up, and exit. printf "\n*** The following files contain invalid UTF-8 character sequences:\n\n" cat utf8-validation.txt - rm -f utf8-validation.txt fi +rm -f utf8-validation.txt + if [ ! -z "$diff" ] then printf "\n*** The following differences were found between the code " |