← All repositories

crossmate

A collaborative crossword app for iPhone and iPad

git clone https://code.inqk.net/crossmate.git


commit 2d868d03075a3e36ba4a2c873adb2c8bcc8a92d7
parent c6dfbc0e018dc319859f86298278f737823e1d90
Author: Michael Camilleri <[email protected]>
Date:   Tue, 12 May 2026 17:07:04 +0900

Bump Crossmate-flavoured XD version

Diffstat

MPuzzles/Bundled/Crossmate-0001.xd | 2+-
MPuzzles/Bundled/Crossmate-0002.xd | 2+-
MPuzzles/Bundled/Crossmate-0003.xd | 2+-
MPuzzles/Bundled/Crossmate-0004.xd | 2+-
MPuzzles/Bundled/Crossmate-0005.xd | 2+-
MPuzzles/Bundled/Crossmate-0006.xd | 2+-
MPuzzles/Bundled/Crossmate-0007.xd | 2+-
MPuzzles/Bundled/Crossmate-0008.xd | 2+-
MPuzzles/Bundled/Crossmate-0009.xd | 2+-
MPuzzles/Bundled/Crossmate-0010.xd | 2+-
MPuzzles/Debug/garden.xd | 2+-
MPuzzles/Debug/morning.xd | 2+-
MPuzzles/Debug/sample.xd | 2+-
MScripts/nyt-to-xd.sh | 19++++++++++++++++++-

14 files changed, 31 insertions(+), 14 deletions(-)

diff --git a/Puzzles/Bundled/Crossmate-0001.xd b/Puzzles/Bundled/Crossmate-0001.xd

@@ -1,5 +1,5 @@
 Title: Crossmake #1
-CmVer: 1
+CmVer: 2
 Author: Crossmake
 Publisher: Crossmake
 Date: 2026-04-29

diff --git a/Puzzles/Bundled/Crossmate-0002.xd b/Puzzles/Bundled/Crossmate-0002.xd

@@ -1,5 +1,5 @@
 Title: Crossmake #2
-CmVer: 1
+CmVer: 2
 Author: Crossmake
 Publisher: Crossmake
 Date: 2026-04-29

diff --git a/Puzzles/Bundled/Crossmate-0003.xd b/Puzzles/Bundled/Crossmate-0003.xd

@@ -1,5 +1,5 @@
 Title: Crossmake #3
-CmVer: 1
+CmVer: 2
 Author: Crossmake
 Publisher: Crossmake
 Date: 2026-04-29

diff --git a/Puzzles/Bundled/Crossmate-0004.xd b/Puzzles/Bundled/Crossmate-0004.xd

@@ -1,5 +1,5 @@
 Title: Crossmake #4
-CmVer: 1
+CmVer: 2
 Author: Crossmake
 Publisher: Crossmake
 Date: 2026-04-29

diff --git a/Puzzles/Bundled/Crossmate-0005.xd b/Puzzles/Bundled/Crossmate-0005.xd

@@ -1,5 +1,5 @@
 Title: Crossmake #5
-CmVer: 1
+CmVer: 2
 Author: Crossmake
 Publisher: Crossmake
 Date: 2026-04-29

diff --git a/Puzzles/Bundled/Crossmate-0006.xd b/Puzzles/Bundled/Crossmate-0006.xd

@@ -1,5 +1,5 @@
 Title: Crossmake #6
-CmVer: 1
+CmVer: 2
 Author: Crossmake
 Publisher: Crossmake
 Date: 2026-04-29

diff --git a/Puzzles/Bundled/Crossmate-0007.xd b/Puzzles/Bundled/Crossmate-0007.xd

@@ -1,5 +1,5 @@
 Title: Crossmake #7
-CmVer: 1
+CmVer: 2
 Author: Crossmake
 Publisher: Crossmake
 Date: 2026-04-29

diff --git a/Puzzles/Bundled/Crossmate-0008.xd b/Puzzles/Bundled/Crossmate-0008.xd

@@ -1,5 +1,5 @@
 Title: Crossmake #8
-CmVer: 1
+CmVer: 2
 Author: Crossmake
 Publisher: Crossmake
 Date: 2026-04-29

diff --git a/Puzzles/Bundled/Crossmate-0009.xd b/Puzzles/Bundled/Crossmate-0009.xd

@@ -1,5 +1,5 @@
 Title: Crossmake #9
-CmVer: 1
+CmVer: 2
 Author: Crossmake
 Publisher: Crossmake
 Date: 2026-04-29

diff --git a/Puzzles/Bundled/Crossmate-0010.xd b/Puzzles/Bundled/Crossmate-0010.xd

@@ -1,5 +1,5 @@
 Title: Crossmake #10
-CmVer: 1
+CmVer: 2
 Author: Crossmake
 Publisher: Crossmake
 Date: 2026-04-29

diff --git a/Puzzles/Debug/garden.xd b/Puzzles/Debug/garden.xd

@@ -1,5 +1,5 @@
 Title: Garden Party
-CmVer: 1
+CmVer: 2
 Author: Crossmate
 Copyright: Public domain test puzzle
 

diff --git a/Puzzles/Debug/morning.xd b/Puzzles/Debug/morning.xd

@@ -1,5 +1,5 @@
 Title: Morning Routine
-CmVer: 1
+CmVer: 2
 Author: Crossmate
 Copyright: Public domain test puzzle
 

diff --git a/Puzzles/Debug/sample.xd b/Puzzles/Debug/sample.xd

@@ -1,5 +1,5 @@
 Title: Crossmate Demo
-CmVer: 1
+CmVer: 2
 Author: Crossmate
 Copyright: Public domain test puzzle
 

diff --git a/Scripts/nyt-to-xd.sh b/Scripts/nyt-to-xd.sh

@@ -11,8 +11,18 @@ set -euo pipefail
 
 repo_root="$(cd "$(dirname "$0")/.." && pwd)"
 converter="${repo_root}/Crossmate/Services/NYTToXDConverter.swift"
+xd_source="${repo_root}/Crossmate/Models/XD.swift"
 fetch_script="${repo_root}/Scripts/fetch-nyt.sh"
 
+# The converter pulls XD.currentCmVersion from the app target. Mirror just
+# that constant from XD.swift so we don't need to compile the full app.
+# Reading from source keeps the stub in lockstep with the real value.
+cm_version="$(sed -n 's/^[[:space:]]*static let currentCmVersion = \([0-9][0-9]*\).*/\1/p' "$xd_source" | head -n1)"
+if [[ -z "$cm_version" ]]; then
+    echo "error: could not read currentCmVersion from $xd_source" >&2
+    exit 1
+fi
+
 json_path=""
 date_arg=""
 output_path=""
@@ -53,9 +63,16 @@ if [[ ! -f "$json_path" ]]; then
 fi
 
 driver="${tmp_dir}/main.swift"
-cat > "$driver" <<'SWIFT'
+cat > "$driver" <<SWIFT
 import Foundation
 
+// Stub for the one symbol the converter pulls from the app target. The value
+// is read out of Crossmate/Models/XD.swift at script-start time so this stays
+// in sync with the canonical definition.
+enum XD {
+    static let currentCmVersion = ${cm_version}
+}
+
 guard CommandLine.arguments.count >= 2 else {
     FileHandle.standardError.write(Data("error: missing JSON path\n".utf8))
     exit(2)