Skip to content

Commit

Permalink
Added reader as submodule, added build script
Browse files Browse the repository at this point in the history
  • Loading branch information
michalrentka committed Dec 14, 2023
1 parent cb5f09c commit a213cee
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,5 @@ fastlane/test_output

bundled/translators
bundled/styles
bundled/locales
bundled/locales
bundled/reader
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
19 changes: 19 additions & 0 deletions Zotero.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -4117,6 +4117,7 @@
B3CF8840266E0FE6009CFC20 /* Run Script */,
B3593F142668D37900FA4BB2 /* Run Script */,
B34A85AC243CB1E4003D5638 /* ShellScript */,
B3CAE1162B0E0CEF0000F8CA /* ShellScript */,
B337A5AD244F229400AFD13D /* SwiftGen */,
B30D59512206F60400884C4A /* Sources */,
B30D59522206F60400884C4A /* Frameworks */,
Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions reader
Submodule reader added at 0b695d
29 changes: 29 additions & 0 deletions scripts/build_reader.sh
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit a213cee

Please sign in to comment.