refactor
This commit is contained in:
parent
273a10f966
commit
f7582fabb2
@ -1,8 +1,17 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
CARGO=`which cargo`
|
||||||
CARGO_MANIFEST_PATH=$(python3 -c "import os; import json; print(json.loads(os.popen('cargo locate-project').read())['root'])")
|
CARGO=${CARGO:=~/.cargo/bin/cargo}
|
||||||
CARGO_WORKSPACE_PATH=$(python3 -c "import os; import json; print(json.loads(os.popen('cargo locate-project --workspace').read())['root'])")
|
CARGO_DIR=$(dirname $CARGO)
|
||||||
|
|
||||||
|
WORKING_DIR=$1
|
||||||
|
shift
|
||||||
|
echo $WORKING_DIR
|
||||||
|
pushd $WORKING_DIR >/dev/null
|
||||||
|
echo PWD: `pwd`
|
||||||
|
|
||||||
|
CARGO_MANIFEST_PATH=$(python3 -c "import os; import json; print(json.loads(os.popen('$CARGO locate-project').read())['root'])")
|
||||||
|
CARGO_WORKSPACE_PATH=$(python3 -c "import os; import json; print(json.loads(os.popen('$CARGO locate-project --workspace').read())['root'])")
|
||||||
TARGET_PATH=$(python3 -c "import os; print(os.path.realpath(\"$CARGO_WORKSPACE_PATH/../target\"))")
|
TARGET_PATH=$(python3 -c "import os; print(os.path.realpath(\"$CARGO_WORKSPACE_PATH/../target\"))")
|
||||||
PACKAGE_NAME=$1
|
PACKAGE_NAME=$1
|
||||||
shift
|
shift
|
||||||
@ -42,9 +51,7 @@ do
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CARGO=`which cargo`
|
|
||||||
CARGO=${CARGO:=~/.cargo/bin/cargo}
|
|
||||||
CARGO_DIR=$(dirname $CARGO)
|
|
||||||
|
|
||||||
# Choose arm64 brew for unit tests by default if we are on M1
|
# Choose arm64 brew for unit tests by default if we are on M1
|
||||||
if [ -f /opt/homebrew/bin/brew ]; then
|
if [ -f /opt/homebrew/bin/brew ]; then
|
@ -1,44 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
|
||||||
CARGO_MANIFEST_PATH=$(python -c "import os; print(os.path.realpath(\"$SCRIPTDIR/Cargo.toml\"))")
|
|
||||||
# echo CARGO_MANIFEST_PATH: $CARGO_MANIFEST_PATH
|
|
||||||
|
|
||||||
if [ "$CONFIGURATION" == "Debug" ]; then
|
|
||||||
EXTRA_CARGO_OPTIONS="$@"
|
|
||||||
else
|
|
||||||
EXTRA_CARGO_OPTIONS="$@ --release"
|
|
||||||
fi
|
|
||||||
ARCHS=${ARCHS:=arm64}
|
|
||||||
for arch in $ARCHS
|
|
||||||
do
|
|
||||||
if [ "$arch" == "arm64" ]; then
|
|
||||||
echo arm64
|
|
||||||
CARGO_TARGET=aarch64-apple-ios
|
|
||||||
#CARGO_TOOLCHAIN=+ios-arm64-1.57.0
|
|
||||||
CARGO_TOOLCHAIN=
|
|
||||||
elif [ "$arch" == "x86_64" ]; then
|
|
||||||
echo x86_64
|
|
||||||
CARGO_TARGET=x86_64-apple-ios
|
|
||||||
CARGO_TOOLCHAIN=
|
|
||||||
else
|
|
||||||
echo Unsupported ARCH: $arch
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
CARGO=`which cargo`
|
|
||||||
CARGO=${CARGO:=~/.cargo/bin/cargo}
|
|
||||||
CARGO_DIR=$(dirname $CARGO)
|
|
||||||
|
|
||||||
# Choose arm64 brew for unit tests by default if we are on M1
|
|
||||||
if [ -f /opt/homebrew/bin/brew ]; then
|
|
||||||
HOMEBREW_DIR=/opt/homebrew/bin
|
|
||||||
elif [ -f /usr/local/bin/brew ]; then
|
|
||||||
HOMEBREW_DIR=/usr/local/bin
|
|
||||||
else
|
|
||||||
HOMEBREW_DIR=$(dirname `which brew`)
|
|
||||||
fi
|
|
||||||
|
|
||||||
env -i PATH=/usr/bin:/bin:$HOMEBREW_DIR:$CARGO_DIR HOME="$HOME" USER="$USER" cargo $CARGO_TOOLCHAIN build $EXTRA_CARGO_OPTIONS --target $CARGO_TARGET --manifest-path $CARGO_MANIFEST_PATH
|
|
||||||
done
|
|
||||||
|
|
@ -167,7 +167,7 @@
|
|||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
shellPath = /bin/sh;
|
shellPath = /bin/sh;
|
||||||
shellScript = "../../../../ios_build.sh veilid_tools --features ios_tests,rt-tokio\n";
|
shellScript = "../../../../../scripts/ios_build.sh ../../../../ veilid_tools --features ios_tests,rt-tokio\n";
|
||||||
};
|
};
|
||||||
/* End PBXShellScriptBuildPhase section */
|
/* End PBXShellScriptBuildPhase section */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user