prepare.sh 2.1 KB
Newer Older
M
mamingshuai 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
#!/bin/bash

WORKDIR=/home/openharmony
TOOLSDIR=/home/prebuilts/prebuilts

rm -rf /usr/bin/python
ln -s /usr/bin/python2.7 /usr/bin/python

if [[ -d $WORKDIR/third_party/jsframework ]]; then
	echo copy jsframework node_modules
	cd $WORKDIR/third_party/jsframework
	npm install --registry https://registry.npm.taobao.org
fi

if [[ -d $TOOLSDIR/build-tools/common/js-framework ]]; then
	rm -rf $TOOLSDIR/build-tools/common/js-framework
fi
mkdir -p $TOOLSDIR/build-tools/common/js-framework
cp -r $WORKDIR/third_party/jsframework/node_modules $TOOLSDIR/build-tools/common/js-framework

if [[ -d $TOOLSDIR/build-tools/common/nodejs ]]; then
	rm -rf $TOOLSDIR/build-tools/common/nodejs
fi

mkdir -p $TOOLSDIR/build-tools/common/nodejs
cp -r $TOOLSDIR/node-v12.18.4-linux-x64 $TOOLSDIR/build-tools/common/nodejs
cp -r $TOOLSDIR/node-v12.18.4-darwin-x64 $TOOLSDIR/build-tools/common/nodejs

if [[ -h $WORKDIR/prebuilts/cmake ]]; then
	rm $WORKDIR/prebuilts/cmake
fi
echo link cmake
ln -s $TOOLSDIR/cmake $WORKDIR/prebuilts/cmake

if [[ -h $WORKDIR/prebuilts/build-tools ]]; then
	rm $WORKDIR/prebuilts/build-tools
fi
echo link build-tools
ln -s $TOOLSDIR/build-tools $WORKDIR/prebuilts/build-tools

if [[ -h $WORKDIR/prebuilts/python ]]; then
	rm $WORKDIR/prebuilts/python
fi
echo link python
ln -s $TOOLSDIR/python $WORKDIR/prebuilts/python

if [[ -h $WORKDIR/prebuilts/mingw-w64 ]]; then
	rm $WORKDIR/prebuilts/mingw-w64
fi
echo link mingw-w64
ln -s $TOOLSDIR/mingw-w64 $WORKDIR/prebuilts/mingw-w64

mv $TOOLSDIR/clang/host/prebuilts_clang_aosp_linux-x86_64 $TOOLSDIR/clang/host/linux-x86
if [[ -h $WORKDIR/prebuilts/clang ]]; then
	rm $WORKDIR/prebuilts/clang
fi
echo link clang
ln -s $TOOLSDIR/clang $WORKDIR/prebuilts/clang

mv $TOOLSDIR/gcc/linux-x86/arm/prebuilts_gcc_linux-x86_arm_gcc-linaro-7.5.0-arm-linux-gnueabi $TOOLSDIR/gcc/linux-x86/arm/gcc-linaro-7.5.0-arm-linux-gnueabi
if [[ -h $WORKDIR/prebuilts/gcc ]]; then
	rm $WORKDIR/prebuilts/gcc
fi
echo link gcc
ln -s $TOOLSDIR/gcc $WORKDIR/prebuilts/gcc

if [[ -h $WORKDIR/prebuilts/sdk ]]; then
	rm $WORKDIR/prebuilts/sdk
fi
echo link sdk
ln -s $TOOLSDIR/sdk $WORKDIR/prebuilts/sdk