Skip to content

Commit

Permalink
Intents and PNService targets from xcodegen (#1729)
Browse files Browse the repository at this point in the history
* Add PNService to xcodegen

* Add intents to xcodegen

* Load Keystore PostBuild script (#1730)

* 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 287ab8d commit 4840a07
Show file tree
Hide file tree
Showing 9 changed files with 203 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
20 changes: 20 additions & 0 deletions intents/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>Ruuvi Station</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
Expand All @@ -20,5 +38,7 @@
<key>NSExtensionPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).IntentHandler</string>
</dict>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2023 Ruuvi Innovations Oy. All rights reserved.</string>
</dict>
</plist>
51 changes: 51 additions & 0 deletions intents_frameworks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
targets:
station.intents:
type: app-extension
platform: iOS
info:
path: intents/Info.plist
properties:
NSExtension:
NSExtensionAttributes:
IntentsRestrictedWhileLocked: []
IntentsRestrictedWhileProtectedDataUnavailable: []
IntentsSupported: [RuuviTagSelectionIntent]
NSExtensionPointIdentifier: com.apple.intents-service
NSExtensionPrincipalClass: $(PRODUCT_MODULE_NAME).IntentHandler
CFBundleDisplayName: Ruuvi Station
CFBundlePackageType: $(PRODUCT_BUNDLE_PACKAGE_TYPE)
CFBundleShortVersionString: $(MARKETING_VERSION)
CFBundleVersion: $(CURRENT_PROJECT_VERSION)
NSHumanReadableCopyright: Copyright © 2023 Ruuvi Innovations Oy. All rights reserved.
settings:
base:
CODE_SIGN_ENTITLEMENTS: station_intents.entitlements
sources:
- path: intents
- path: ruuvi-widgets
excludes:
- Info.plist
dependencies:
- package: Swinject
- package: BTKit
- package: Future
- package: GRDB
- package: Humidity
- package: Realm
- package: KeychainAccess
- package: Realm
product: RealmSwift
- target: RuuviUser
embed: true
- target: RuuviCloud
embed: true
- target: RuuviOntology
embed: true
- target: RuuviPool
embed: true
- target: RuuviLocal
embed: true
- target: RuuviPersistence
embed: true
- target: RuuviContext
embed: true
50 changes: 50 additions & 0 deletions intents_spm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
targets:
station.intents:
type: app-extension
platform: iOS
info:
path: intents/Info.plist
properties:
NSExtension:
NSExtensionAttributes:
IntentsRestrictedWhileLocked: []
IntentsRestrictedWhileProtectedDataUnavailable: []
IntentsSupported: [RuuviTagSelectionIntent]
NSExtensionPointIdentifier: com.apple.intents-service
NSExtensionPrincipalClass: $(PRODUCT_MODULE_NAME).IntentHandler
CFBundleDisplayName: Ruuvi Station
CFBundlePackageType: $(PRODUCT_BUNDLE_PACKAGE_TYPE)
CFBundleShortVersionString: $(MARKETING_VERSION)
CFBundleVersion: $(CURRENT_PROJECT_VERSION)
NSHumanReadableCopyright: Copyright © 2023 Ruuvi Innovations Oy. All rights reserved.
settings:
base:
CODE_SIGN_ENTITLEMENTS: station_intents.entitlements
sources:
- path: intents
- path: ruuvi-widgets
excludes:
- Info.plist
dependencies:
- package: Swinject
- package: BTKit
- package: Future
- package: GRDB
- package: Humidity
- package: Realm
- package: KeychainAccess
- package: Realm
product: RealmSwift
- package: RuuviUser
- package: RuuviUser
product: RuuviUserCoordinator
- package: RuuviCloud
- package: RuuviCloud
product: RuuviCloudPure
- package: RuuviCloud
product: RuuviCloudApi
- package: RuuviOntology
- package: RuuviPool
- package: RuuviLocal
- package: RuuviPersistence
- package: RuuviContext
22 changes: 22 additions & 0 deletions pnservice.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
targets:
station.pnservice:
type: app-extension
platform: iOS
info:
path: pnservice/Info.plist
properties:
NSExtension:
NSExtensionPointIdentifier: com.apple.usernotifications.service
NSExtensionPrincipalClass: $(PRODUCT_MODULE_NAME).NotificationService
CFBundleDisplayName: Ruuvi Station
CFBundlePackageType: $(PRODUCT_BUNDLE_PACKAGE_TYPE)
CFBundleShortVersionString: $(MARKETING_VERSION)
CFBundleVersion: $(CURRENT_PROJECT_VERSION)
NSHumanReadableCopyright: Copyright © 2023 Ruuvi Innovations Oy. All rights reserved.
settings:
base:
CODE_SIGN_ENTITLEMENTS: pnservice.entitlements
sources:
- path: pnservice
- path: station/Resources/Strings/
- path: station/Resources/Sounds/
20 changes: 20 additions & 0 deletions pnservice/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,32 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>Ruuvi Station</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.usernotifications.service</string>
<key>NSExtensionPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).NotificationService</string>
</dict>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2023 Ruuvi Innovations Oy. All rights reserved.</string>
</dict>
</plist>
13 changes: 12 additions & 1 deletion project_frameworks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ include:
- Modules/RuuviLocationPicker/target.yml
- Modules/RuuviOnboard/target.yml
- widget_frameworks.yml
- pnservice.yml
- intents_frameworks.yml

targets:
station:
Expand All @@ -194,6 +196,8 @@ targets:
- path: pnservice.entitlements
dependencies:
- target: "station.widgets"
- target: "station.intents"
- target: "station.pnservice"
- package: BTKit
- package: Charts
- package: GRDB
Expand Down Expand Up @@ -273,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
13 changes: 12 additions & 1 deletion project_spm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ packages:

include:
- widget_spm.yml
- pnservice.yml
- intents_spm.yml

targets:
station:
Expand All @@ -122,6 +124,8 @@ targets:
- path: pnservice.entitlements
dependencies:
- target: "station.widgets"
- target: "station.intents"
- target: "station.pnservice"
- package: BTKit
- package: Charts
- package: LightRoute
Expand Down Expand Up @@ -268,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 4840a07

Please sign in to comment.