Skip to content

Commit 177f8d9

Browse files
committed
Optimized build scripts
1 parent ede65a1 commit 177f8d9

File tree

7 files changed

+17
-8
lines changed

7 files changed

+17
-8
lines changed

android/inappreview/build.gradle.kts renamed to android/inapp_review/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ android {
4444

4545
buildToolsVersion = libs.versions.buildTools.get()
4646

47-
// Force AAR filenames to match original case and format
47+
// Force AAR filenames to match original case and format
4848
libraryVariants.all {
4949
outputs.all {
5050
val outputImpl = this as LibraryVariantOutputImpl

android/settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ dependencyResolutionManagement {
2222
}
2323

2424
rootProject.name = "godot-inapp-review-plugin"
25-
include(":inappreview")
25+
include(":inapp_review")

common/config.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#
44

55
pluginNodeName=InappReview
6+
pluginModuleName=inapp_review
67
pluginVersion=5.1
78
godotVersion=4.5.1
89
releaseType=stable

ios/script/build.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ COMMON_CONFIG_FILE=$COMMON_DIR/config.properties
2424
PLUGIN_NODE_NAME=$($SCRIPT_DIR/get_config_property.sh -f $COMMON_CONFIG_FILE pluginNodeName)
2525
PLUGIN_NAME="${PLUGIN_NODE_NAME}Plugin"
2626
PLUGIN_VERSION=$($SCRIPT_DIR/get_config_property.sh -f $COMMON_CONFIG_FILE pluginVersion)
27+
PLUGIN_MODULE_NAME=$($SCRIPT_DIR/get_config_property.sh -f $COMMON_CONFIG_FILE pluginModuleName)
2728
IOS_INITIALIZATION_METHOD=$($SCRIPT_DIR/get_config_property.sh -f $IOS_CONFIG_FILE initialization_method)
2829
IOS_DEINITIALIZATION_METHOD=$($SCRIPT_DIR/get_config_property.sh -f $IOS_CONFIG_FILE deinitialization_method)
2930
IOS_PLATFORM_VERSION=$($SCRIPT_DIR/get_config_property.sh -f $IOS_CONFIG_FILE platform_version)
@@ -288,10 +289,10 @@ function build_plugin()
288289
exit 1
289290
fi
290291

291-
SCHEME=${1:-inapp_review_plugin}
292-
PROJECT=${2:-inapp_review_plugin.xcodeproj}
293-
OUT=InappReviewPlugin
294-
CLASS=InappReviewPlugin
292+
SCHEME=${1:-${PLUGIN_MODULE_NAME}_plugin}
293+
PROJECT=${2:-${PLUGIN_MODULE_NAME}_plugin.xcodeproj}
294+
OUT=${PLUGIN_NAME}
295+
CLASS=${PLUGIN_NAME}
295296

296297
mkdir -p $FRAMEWORK_DIR
297298
mkdir -p $LIB_DIR

script/build.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ COMMON_CONFIG_FILE=$ROOT_DIR/common/config.properties
1717
PLUGIN_NODE_NAME=$($ROOT_DIR/ios/script/get_config_property.sh -f $COMMON_CONFIG_FILE pluginNodeName)
1818
PLUGIN_NAME="${PLUGIN_NODE_NAME}Plugin"
1919
PLUGIN_VERSION=$($ROOT_DIR/ios/script/get_config_property.sh -f $COMMON_CONFIG_FILE pluginVersion)
20+
PLUGIN_MODULE_NAME=$($ROOT_DIR/ios/script/get_config_property.sh -f $COMMON_CONFIG_FILE pluginModuleName)
2021

2122
do_clean=false
2223
do_build_android=false
@@ -166,7 +167,13 @@ function create_multi_platform_archive()
166167
cp -r $DEMO_DIR/ios/plugins/* $tmp_directory/ios/plugins
167168

168169
mkdir -p $tmp_directory/ios/framework
169-
cp -r $DEMO_DIR/ios/framework/* $tmp_directory/ios/framework
170+
171+
# Check if the directory exists AND find can locate at least one entry inside
172+
if [ -d "$DEMO_DIR/ios/framework" ] && find "$DEMO_DIR/ios/framework" -mindepth 1 -print -quit 2>/dev/null | grep -q .; then
173+
cp -r "$DEMO_DIR/ios/framework/"* "$tmp_directory/ios/framework"
174+
else
175+
display_warning "Skipping copy: $DEMO_DIR/ios/framework is empty or does not exist."
176+
fi
170177

171178
display_step "creating $zip_file_name file in $DEST_DIR..."
172179
pushd $tmp_directory > /dev/null
@@ -269,7 +276,7 @@ then
269276
create_multi_platform_archive
270277

271278
display_step "Copying Android release archive"
272-
cp $ROOT_DIR/android/admob/build/dist/$PLUGIN_NAME-Android-v$PLUGIN_VERSION.zip $DEST_DIR
279+
cp $ROOT_DIR/android/${PLUGIN_MODULE_NAME}/build/dist/$PLUGIN_NAME-Android-v$PLUGIN_VERSION.zip $DEST_DIR
273280

274281
display_step "Copying iOS release archive"
275282
cp $ROOT_DIR/ios/build/release/$PLUGIN_NAME-iOS-v$PLUGIN_VERSION.zip $DEST_DIR

0 commit comments

Comments
 (0)