Skip to content

Commit

Permalink
Load Keystore PostBuild script (#1730)
Browse files Browse the repository at this point in the history
* Load Keystore PostBuild script
Only on Archive for Release configuration loads secrects

* add build script
  • Loading branch information
rinat-enikeev authored Nov 25, 2023
1 parent a242628 commit 128e62b
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ station/Classes/Networking/Assembly/Networking.plist
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## Build generated
build/
DerivedData/

## Various settings
Expand Down
9 changes: 8 additions & 1 deletion project_frameworks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,14 @@ targets:
TARGETED_DEVICE_FAMILY: 1,2
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD: true
CODE_SIGN_ENTITLEMENTS: station/station.entitlements

postBuildScripts:
- path: scripts/build/load_keystore.sh
name: Load Keystore
inputFiles:
- $(SRCROOT)/station/Classes/Networking/Assembly/Networking.plist
- $(SRCROOT)/station/Resources/Plists/GoogleService-Info.plist
runOnlyWhenInstalling: true
basedOnDependencyAnalysis: false
schemes:
station:
build:
Expand Down
9 changes: 8 additions & 1 deletion project_spm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,14 @@ targets:
TARGETED_DEVICE_FAMILY: 1,2
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD: true
CODE_SIGN_ENTITLEMENTS: station/station.entitlements

postBuildScripts:
- path: scripts/build/load_keystore.sh
name: Load Keystore
inputFiles:
- $(SRCROOT)/station/Classes/Networking/Assembly/Networking.plist
- $(SRCROOT)/station/Resources/Plists/GoogleService-Info.plist
runOnlyWhenInstalling: true
basedOnDependencyAnalysis: false
schemes:
station:
build:
Expand Down
16 changes: 16 additions & 0 deletions scripts/build/load_keystore.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
if [ "${CONFIGURATION}" = "Release" ]; then
BUILD_APP_DIR=${BUILT_PRODUCTS_DIR}/${FULL_PRODUCT_NAME}
git clone git@github.com:ruuvi/com.ruuvi.station.ios.keystore.git
if [ $? -eq 0 ]; then
/bin/cp -rf com.ruuvi.station.ios.keystore/GoogleService-Info.plist "$BUILD_APP_DIR/GoogleService-Info.plist"
/bin/cp -rf com.ruuvi.station.ios.keystore/Networking.plist "$BUILD_APP_DIR/Networking.plist"
rm -rf com.ruuvi.station.ios.keystore
else
if grep -q "{ set your API key here }" $SCRIPT_INPUT_FILE_0; then
echo "warning: Missing OpenWeatherMap API key. In order to make Virtual Sensors work please obtain API key on https://openweathermap.org and put into station/Classes/Networking/Assembly/Networking.plist"
fi
if grep -q "1:925543306936:ios:84f5fda343c52e7671c64d" $SCRIPT_INPUT_FILE_1; then
echo "warning: Demo GoogleServices credentials. If you want to use your own GoogleServices credentials, please replace the station/Resources/Plists/GoogleService-Info.plist file"
fi
fi
fi

0 comments on commit 128e62b

Please sign in to comment.