From 1c47d75ea6021ed768ca561d7b37a2c6772b0e52 Mon Sep 17 00:00:00 2001 From: Ruben Guerrero Samaniego Date: Tue, 6 Feb 2018 18:51:14 +0000 Subject: [PATCH] Merged PR 1407725: Clean up scripts fro non Win platforms Less scripts to run our build. Related work items: #15816394 --- makeaosp-arm | 16 ----- makeaosp-arm64 | 16 ----- makeaosp-armv7a | 16 ----- makeaosp-x86 | 16 ----- makeaosp.sh | 72 +++++++++++++++++++ makeaosponmacx86.sh | 16 ----- makeaosponmacx86chk.sh | 17 ----- makeios.sh | 44 ++++++++++++ makeiosarm64 | 10 --- makeiossim | 10 --- makeiossimchk | 10 --- makelinux | 10 --- makelinux.sh | 38 ++++++++++ makelinuxchk | 10 --- makemac | 10 --- makemac.sh | 38 ++++++++++ makemacchk | 10 --- .../MacOS-Linux/testaosponmac.sh | 11 ++- .../gradle/wrapper/gradle-wrapper.properties | 2 +- 19 files changed, 198 insertions(+), 174 deletions(-) delete mode 100644 makeaosp-arm delete mode 100644 makeaosp-arm64 delete mode 100644 makeaosp-armv7a delete mode 100644 makeaosp-x86 create mode 100755 makeaosp.sh delete mode 100755 makeaosponmacx86.sh delete mode 100644 makeaosponmacx86chk.sh create mode 100755 makeios.sh delete mode 100755 makeiosarm64 delete mode 100755 makeiossim delete mode 100644 makeiossimchk delete mode 100755 makelinux create mode 100755 makelinux.sh delete mode 100644 makelinuxchk delete mode 100755 makemac create mode 100755 makemac.sh delete mode 100644 makemacchk rename testaosponmac.sh => test/MacOS-Linux/testaosponmac.sh (86%) diff --git a/makeaosp-arm b/makeaosp-arm deleted file mode 100644 index f34842bd..00000000 --- a/makeaosp-arm +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -# script to build on mac -mkdir .vs -cd .vs - -# clean up any old builds of xPlatAppx modules -find . -name *xPlatAppx* -d | xargs rm -r - -cmake -DCMAKE_SYSTEM_NAME=Android \ - -DCMAKE_ANDROID_NDK=/home/xplatappxuser/android-ndk-r16b \ - -DCMAKE_SYSTEM_VERSION=19 \ - -DCMAKE_ANDROID_ARCH_ABI=armeabi \ - -DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang \ - -DCMAKE_ANDROID_STL_TYPE=c++_shared \ - -DCMAKE_BUILD_TYPE=MinSizeRel -DAOSP=on .. -make diff --git a/makeaosp-arm64 b/makeaosp-arm64 deleted file mode 100644 index 5da9bd7d..00000000 --- a/makeaosp-arm64 +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -# script to build on mac -mkdir .vs -cd .vs - -# clean up any old builds of xPlatAppx modules -find . -name *xPlatAppx* -d | xargs rm -r - -cmake -DCMAKE_SYSTEM_NAME=Android \ - -DCMAKE_ANDROID_NDK=/home/xplatappxuser/android-ndk-r16b \ - -DCMAKE_SYSTEM_VERSION=27 \ - -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a \ - -DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang \ - -DCMAKE_ANDROID_STL_TYPE=c++_shared \ - -DCMAKE_BUILD_TYPE=MinSizeRel -DAOSP=on .. -make diff --git a/makeaosp-armv7a b/makeaosp-armv7a deleted file mode 100644 index 87163742..00000000 --- a/makeaosp-armv7a +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -# script to build on mac -mkdir .vs -cd .vs - -# clean up any old builds of xPlatAppx modules -find . -name *xPlatAppx* -d | xargs rm -r - -cmake -DCMAKE_SYSTEM_NAME=Android \ - -DCMAKE_ANDROID_NDK=/home/xplatappxuser/android-ndk-r16b \ - -DCMAKE_SYSTEM_VERSION=19 \ - -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a \ - -DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang \ - -DCMAKE_ANDROID_STL_TYPE=c++_shared \ - -DCMAKE_BUILD_TYPE=MinSizeRel -DAOSP=on .. -make diff --git a/makeaosp-x86 b/makeaosp-x86 deleted file mode 100644 index 7a0791a7..00000000 --- a/makeaosp-x86 +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -# script to build on mac -mkdir .vs -cd .vs - -# clean up any old builds of xPlatAppx modules -find . -name *xPlatAppx* -d | xargs rm -r - -cmake -DCMAKE_SYSTEM_NAME=Android \ - -DCMAKE_ANDROID_NDK=/home/xplatappxuser/android-ndk-r16b \ - -DCMAKE_SYSTEM_VERSION=19 \ - -DCMAKE_ANDROID_ARCH_ABI=x86 \ - -DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang \ - -DCMAKE_ANDROID_STL_TYPE=c++_shared \ - -DCMAKE_BUILD_TYPE=MinSizeRel -DAOSP=on .. -make diff --git a/makeaosp.sh b/makeaosp.sh new file mode 100755 index 00000000..6e317650 --- /dev/null +++ b/makeaosp.sh @@ -0,0 +1,72 @@ +#!/bin/bash +# script to build AOSP. + +ndk= +arch=x86 +build=MinSizeRel +version=19 + +usage() +{ + echo "usage: makeaosp [-ndk ndk_path] [-arch arch] [-v version] [-b buildType]" + echo $'\t' "-ndk Path to Android NDK. Default $ANDROID_NDK_ROOT or $ANDROID_NDK" + echo $'\t' "-arch Architecture ABI. Default x86" + echo $'\t' "-v Android version. Default 19" + echo $'\t' "-b Build type. Default MinSizeRel" +} + +printsetup() +{ + echo "NDK Path:" $ndk + echo "Architecture:" $arch + echo "Version:" $version + echo "Build Type:" $build +} + +while [ "$1" != "" ]; do + case $1 in + -ndk ) shift + ndk=$1 + ;; + -arch ) shift + arch=$1 + ;; + -b ) shift + build=$1 + ;; + -v ) shift + version=$1 + ;; + -h ) usage + exit + ;; + * ) usage + exit 1 + esac + shift +done + +if [ -z "$ndk" ] && [ -n "$ANDROID_NDK_ROOT" ]; then + ndk="$ANDROID_NDK_ROOT" +elif [ -z "$ndk" ] && [ -n "$ANDROID_ROOT"]; then + ndk="$ANDROID_ROOT" +elif [ -z "$ndk" ]; then + echo "Android NDK not found" + exit 1 +fi +printsetup + +mkdir .vs +cd .vs + +# clean up any old builds of xPlatAppx modules +find . -name *xPlatAppx* -d | xargs rm -r + +cmake -DCMAKE_SYSTEM_NAME=Android \ + -DCMAKE_ANDROID_NDK="$ndk" \ + -DCMAKE_SYSTEM_VERSION="$version" \ + -DCMAKE_ANDROID_ARCH_ABI="$arch" \ + -DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang \ + -DCMAKE_ANDROID_STL_TYPE=c++_shared \ + -DCMAKE_BUILD_TYPE="$build" -DAOSP=on .. +make diff --git a/makeaosponmacx86.sh b/makeaosponmacx86.sh deleted file mode 100755 index aa5d4730..00000000 --- a/makeaosponmacx86.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -# script to build on mac -mkdir android -cd android - -# clean up any old builds of xPlatAppx modules -find . -name *xPlatAppx* -d | xargs rm -r - -cmake -DCMAKE_SYSTEM_NAME=Android \ - -DCMAKE_ANDROID_NDK=/users/rubengu/Library/Android/sdk/ndk-bundle \ - -DCMAKE_SYSTEM_VERSION=19 \ - -DCMAKE_ANDROID_ARCH_ABI=x86 \ - -DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang \ - -DCMAKE_ANDROID_STL_TYPE=c++_shared \ - -DCMAKE_BUILD_TYPE=MinSizeRel -DAOSP=on .. -make diff --git a/makeaosponmacx86chk.sh b/makeaosponmacx86chk.sh deleted file mode 100644 index 2443f418..00000000 --- a/makeaosponmacx86chk.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -# script to build on mac - -mkdir .vs -cd .vs - -# clean up any old builds of xPlatAppx modules -find . -name *xPlatAppx* -d | xargs rm -r - -cmake -DCMAKE_SYSTEM_NAME=Android \ - -DCMAKE_ANDROID_NDK=/users/rubengu/Library/Android/sdk/ndk-bundle \ - -DCMAKE_SYSTEM_VERSION=19 \ - -DCMAKE_ANDROID_ARCH_ABI=x86 \ - -DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang \ - -DCMAKE_ANDROID_STL_TYPE=c++_shared \ - -DCMAKE_BUILD_TYPE=Debug -DAOSP=on .. -make diff --git a/makeios.sh b/makeios.sh new file mode 100755 index 00000000..b2876769 --- /dev/null +++ b/makeios.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# script to build on mac for ios +build=MinSizeRel +arch=x86_64 + +usage() +{ + echo "usage: makemac [-b buildType]" + echo $'\t' "-b Build type. Default MinSizeRel" + echo $'\t' "-arch OSX Architecture. Default x86_64 (simulator)" +} + +printsetup() +{ + echo "Build Type:" $build + echo "Architecture:" $arch +} + +while [ "$1" != "" ]; do + case $1 in + -b ) shift + build=$1 + ;; + -arch ) shift + arch=$1 + ;; + -h ) usage + exit + ;; + * ) usage + exit 1 + esac + shift +done +printsetup + +mkdir .vs +cd .vs + +# clean up any old builds of xPlatAppx modules +find . -name *xPlatAppx* -d | xargs rm -r + +cmake -DCMAKE_BUILD_TYPE=$build -DIOS=on -DCMAKE_TOOLCHAIN_FILE=../cmake/ios.cmake -DCMAKE_OSX_ARCHITECTURES=$arch .. +make \ No newline at end of file diff --git a/makeiosarm64 b/makeiosarm64 deleted file mode 100755 index ae0d544e..00000000 --- a/makeiosarm64 +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -# script to build on mac -mkdir .vs -cd .vs - -# clean up any old builds of xPlatAppx modules -find . -name *xPlatAppx* -d | xargs rm -r - -cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DIOS=on -DCMAKE_TOOLCHAIN_FILE=../cmake/ios.cmake -DCMAKE_OSX_ARCHITECTURES=arm64 .. -make \ No newline at end of file diff --git a/makeiossim b/makeiossim deleted file mode 100755 index 9bc875a8..00000000 --- a/makeiossim +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -# script to build on mac -mkdir .vs -cd .vs - -# clean up any old builds of xPlatAppx modules -find . -name *xPlatAppx* -d | xargs rm -r - -cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DIOS=on -DCMAKE_TOOLCHAIN_FILE=../cmake/ios.cmake -DCMAKE_OSX_ARCHITECTURES=x86_64 .. -make \ No newline at end of file diff --git a/makeiossimchk b/makeiossimchk deleted file mode 100644 index 5a18bd23..00000000 --- a/makeiossimchk +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -# script to build on mac -mkdir .vs -cd .vs - -# clean up any old builds of xPlatAppx modules -find . -name *xPlatAppx* -d | xargs rm -r - -cmake -DCMAKE_BUILD_TYPE=Debug -DIOS=on -DCMAKE_TOOLCHAIN_FILE=../cmake/ios.cmake -DCMAKE_OSX_ARCHITECTURES=x86_64 .. -make \ No newline at end of file diff --git a/makelinux b/makelinux deleted file mode 100755 index 82d80371..00000000 --- a/makelinux +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -# script to build on linux -mkdir .vs -cd .vs - -# clean up any old builds of xPlatAppx modules -find . -name *xPlatAppx* -d | xargs rm -r - -cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DLINUX=on .. -make diff --git a/makelinux.sh b/makelinux.sh new file mode 100755 index 00000000..e07a5927 --- /dev/null +++ b/makelinux.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# script to build on linux +build=MinSizeRel + +usage() +{ + echo "usage: makelinux [-b buildType]" + echo $'\t' "-b Build type. Default MinSizeRel" +} + +printsetup() +{ + echo "Build Type:" $build +} + +while [ "$1" != "" ]; do + case $1 in + -b ) shift + build=$1 + ;; + -h ) usage + exit + ;; + * ) usage + exit 1 + esac + shift +done +printsetup + +mkdir .vs +cd .vs + +# clean up any old builds of xPlatAppx modules +find . -name *xPlatAppx* -d | xargs rm -r + +cmake -DCMAKE_BUILD_TYPE=$build -DLINUX=on .. +make diff --git a/makelinuxchk b/makelinuxchk deleted file mode 100644 index 3afdc8a0..00000000 --- a/makelinuxchk +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -# script to build on linux -mkdir .vs -cd .vs - -# clean up any old builds of xPlatAppx modules -find . -name *xPlatAppx* -d | xargs rm -r - -cmake -DCMAKE_BUILD_TYPE=Debug -DLINUX=on .. -make diff --git a/makemac b/makemac deleted file mode 100755 index 5f26b279..00000000 --- a/makemac +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -# script to build on mac -mkdir .vs -cd .vs - -# clean up any old builds of xPlatAppx modules -find . -name *xPlatAppx* -d | xargs rm -r - -cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DMACOS=on .. -make diff --git a/makemac.sh b/makemac.sh new file mode 100755 index 00000000..f8844955 --- /dev/null +++ b/makemac.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# script to build on mac +build=MinSizeRel + +usage() +{ + echo "usage: makemac [-b buildType]" + echo $'\t' "-b Build type. Default MinSizeRel" +} + +printsetup() +{ + echo "Build Type:" $build +} + +while [ "$1" != "" ]; do + case $1 in + -b ) shift + build=$1 + ;; + -h ) usage + exit + ;; + * ) usage + exit 1 + esac + shift +done +printsetup + +mkdir .vs +cd .vs + +# clean up any old builds of xPlatAppx modules +find . -name *xPlatAppx* -d | xargs rm -r + +cmake -DCMAKE_BUILD_TYPE=$build -DMACOS=on .. +make diff --git a/makemacchk b/makemacchk deleted file mode 100644 index 3842d1be..00000000 --- a/makemacchk +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -# script to build on mac -mkdir .vs -cd .vs - -# clean up any old builds of xPlatAppx modules -find . -name *xPlatAppx* -d | xargs rm -r - -cmake -DCMAKE_BUILD_TYPE=Debug -DMACOS=on .. -make diff --git a/testaosponmac.sh b/test/MacOS-Linux/testaosponmac.sh similarity index 86% rename from testaosponmac.sh rename to test/MacOS-Linux/testaosponmac.sh index 7c1134dd..f88b3622 100755 --- a/testaosponmac.sh +++ b/test/MacOS-Linux/testaosponmac.sh @@ -43,13 +43,12 @@ function StartEmulator { function CreateApp { # Prepare package and compile - cd $xplatappxdir/test/mobile/xPlatAppxAndroid + cd $xplatappxdir/../mobile/xPlatAppxAndroid mkdir app/src/main/assets - cp -R $xplatappxdir/test/appx/* app/src/main/assets + cp -R $xplatappxdir/../appx/* app/src/main/assets mkdir -p app/src/main/jniLibs/x86 - cp $xplatappxdir/android/lib/libxPlatAppx.so app/src/main/jniLibs/x86 - JAVA_HOME="/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home" - rm -r build + cp $xplatappxdir/../../.vs/lib/libxPlatAppx.so app/src/main/jniLibs/x86 + rm -r build app/build sh ./gradlew assembleDebug } @@ -87,7 +86,7 @@ function ParseResult { StartEmulator # Clean up. This commands might fail, but is not an error adb shell rm -r /data/data/com.microsoft.xplatappxandroid/files -rm $xplatappxdir/test/mobile/xPlatAppxAndroid/testResults.txt +rm $xplatappxdir/../mobile/xPlatAppxAndroid/testResults.txt CreateApp RunTest diff --git a/test/mobile/xPlatAppxAndroid/gradle/wrapper/gradle-wrapper.properties b/test/mobile/xPlatAppxAndroid/gradle/wrapper/gradle-wrapper.properties index 5cfd3906..72ed8da6 100644 --- a/test/mobile/xPlatAppxAndroid/gradle/wrapper/gradle-wrapper.properties +++ b/test/mobile/xPlatAppxAndroid/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.5.1-all.zip