Skip to content

Commit b7ae90f

Browse files
Merge release/25.9.1 into trunk (#24566)
* Bump version number * Add secrets to JetpackStatsWidgets (#24565) * Add secrets to JetpackStatsWidgets * Delete copied code * Add secrets to WordpressShareExtension and WordPressDraftActionExtension * Add secrets to JetpackShareExtension and JetpackDraftActionExtension * Add secrets to JetpackNotificationServiceExtension and WordPressNotificationServiceExtension * Add secrets to JetpackIntents --------- Co-authored-by: Tony Li <[email protected]>
1 parent 9cced29 commit b7ae90f

File tree

7 files changed

+291
-6
lines changed

7 files changed

+291
-6
lines changed

Scripts/BuildPhases/GenerateCredentials.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,20 @@ EXAMPLE_SECRETS_FILE="${SRCROOT}/Credentials/Secrets-example.swift"
6060
ensure_is_in_input_files_list $EXAMPLE_SECRETS_FILE
6161

6262
# The Secrets file destination
63-
SECRETS_DESTINATION_FILE="${BUILD_DIR}/Secrets/Secrets.swift"
64-
mkdir -p $(dirname "$SECRETS_DESTINATION_FILE")
63+
SECRETS_DESTINATION_FILE="${SCRIPT_OUTPUT_FILE_0}"
64+
mkdir -p "$(dirname "$SECRETS_DESTINATION_FILE")"
6565

66+
WORDPRESS_TARGETS=("WordPress" "WordPressShareExtension" "WordPressDraftActionExtension" "WordPressNotificationServiceExtension")
6667
# If the WordPress Production Secrets are available for WordPress, use them
67-
if [ -f "$WORDPRESS_SECRETS_FILE" ] && [ "${TARGET_NAME}" == "WordPress" ]; then
68+
if [ -f "$WORDPRESS_SECRETS_FILE" ] && [[ " ${WORDPRESS_TARGETS[*]} " == *" $TARGET_NAME "* ]]; then
6869
echo "Applying Production Secrets"
6970
cp -v "$WORDPRESS_SECRETS_FILE" "${SECRETS_DESTINATION_FILE}"
7071
exit 0
7172
fi
7273

74+
JETPACK_TARGETS=("Jetpack" "JetpackStatsWidgets" "JetpackShareExtension" "JetpackDraftActionExtension" "JetpackNotificationServiceExtension" "JetpackIntents")
7375
# If the Jetpack Secrets are available and if we're building Jetpack use them
74-
if [ -f "$JETPACK_SECRETS_FILE" ] && [ "${TARGET_NAME}" == "Jetpack" ]; then
76+
if [ -f "$JETPACK_SECRETS_FILE" ] && [[ " ${JETPACK_TARGETS[*]} " == *" $TARGET_NAME "* ]]; then
7577
echo "Applying Jetpack Secrets"
7678
cp -v "$JETPACK_SECRETS_FILE" "${SECRETS_DESTINATION_FILE}"
7779
exit 0

Sources/JetpackStatsWidgets/Sources/StatsWidgets.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
import SwiftUI
22
import WidgetKit
3+
import BuildSettingsKit
34

45
@main
56
struct JetpackStatsWidgets: WidgetBundle {
7+
init() {
8+
BuildSettings.configure(secrets: ApiCredentials.toSecrets())
9+
}
10+
611
var body: some Widget {
712
HomeWidgetToday()
813
HomeWidgetThisWeek()

WordPress/JetpackIntents/IntentHandler.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
import Intents
2+
import BuildSettingsKit
23

34
class IntentHandler: INExtension, SelectSiteIntentHandling {
45

56
let sitesDataProvider = SitesDataProvider()
67

8+
override init() {
9+
super.init()
10+
11+
BuildSettings.configure(secrets: ApiCredentials.toSecrets())
12+
}
13+
714
// MARK: - INIntentHandlerProviding
815

916
override func handler(for intent: INIntent) -> Any {

WordPress/WordPress.xcodeproj/project.pbxproj

Lines changed: 264 additions & 0 deletions
Large diffs are not rendered by default.

WordPress/WordPressNotificationServiceExtension/Sources/NotificationService.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ class NotificationService: UNNotificationServiceExtension {
3131

3232
private let appKeychainAccessGroup = BuildSettings.current.appKeychainAccessGroup
3333

34+
override init() {
35+
super.init()
36+
37+
BuildSettings.configure(secrets: ApiCredentials.toSecrets())
38+
}
39+
3440
// MARK: UNNotificationServiceExtension
3541

3642
override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {

WordPress/WordPressShareExtension/Sources/UI/MainShareViewController.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ class MainShareViewController: UIViewController {
6464

6565
override open func viewDidLoad() {
6666
super.viewDidLoad()
67+
BuildSettings.configure(secrets: ApiCredentials.toSecrets())
6768
trackExtensionLaunch()
6869
loadAndPresentNavigationVC()
6970
}

config/Version.public.xcconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
VERSION_LONG = 25.9.0.3
2-
VERSION_SHORT = 25.9
1+
VERSION_LONG = 25.9.1.0
2+
VERSION_SHORT = 25.9.1

0 commit comments

Comments
 (0)