From a213ceef5926fe6e124b899a2055dc0e9f7b2305 Mon Sep 17 00:00:00 2001 From: Michal Rentka Date: Wed, 22 Nov 2023 11:21:56 +0100 Subject: [PATCH] Added reader as submodule, added build script --- .gitignore | 3 ++- .gitmodules | 3 +++ Zotero.xcodeproj/project.pbxproj | 19 +++++++++++++++++++ reader | 1 + scripts/build_reader.sh | 29 +++++++++++++++++++++++++++++ 5 files changed, 54 insertions(+), 1 deletion(-) create mode 160000 reader create mode 100755 scripts/build_reader.sh diff --git a/.gitignore b/.gitignore index 6d877d71d..c09731a20 100644 --- a/.gitignore +++ b/.gitignore @@ -79,4 +79,5 @@ fastlane/test_output bundled/translators bundled/styles -bundled/locales \ No newline at end of file +bundled/locales +bundled/reader \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index 9c75c110b..8bb7139d5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,3 +10,6 @@ [submodule "translators"] path = translators url = https://github.com/zotero/translators.git +[submodule "reader"] + path = reader + url = https://github.com/zotero/reader.git diff --git a/Zotero.xcodeproj/project.pbxproj b/Zotero.xcodeproj/project.pbxproj index 30eb445bd..64ba963b6 100644 --- a/Zotero.xcodeproj/project.pbxproj +++ b/Zotero.xcodeproj/project.pbxproj @@ -4117,6 +4117,7 @@ B3CF8840266E0FE6009CFC20 /* Run Script */, B3593F142668D37900FA4BB2 /* Run Script */, B34A85AC243CB1E4003D5638 /* ShellScript */, + B3CAE1162B0E0CEF0000F8CA /* ShellScript */, B337A5AD244F229400AFD13D /* SwiftGen */, B30D59512206F60400884C4A /* Sources */, B30D59522206F60400884C4A /* Frameworks */, @@ -4525,6 +4526,24 @@ shellPath = /bin/sh; shellScript = "python3 \"$SCRIPT_INPUT_FILE_0\"\n"; }; + B3CAE1162B0E0CEF0000F8CA /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "$(SRCROOT)/scripts/build_reader.sh", + ); + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "sh \"$SCRIPT_INPUT_FILE_0\"\n"; + }; B3CF8840266E0FE6009CFC20 /* Run Script */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; diff --git a/reader b/reader new file mode 160000 index 000000000..0b695de16 --- /dev/null +++ b/reader @@ -0,0 +1 @@ +Subproject commit 0b695de16bae1959e88610c8ef4e8a65e83ee85f diff --git a/scripts/build_reader.sh b/scripts/build_reader.sh new file mode 100755 index 000000000..49972e798 --- /dev/null +++ b/scripts/build_reader.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +realpath() { + [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}" +} + +SCRIPT_PATH=`realpath "$0"` +SCRIPT_DIR=`dirname "$SCRIPT_PATH"` +READER_DIR="$SCRIPT_DIR/../reader" +BUILD_DIR="$READER_DIR/build/ios" +BUNDLED_DIR="$SCRIPT_DIR/../bundled/reader" + +if [ ! -d "$READER_DIR" ]; then +exit +fi + +cd "$READER_DIR" +NODE_OPTIONS=--openssl-legacy-provider npm i +NODE_OPTIONS=--openssl-legacy-provider npm run build:ios + +if [ ! -d "$BUILD_DIR" ]; then +exit +fi + +if [ -d "$BUNDLED_DIR" ]; then +rm -r "$BUNDLED_DIR" +fi + +mv "$BUILD_DIR" "$BUNDLED_DIR" \ No newline at end of file