diff --git a/compile_go.sh b/compile_go.sh new file mode 100644 index 0000000000000000000000000000000000000000..05101ba1d75d402bbd0795b1130b80121d6fdb66 --- /dev/null +++ b/compile_go.sh @@ -0,0 +1,37 @@ +# Copyright (C) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +CURWORK_DIR=$(pwd); +LOCAL_PROPTIES_FILE="local.properties"; +echo "sdk.dir="$CURWORK_DIR"/hmsdk">$LOCAL_PROPTIES_FILE; +wget https://nodejs.org/download/release/v12.19.0/node-v12.19.0-linux-x64.tar.xz; +tar xvJf node-v12.19.0-linux-x64.tar.xz; +export NODE_HOME=$CURWORK_DIR/node-v12.19.0-linux-x64/bin; +export PATH=$PATH:$NODE_HOME; +git clone https://gitee.com/wurep/hmsdk.git; +chmod 777 hmsdk/toolchains/restool; +chmod 777 gradlew; +if [ ! -n "$1" ]; then + ./gradlew assembleDebug; +else + ./gradlew $1; +fi +if [ $? -eq 0 ]; then + rm -rf hmsdk; + rm node-v12.19.0-linux-x64.tar.xz; + rm -rf node-v12.19.0-linux-x64; +else + exit 1 +fi + + + + +