From 1aec9225e5a6891b224f893148ada190a85cc8da Mon Sep 17 00:00:00 2001 From: noumantahir Date: Thu, 7 Mar 2024 19:42:19 +0500 Subject: [PATCH] removing pod install from postinstall, running platform specific build commands --- appcenter-post-clone.sh | 20 +++++++------------- appcenter-pre-build.sh | 14 ++++++++++++-- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/appcenter-post-clone.sh b/appcenter-post-clone.sh index 0542292f9..f46b56290 100644 --- a/appcenter-post-clone.sh +++ b/appcenter-post-clone.sh @@ -20,19 +20,13 @@ printf "end of post-clone.sh\n" echo "Selected Platform to buit" echo "$PLATFORM" -#check if platform to be built for is android -if [ "$PLATFORM" == "Android" ]; then - echo "Android platform detected" - # Read package.json into a variable - package_json=$( package.json - -elif [ "$PLATFORM" == "iOS" ]; then - echo "Building for iOS" -fi \ No newline at end of file +# Update package.json with the modified postinstall script +echo "$updated_package_json" > package.json diff --git a/appcenter-pre-build.sh b/appcenter-pre-build.sh index ff6269ad9..cc673e6aa 100644 --- a/appcenter-pre-build.sh +++ b/appcenter-pre-build.sh @@ -62,7 +62,17 @@ printf "\n.env created with contents:\n" cat .env printf "\nEND OF .env\n" -cd ios && pod install && cd .. +#check if platform to be built for is android +if [ "$PLATFORM" == "Android" ]; then + echo "Building for Android" + cd android && ./gradlew clean && cd .. + +elif [ "$PLATFORM" == "iOS" ]; then + echo "Building for iOS" + cd ios && pod install && cd .. +fi + + + -cd android && ./gradlew clean && cd ..