Commit 213799f3f0
213799f3f0792831bdbd707d1f85cb19b614f39f
parent: 9073748013
Verified · cmc
cmc <hello@cleberg.net> · 2026-11-20 05:42 UTC
Add the Mac App Store release script and localize its strings
- scripts/release-macos.sh archives the "Orgstar macOS" scheme through
appstore-kit; it checks build settings first and, before exporting, that
the archive has no Sparkle, SU* keys, NSTask/posix_spawn imports or
temporary exceptions, and has a provisioning profile in every bundle
- scripts/sync-strings.sh also builds the App Store scheme, reads its
stringsdata, and writes the catalog as sorted JSON
- Translate the App Store strings into de, es, fr, ja and pt-BR
- Test that a runner set after the session opens is used and that roots
get plain bookmarks outside the sandbox
- CONTRIBUTING.org: the App Store and iOS build checks
Layout: unified · split
CONTRIBUTING.org
+12
| @@ -95,6 +95,18 @@ swift test # all tests |
| 95 | 95 | ORGSTAR_GATES=1 swift test -c release --filter GateTests # performance gates |
| 96 | 96 | #+END_SRC |
| 97 | 97 | |
| 98 | =swift test= covers the Developer ID build. =APPSTORE= is set only in the Xcode targets, so |
| 99 | also check that the App Store build and the iOS app compile: |
| 100 | |
| 101 | #+BEGIN_SRC sh |
| 102 | xcodebuild -project ios/Orgstar.xcodeproj -scheme 'Orgstar macOS' -destination 'generic/platform=macOS' \ |
| 103 | -derivedDataPath .build/xcode CODE_SIGNING_ALLOWED=NO build |
| 104 | xcodebuild -project ios/Orgstar.xcodeproj -scheme 'Orgstar iOS' -destination 'generic/platform=iOS Simulator' \ |
| 105 | -derivedDataPath .build/xcode build |
| 106 | #+END_SRC |
| 107 | |
| 108 | There is no CI; run these before committing. |
| 109 | |
| 98 | 110 | * Release |
| 99 | 111 | |
| 100 | 112 | =scripts/release-mac.sh <version>= builds a universal app, signs it with the |
Tests/OrgAppTests/ProgramRunningTests.swift
added
+39
| @@ -0,0 +1,39 @@ |
| 1 | import Foundation |
| 2 | import OrgCore |
| 3 | import OrgDocument |
| 4 | import Testing |
| 5 | @testable import OrgApp |
| 6 | |
| 7 | /// Answers every block with a fixed output and every table with fixed text. |
| 8 | private struct StubPrograms: ProgramRunning { |
| 9 | func runBabel(_ job: BabelJob, fileDirectory: URL) async throws -> BabelOutput { |
| 10 | BabelOutput(stdout: "stub") |
| 11 | } |
| 12 | |
| 13 | func recalculateTable(text: String, directory: URL, table: Range<Int>, point: Int, form: String) async throws -> String { |
| 14 | "| 1 |\n" |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | /// The app creates its session before it sets `DocumentSession.programs`, so the runner is |
| 19 | /// read when a block or table runs, not when the session is made. |
| 20 | @MainActor |
| 21 | struct ProgramRunningTests { |
| 22 | @Test func aRunnerSetAfterTheSessionOpensIsUsed() async throws { |
| 23 | #expect(DocumentSession.runner == nil) |
| 24 | let notes = try Folder() |
| 25 | let file = try notes.write("b.org", "#+begin_src sh\necho hi\n#+end_src\n\n| 2 |\n") |
| 26 | let session = DocumentSession(recovery: FileRecoveryStore(directory: notes.url.appendingPathComponent(".r"))) |
| 27 | session.open(file.path) |
| 28 | guard case .external(.babel(let job)) = session.perform(ExecuteSrcBlock(), path: file.path, at: 3, expect: nil) else { |
| 29 | Issue.record("not planned") |
| 30 | return |
| 31 | } |
| 32 | let table = ("#+begin_src sh\necho hi\n#+end_src\n\n" as NSString).length |
| 33 | await DocumentSession.$scopedPrograms.withValue(StubPrograms()) { |
| 34 | #expect(await session.recalculateInEmacs(table: table..<(table + 6), point: table, form: "") == "Recalculated in Emacs") |
| 35 | #expect(await session.runBabel(job) == "Code block evaluation complete.") |
| 36 | } |
| 37 | #expect(session.document?.text == "#+begin_src sh\necho hi\n#+end_src\n\n#+RESULTS:\n: stub\n\n| 1 |\n") |
| 38 | } |
| 39 | } |
Tests/OrgWorkspaceTests/WorkspaceRootTests.swift
+10
| @@ -1,4 +1,5 @@ |
| 1 | 1 | import Foundation |
| 2 | import OrgCore |
| 2 | 3 | import Testing |
| 3 | 4 | @testable import OrgWorkspace |
| 4 | 5 | |
| @@ -11,6 +12,15 @@ struct WorkspaceRootTests { |
| 11 | 12 | #expect(root.path == folder.url.path) |
| 12 | 13 | } |
| 13 | 14 | |
| 15 | /// Tests run unsandboxed, so roots keep the Developer ID build's plain bookmarks. |
| 16 | @Test func unsandboxedByDefault() throws { |
| 17 | #expect(!Sandbox.isActive) |
| 18 | let folder = try Folder() |
| 19 | let root = try WorkspaceRoot(url: folder.url) |
| 20 | #expect(try root.resolve(sandboxed: false).url.resolvingSymlinksInPath() == folder.url.resolvingSymlinksInPath()) |
| 21 | #expect(root.bookmark == (try WorkspaceRoot(url: folder.url, sandboxed: false)).bookmark) |
| 22 | } |
| 23 | |
| 14 | 24 | #if os(macOS) |
| 15 | 25 | /// The sandboxed build's bookmarks carry their scope, and resolve with it. |
| 16 | 26 | @Test func securityScopedBookmarkResolves() throws { |
l10n/Localizable.xcstrings
+276
| @@ -86,6 +86,74 @@ |
| 86 | 86 | } |
| 87 | 87 | } |
| 88 | 88 | }, |
| 89 | "%@ / month": { |
| 90 | "localizations": { |
| 91 | "de": { |
| 92 | "stringUnit": { |
| 93 | "state": "translated", |
| 94 | "value": "%@ / Monat" |
| 95 | } |
| 96 | }, |
| 97 | "es": { |
| 98 | "stringUnit": { |
| 99 | "state": "translated", |
| 100 | "value": "%@ / mes" |
| 101 | } |
| 102 | }, |
| 103 | "fr": { |
| 104 | "stringUnit": { |
| 105 | "state": "translated", |
| 106 | "value": "%@ / mois" |
| 107 | } |
| 108 | }, |
| 109 | "ja": { |
| 110 | "stringUnit": { |
| 111 | "state": "translated", |
| 112 | "value": "%@ / 月" |
| 113 | } |
| 114 | }, |
| 115 | "pt-BR": { |
| 116 | "stringUnit": { |
| 117 | "state": "translated", |
| 118 | "value": "%@ / mês" |
| 119 | } |
| 120 | } |
| 121 | } |
| 122 | }, |
| 123 | "%@ / year": { |
| 124 | "localizations": { |
| 125 | "de": { |
| 126 | "stringUnit": { |
| 127 | "state": "translated", |
| 128 | "value": "%@ / Jahr" |
| 129 | } |
| 130 | }, |
| 131 | "es": { |
| 132 | "stringUnit": { |
| 133 | "state": "translated", |
| 134 | "value": "%@ / año" |
| 135 | } |
| 136 | }, |
| 137 | "fr": { |
| 138 | "stringUnit": { |
| 139 | "state": "translated", |
| 140 | "value": "%@ / an" |
| 141 | } |
| 142 | }, |
| 143 | "ja": { |
| 144 | "stringUnit": { |
| 145 | "state": "translated", |
| 146 | "value": "%@ / 年" |
| 147 | } |
| 148 | }, |
| 149 | "pt-BR": { |
| 150 | "stringUnit": { |
| 151 | "state": "translated", |
| 152 | "value": "%@ / ano" |
| 153 | } |
| 154 | } |
| 155 | } |
| 156 | }, |
| 89 | 157 | "%@ a month, billed yearly": { |
| 90 | 158 | "localizations": { |
| 91 | 159 | "de": { |
| @@ -224,6 +292,76 @@ |
| 224 | 292 | } |
| 225 | 293 | } |
| 226 | 294 | }, |
| 295 | "%@ isn't available.": { |
| 296 | "comment": "A command the Mac App Store build leaves out", |
| 297 | "localizations": { |
| 298 | "de": { |
| 299 | "stringUnit": { |
| 300 | "state": "translated", |
| 301 | "value": "%@ ist nicht verfügbar." |
| 302 | } |
| 303 | }, |
| 304 | "es": { |
| 305 | "stringUnit": { |
| 306 | "state": "translated", |
| 307 | "value": "%@ no está disponible." |
| 308 | } |
| 309 | }, |
| 310 | "fr": { |
| 311 | "stringUnit": { |
| 312 | "state": "translated", |
| 313 | "value": "%@ n'est pas disponible." |
| 314 | } |
| 315 | }, |
| 316 | "ja": { |
| 317 | "stringUnit": { |
| 318 | "state": "translated", |
| 319 | "value": "%@は利用できません。" |
| 320 | } |
| 321 | }, |
| 322 | "pt-BR": { |
| 323 | "stringUnit": { |
| 324 | "state": "translated", |
| 325 | "value": "%@ não está disponível." |
| 326 | } |
| 327 | } |
| 328 | } |
| 329 | }, |
| 330 | "%@ isn't in one of your folders, so it can't be moved. Attach a copy instead.": { |
| 331 | "comment": "Attach by moving a file from outside the sidebar's folders", |
| 332 | "localizations": { |
| 333 | "de": { |
| 334 | "stringUnit": { |
| 335 | "state": "translated", |
| 336 | "value": "%@ liegt in keinem deiner Ordner und kann daher nicht bewegt werden. Hänge stattdessen eine Kopie an." |
| 337 | } |
| 338 | }, |
| 339 | "es": { |
| 340 | "stringUnit": { |
| 341 | "state": "translated", |
| 342 | "value": "%@ no está en ninguna de tus carpetas, así que no se puede mover. Adjunta una copia en su lugar." |
| 343 | } |
| 344 | }, |
| 345 | "fr": { |
| 346 | "stringUnit": { |
| 347 | "state": "translated", |
| 348 | "value": "%@ ne se trouve dans aucun de vos dossiers et ne peut donc pas être déplacé. Joignez plutôt une copie." |
| 349 | } |
| 350 | }, |
| 351 | "ja": { |
| 352 | "stringUnit": { |
| 353 | "state": "translated", |
| 354 | "value": "%@はどのフォルダにもないため、移動できません。代わりにコピーを添付してください。" |
| 355 | } |
| 356 | }, |
| 357 | "pt-BR": { |
| 358 | "stringUnit": { |
| 359 | "state": "translated", |
| 360 | "value": "%@ não está em nenhuma das suas pastas, então não pode ser movido. Anexe uma cópia em vez disso." |
| 361 | } |
| 362 | } |
| 363 | } |
| 364 | }, |
| 227 | 365 | "%@ late": { |
| 228 | 366 | "localizations": { |
| 229 | 367 | "de": { |
| @@ -16503,6 +16641,40 @@ |
| 16503 | 16641 | } |
| 16504 | 16642 | } |
| 16505 | 16643 | }, |
| 16644 | "Manage Subscription…": { |
| 16645 | "localizations": { |
| 16646 | "de": { |
| 16647 | "stringUnit": { |
| 16648 | "state": "translated", |
| 16649 | "value": "Abonnement verwalten …" |
| 16650 | } |
| 16651 | }, |
| 16652 | "es": { |
| 16653 | "stringUnit": { |
| 16654 | "state": "translated", |
| 16655 | "value": "Gestionar suscripción…" |
| 16656 | } |
| 16657 | }, |
| 16658 | "fr": { |
| 16659 | "stringUnit": { |
| 16660 | "state": "translated", |
| 16661 | "value": "Gérer l'abonnement…" |
| 16662 | } |
| 16663 | }, |
| 16664 | "ja": { |
| 16665 | "stringUnit": { |
| 16666 | "state": "translated", |
| 16667 | "value": "サブスクリプションを管理…" |
| 16668 | } |
| 16669 | }, |
| 16670 | "pt-BR": { |
| 16671 | "stringUnit": { |
| 16672 | "state": "translated", |
| 16673 | "value": "Gerenciar Assinatura…" |
| 16674 | } |
| 16675 | } |
| 16676 | } |
| 16677 | }, |
| 16506 | 16678 | "Manual": { |
| 16507 | 16679 | "localizations": { |
| 16508 | 16680 | "de": { |
| @@ -24522,6 +24694,40 @@ |
| 24522 | 24694 | } |
| 24523 | 24695 | } |
| 24524 | 24696 | }, |
| 24697 | "Run Emacs Lisp blocks and tangle": { |
| 24698 | "localizations": { |
| 24699 | "de": { |
| 24700 | "stringUnit": { |
| 24701 | "state": "translated", |
| 24702 | "value": "Emacs-Lisp-Blöcke ausführen und tanglen" |
| 24703 | } |
| 24704 | }, |
| 24705 | "es": { |
| 24706 | "stringUnit": { |
| 24707 | "state": "translated", |
| 24708 | "value": "Ejecutar bloques de Emacs Lisp y extraer código (tangle)" |
| 24709 | } |
| 24710 | }, |
| 24711 | "fr": { |
| 24712 | "stringUnit": { |
| 24713 | "state": "translated", |
| 24714 | "value": "Exécuter les blocs Emacs Lisp et extraire (tangle)" |
| 24715 | } |
| 24716 | }, |
| 24717 | "ja": { |
| 24718 | "stringUnit": { |
| 24719 | "state": "translated", |
| 24720 | "value": "Emacs Lispブロックを実行してタングル" |
| 24721 | } |
| 24722 | }, |
| 24723 | "pt-BR": { |
| 24724 | "stringUnit": { |
| 24725 | "state": "translated", |
| 24726 | "value": "Executar blocos de Emacs Lisp e fazer tangle" |
| 24727 | } |
| 24728 | } |
| 24729 | } |
| 24730 | }, |
| 24525 | 24731 | "Run Source Block": { |
| 24526 | 24732 | "comment": "Command title", |
| 24527 | 24733 | "localizations": { |
| @@ -30332,6 +30538,41 @@ |
| 30332 | 30538 | } |
| 30333 | 30539 | } |
| 30334 | 30540 | }, |
| 30541 | "This file isn't in one of your folders. Choose where the export goes.": { |
| 30542 | "comment": "Save panel for an export outside the sidebar's folders", |
| 30543 | "localizations": { |
| 30544 | "de": { |
| 30545 | "stringUnit": { |
| 30546 | "state": "translated", |
| 30547 | "value": "Diese Datei liegt in keinem deiner Ordner. Wähle, wohin der Export geht." |
| 30548 | } |
| 30549 | }, |
| 30550 | "es": { |
| 30551 | "stringUnit": { |
| 30552 | "state": "translated", |
| 30553 | "value": "Este archivo no está en ninguna de tus carpetas. Elige dónde guardar la exportación." |
| 30554 | } |
| 30555 | }, |
| 30556 | "fr": { |
| 30557 | "stringUnit": { |
| 30558 | "state": "translated", |
| 30559 | "value": "Ce fichier ne se trouve dans aucun de vos dossiers. Choisissez où enregistrer l'exportation." |
| 30560 | } |
| 30561 | }, |
| 30562 | "ja": { |
| 30563 | "stringUnit": { |
| 30564 | "state": "translated", |
| 30565 | "value": "このファイルはどのフォルダにもありません。書き出し先を選択してください。" |
| 30566 | } |
| 30567 | }, |
| 30568 | "pt-BR": { |
| 30569 | "stringUnit": { |
| 30570 | "state": "translated", |
| 30571 | "value": "Este arquivo não está em nenhuma das suas pastas. Escolha onde salvar a exportação." |
| 30572 | } |
| 30573 | } |
| 30574 | } |
| 30575 | }, |
| 30335 | 30576 | "This table needs Emacs, which runs on the Mac: %@.": { |
| 30336 | 30577 | "comment": "Table formulas only Emacs can calculate", |
| 30337 | 30578 | "localizations": { |
| @@ -30367,6 +30608,41 @@ |
| 30367 | 30608 | } |
| 30368 | 30609 | } |
| 30369 | 30610 | }, |
| 30611 | "This table's formulas can't be calculated here: %@.": { |
| 30612 | "comment": "Table formulas orgstar can't calculate", |
| 30613 | "localizations": { |
| 30614 | "de": { |
| 30615 | "stringUnit": { |
| 30616 | "state": "translated", |
| 30617 | "value": "Die Formeln dieser Tabelle können hier nicht berechnet werden: %@." |
| 30618 | } |
| 30619 | }, |
| 30620 | "es": { |
| 30621 | "stringUnit": { |
| 30622 | "state": "translated", |
| 30623 | "value": "Las fórmulas de esta tabla no se pueden calcular aquí: %@." |
| 30624 | } |
| 30625 | }, |
| 30626 | "fr": { |
| 30627 | "stringUnit": { |
| 30628 | "state": "translated", |
| 30629 | "value": "Les formules de ce tableau ne peuvent pas être calculées ici : %@." |
| 30630 | } |
| 30631 | }, |
| 30632 | "ja": { |
| 30633 | "stringUnit": { |
| 30634 | "state": "translated", |
| 30635 | "value": "この表の数式はここでは計算できません:%@。" |
| 30636 | } |
| 30637 | }, |
| 30638 | "pt-BR": { |
| 30639 | "stringUnit": { |
| 30640 | "state": "translated", |
| 30641 | "value": "As fórmulas desta tabela não podem ser calculadas aqui: %@." |
| 30642 | } |
| 30643 | } |
| 30644 | } |
| 30645 | }, |
| 30370 | 30646 | "Time": { |
| 30371 | 30647 | "localizations": { |
| 30372 | 30648 | "de": { |
scripts/release-macos.sh
added
+63
| @@ -0,0 +1,63 @@ |
| 1 | #!/bin/sh |
| 2 | # Archives the Mac App Store app (with its widgets, Quick Look and Spotlight extensions) and uploads |
| 3 | # it to App Store Connect. The version is the project's MARKETING_VERSION; the build number is the |
| 4 | # commit count. The Developer ID app is released by scripts/release-mac.sh instead. The work is done |
| 5 | # by appstore-kit, checked out beside this repository or at $APPSTORE_KIT. |
| 6 | # Usage: scripts/release-macos.sh |
| 7 | # ORGSTAR_PUBLISH 0 archives and exports the .pkg to .build/macos-release without uploading |
| 8 | PUBLISH="${ORGSTAR_PUBLISH:-1}" |
| 9 | name=orgstar |
| 10 | project=ios/Orgstar.xcodeproj |
| 11 | scheme="Orgstar macOS" |
| 12 | platform=macos |
| 13 | configuration=Release |
| 14 | |
| 15 | # Runs before the archive, so it can only check build settings. |
| 16 | preflight() { |
| 17 | settings="$(command xcodebuild -project "$project" -scheme "$scheme" -configuration "$configuration" \ |
| 18 | -destination 'generic/platform=macOS' -showBuildSettings 2>/dev/null)" || fail "can't read the build settings of $scheme" |
| 19 | value() { |
| 20 | printf '%s\n' "$settings" | sed -n "s/^ *$1 = //p" | head -1 |
| 21 | } |
| 22 | case " $(value SWIFT_ACTIVE_COMPILATION_CONDITIONS) " in |
| 23 | *" APPSTORE "*) ;; |
| 24 | *) fail "SWIFT_ACTIVE_COMPILATION_CONDITIONS of $scheme ($configuration) lacks APPSTORE" ;; |
| 25 | esac |
| 26 | [ "$(value PRODUCT_BUNDLE_IDENTIFIER)" = sh.krz.orgstar ] || fail "$scheme's bundle ID is $(value PRODUCT_BUNDLE_IDENTIFIER), not sh.krz.orgstar" |
| 27 | for entitlements in ios/OrgstarMac/*.entitlements ios/OrgstarWidgets/*-macOS.entitlements \ |
| 28 | ios/OrgstarQuickLook/*-macOS.entitlements ios/OrgstarSpotlight/*.entitlements; do |
| 29 | ! grep -q temporary-exception "$entitlements" || fail "$entitlements has a temporary exception" |
| 30 | done |
| 31 | } |
| 32 | |
| 33 | # Checks the built app: no Sparkle, no updater keys, no process launching, no temporary exceptions, |
| 34 | # and a provisioning profile in the app and in each extension. |
| 35 | check_archive() { |
| 36 | set -- "$1"/Products/Applications/*.app |
| 37 | [ -d "$1" ] || fail "no app in the archive" |
| 38 | app="$1" |
| 39 | [ -z "$(find "$app" -iname '*sparkle*' | head -1)" ] || fail "the archive contains Sparkle: $(find "$app" -iname '*sparkle*' | head -1)" |
| 40 | keys="$(plutil -convert json -o - "$app/Contents/Info.plist" \ |
| 41 | | python3 -c 'import json, sys; print(" ".join(k for k in json.load(sys.stdin) if k.startswith("SU")))')" |
| 42 | [ -z "$keys" ] || fail "Info.plist has Sparkle keys: $keys" |
| 43 | for bundle in "$app" "$app"/Contents/PlugIns/*.appex "$app"/Contents/Extensions/*.appex; do |
| 44 | [ -d "$bundle" ] || continue |
| 45 | executable="$bundle/Contents/MacOS/$(/usr/libexec/PlistBuddy -c 'Print :CFBundleExecutable' "$bundle/Contents/Info.plist")" |
| 46 | symbols="$(nm -u "$executable" | grep -E '_OBJC_CLASS_\$_NSTask$|_posix_spawnp?$' | sort -u | tr '\n' ' ')" |
| 47 | [ -z "$symbols" ] || fail "$(basename "$bundle") launches processes: $symbols" |
| 48 | entitlements="$(codesign -d --entitlements - --xml "$bundle" 2>/dev/null)" || fail "$(basename "$bundle") isn't signed" |
| 49 | case "$entitlements" in |
| 50 | *temporary-exception*) fail "$(basename "$bundle") has a temporary-exception entitlement" ;; |
| 51 | esac |
| 52 | [ -f "$bundle/Contents/embedded.provisionprofile" ] || fail "$(basename "$bundle") has no embedded.provisionprofile" |
| 53 | done |
| 54 | } |
| 55 | |
| 56 | # appstore-kit has no step between archiving and exporting, so its export call checks the archive first. |
| 57 | xcodebuild() { |
| 58 | if [ "$1" = -exportArchive ] && [ "$2" = -archivePath ]; then |
| 59 | check_archive "$3" |
| 60 | fi |
| 61 | command xcodebuild "$@" |
| 62 | } |
| 63 | . "${APPSTORE_KIT:-$(dirname "$0")/../../appstore-kit}/release-ios.sh" |
scripts/sync-strings.sh
+15 −4
| @@ -1,6 +1,7 @@ |
| 1 | 1 | #!/bin/sh |
| 2 | | # Brings l10n/Localizable.xcstrings up to date with the strings the apps show: builds the Mac and |
| 3 | | # iOS targets with SWIFT_EMIT_LOC_STRINGS and syncs the catalog from their .stringsdata files. |
| 2 | # Brings l10n/Localizable.xcstrings up to date with the strings the apps show: builds the Mac, Mac |
| 3 | # App Store and iOS targets with SWIFT_EMIT_LOC_STRINGS and syncs the catalog from their .stringsdata |
| 4 | # files. |
| 4 | 5 | # New strings are added, ones no longer used are marked stale; translations are kept. |
| 5 | 6 | # Command titles come from Sources/OrgApp/CommandTitles.swift, which CommandTitleTests keeps current. |
| 6 | 7 | set -eu |
| @@ -9,10 +10,15 @@ cd "$(dirname "$0")/.." |
| 9 | 10 | catalog=l10n/Localizable.xcstrings |
| 10 | 11 | mac=.build/loc-mac |
| 11 | 12 | ios=.build/loc-ios |
| 13 | mas=.build/loc-mas |
| 12 | 14 | |
| 13 | 15 | for scheme in Orgstar OrgstarWidgets; do |
| 14 | 16 | xcodebuild -scheme "$scheme" -destination 'platform=macOS' -derivedDataPath "$mac" build -quiet SWIFT_EMIT_LOC_STRINGS=YES |
| 15 | 17 | done |
| 18 | # The App Store targets compile Sources/Orgstar and Sources/OrgstarWidgets with APPSTORE, which |
| 19 | # shows strings the SwiftPM schemes don't. |
| 20 | xcodebuild -project ios/Orgstar.xcodeproj -scheme 'Orgstar macOS' -destination 'generic/platform=macOS' -derivedDataPath "$mas" \ |
| 21 | build -quiet SWIFT_EMIT_LOC_STRINGS=YES CODE_SIGNING_ALLOWED=NO |
| 16 | 22 | for scheme in OrgstarMobile OrgstarShare OrgstarWidgets; do |
| 17 | 23 | xcodebuild -scheme "$scheme" -destination 'generic/platform=iOS Simulator' -derivedDataPath "$ios" build -quiet SWIFT_EMIT_LOC_STRINGS=YES |
| 18 | 24 | done |
| @@ -24,6 +30,11 @@ done |
| 24 | 30 | find "$mac" "$ios" -path '*/arm64/*' -name '*.stringsdata' \ |
| 25 | 31 | | grep -E '/(Orgstar|OrgstarMobile|OrgstarWidgets|OrgstarShare|OrgstarWatch|OrgstarWatchWidgets)-p\.build/|/(OrgApp|OrgPresentation|OrgEditorAppKit)-t?\.build/' \ |
| 26 | 32 | > "$mac/stringsdata.txt" |
| 27 | | # shellcheck disable=SC2046 |
| 28 | | xcrun xcstringstool sync "$catalog" --stringsdata $(tr '\n' ' ' < "$mac/stringsdata.txt") |
| 33 | find "$mas" -path '*/arm64/*' -name '*.stringsdata' | grep -E '/(Orgstar macOS|OrgstarWidgets)\.build/' >> "$mac/stringsdata.txt" |
| 34 | # The App Store target's folder name has a space, so the list is read a line at a time. |
| 35 | set -- |
| 36 | while IFS= read -r file; do set -- "$@" "$file"; done < "$mac/stringsdata.txt" |
| 37 | xcrun xcstringstool sync "$catalog" --stringsdata "$@" |
| 38 | # xcstringstool writes its own spacing; the committed catalog is Python's sorted JSON. |
| 39 | python3 -c "import json, sys; p = sys.argv[1]; d = json.load(open(p)); open(p, 'w').write(json.dumps(d, indent=2, ensure_ascii=False, sort_keys=True) + '\n')" "$catalog" |
| 29 | 40 | echo "$(python3 -c "import json; print(len(json.load(open('$catalog'))['strings']))") strings in $catalog" |