diff --git a/.builder/actions/aws_crt_java_build.py b/.builder/actions/aws_crt_java_build.py index 9a6575a67..dc220d0bf 100644 --- a/.builder/actions/aws_crt_java_build.py +++ b/.builder/actions/aws_crt_java_build.py @@ -13,3 +13,10 @@ def run(self, env): else: env.shell.exec("mvn", "-P", "continuous-integration", "-B", "compile", check=True) + + parser = argparse.ArgumentParser() + parser.add_argument('--classifier') + args = parser.parse_known_args(env.args.args)[0] + if args.classifier: + env.shell.exec("mvn", "-B", "install", "-DskipTests", "-Dshared-lib.skip=true", + f"-Dcrt.classifier={args.classifier}", check=True) diff --git a/codebuild/common-linux.sh b/codebuild/common-linux.sh deleted file mode 100755 index ba8d7c6ca..000000000 --- a/codebuild/common-linux.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash - -set -e - -if test -f "/tmp/setup_proxy_test_env.sh"; then - source /tmp/setup_proxy_test_env.sh -fi - -env - -git submodule update --init - -curl https://www.amazontrust.com/repository/AmazonRootCA1.pem --output /tmp/AmazonRootCA1.pem -cert=$(aws secretsmanager get-secret-value --secret-id "unit-test/certificate" --query "SecretString" | cut -f2 -d":" | cut -f2 -d\") && echo -e "$cert" > /tmp/certificate.pem -key=$(aws secretsmanager get-secret-value --secret-id "unit-test/privatekey" --query "SecretString" | cut -f2 -d":" | cut -f2 -d\") && echo -e "$key" > /tmp/privatekey.pem -ecc_cert=$(aws secretsmanager get-secret-value --secret-id "ecc-test/certificate" --query "SecretString" | cut -f2 -d":" | cut -f2 -d\") && echo -e "$cert" > /tmp/ecc_certificate.pem -ecc_privatekey=$(aws secretsmanager get-secret-value --secret-id "ecc-test/privatekey" --query "SecretString" | cut -f2 -d":" | cut -f2 -d\") && echo -e "$key" > /tmp/ecc_privatekey.pem -key_p8=$(aws secretsmanager get-secret-value --secret-id "unit-test/privatekey-p8" --query "SecretString" | cut -f2 -d":" | cut -f2 -d\") && echo -e "$key_p8" > /tmp/privatekey_p8.pem -ENDPOINT=$(aws secretsmanager get-secret-value --secret-id "unit-test/endpoint" --query "SecretString" | cut -f2 -d":" | sed -e 's/[\\\"\}]//g') - -# Go to repository root directory -cd $CODEBUILD_SRC_DIR - -# Build and run all the tests! -ulimit -c unlimited -mvn -B test $* \ - -DredirectTestOutputToFile=true \ - -DreuseForks=false \ - -Dendpoint=$ENDPOINT \ - -Dcertificate=/tmp/certificate.pem \ - -Dprivatekey=/tmp/privatekey.pem \ - -Decc_certificate=/tmp/ecc_certificate.pem \ - -Decc_privatekey=/tmp/ecc_privatekey.pem \ - -Drootca=/tmp/AmazonRootCA1.pem \ - -Dprivatekey_p8=/tmp/privatekey_p8.pem \ - -Daws.crt.debugnative=true \ - -Dcmake.s2nNoPqAsm=ON - -# Run the MQTT5 tests again, but connecting to Codebuild -source ./utils/mqtt5_test_setup.sh s3://aws-crt-test-stuff/TestIotProdMQTT5EnvironmentVariables.txt us-east-1 -mvn -B test -Dtest=Mqtt5ClientTest -Daws.crt.debugnative=true -DreuseForks=false -DredirectTestOutputToFile=true -source ./utils/mqtt5_test_setup.sh s3://aws-crt-test-stuff/TestIotProdMQTT5EnvironmentVariables.txt cleanup diff --git a/codebuild/common-macos.sh b/codebuild/common-macos.sh deleted file mode 100755 index d489e920a..000000000 --- a/codebuild/common-macos.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# Until CodeBuild supports macOS, this script is just used by Travis. - -set -ex - -mvn -B compile diff --git a/codebuild/common-windows.bat b/codebuild/common-windows.bat deleted file mode 100644 index e6f073b66..000000000 --- a/codebuild/common-windows.bat +++ /dev/null @@ -1,26 +0,0 @@ - -@echo off - -@setlocal enableextensions enabledelayedexpansion - -pushd %~dp0\..\ - - :: install chocolatey -"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" -:: this will also install jdk8 -choco install adoptopenjdk8 maven -y -call RefreshEnv.cmd -echo JAVA_HOME=%JAVA_HOME% - -cd %CODEBUILD_SRC_DIR% -mvn -B compile -Pwindows-codebuild || goto error - -popd -@endlocal -goto :EOF - -:error -popd -@endlocal -echo Failed with error #%errorlevel%. -exit /b %errorlevel% diff --git a/codebuild/linux-clang3-x64.yml b/codebuild/linux-clang3-x64.yml deleted file mode 100644 index 4e3275ecf..000000000 --- a/codebuild/linux-clang3-x64.yml +++ /dev/null @@ -1,24 +0,0 @@ -version: 0.2 -#this buildspec assumes the ubuntu aws/codebuild/java:openjdk-8 image -phases: - install: - commands: - - sudo apt-get update -y - - sudo apt-get install clang-3.9 cmake3 ninja-build -y - pre_build: - commands: - - export CC=clang-3.9 - build: - commands: - - echo Build started on `date` - - $CODEBUILD_SRC_DIR/codebuild/common-linux.sh -DCMAKE_EXPORT_COMPILE_COMMANDS=ON - post_build: - commands: - - echo Build completed on `date` - -artifacts: - discard-paths: yes - files: - - 'target/surefire-reports/**' - - 'hs_err_pid*' - - 'core*' diff --git a/codebuild/linux-clang6-x64.yml b/codebuild/linux-clang6-x64.yml deleted file mode 100644 index 476216f75..000000000 --- a/codebuild/linux-clang6-x64.yml +++ /dev/null @@ -1,29 +0,0 @@ -version: 0.2 -#this buildspec assumes the ubuntu aws/codebuild/java:openjdk-8 image -phases: - install: - commands: - - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - - - sudo add-apt-repository ppa:ubuntu-toolchain-r/test - - sudo apt-add-repository "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-6.0 main" - - sudo apt-get update -y - - sudo apt-get install clang-6.0 cmake3 cppcheck clang-format-6.0 ninja-build -y -f - pre_build: - commands: - - export CC=clang-6.0 - - export CLANG_FORMAT=clang-format-6.0 - build: - commands: - - echo Build started on `date` - - $CODEBUILD_SRC_DIR/codebuild/common-linux.sh -DCMAKE_EXPORT_COMPILE_COMMANDS=ON - - $CODEBUILD_SRC_DIR/format-check.sh - post_build: - commands: - - echo Build completed on `date` - -artifacts: - discard-paths: yes - files: - - 'target/surefire-reports/**' - - 'hs_err_pid*' - - 'core*' diff --git a/codebuild/linux-gcc-4x-x64.yml b/codebuild/linux-gcc-4x-x64.yml deleted file mode 100644 index 920cd551c..000000000 --- a/codebuild/linux-gcc-4x-x64.yml +++ /dev/null @@ -1,24 +0,0 @@ -version: 0.2 -#this build spec assumes the ubuntu aws/codebuild/java:openjdk-8 image -phases: - install: - commands: - - sudo apt-get update -y - - sudo apt-get install gcc cmake3 ninja-build -y - pre_build: - commands: - - export CC=gcc - build: - commands: - - echo Build started on `date` - - $CODEBUILD_SRC_DIR/codebuild/common-linux.sh - post_build: - commands: - - echo Build completed on `date` - -artifacts: - discard-paths: yes - files: - - 'target/surefire-reports/**' - - 'hs_err_pid*' - - 'core*' diff --git a/codebuild/linux-gcc-4x-x86.yml b/codebuild/linux-gcc-4x-x86.yml deleted file mode 100644 index c433438d8..000000000 --- a/codebuild/linux-gcc-4x-x86.yml +++ /dev/null @@ -1,18 +0,0 @@ -version: 0.2 -#this build spec assumes the ubuntu 14.04 trusty image -phases: - install: - commands: - pre_build: - commands: - - export CC=gcc - build: - commands: - - JAVA_HOME=/opt/jdk1.8.0_201/ setarch i386 mvn -B compile -Punix-x86 - -artifacts: - discard-paths: yes - files: - - 'target/surefire-reports/**' - - 'hs_err_pid*' - - 'core*' diff --git a/codebuild/linux-gcc-5x-x64.yml b/codebuild/linux-gcc-5x-x64.yml deleted file mode 100644 index 1848ed30f..000000000 --- a/codebuild/linux-gcc-5x-x64.yml +++ /dev/null @@ -1,25 +0,0 @@ -version: 0.2 -#this build spec assumes the ubuntu aws/codebuild/java:openjdk-8 image -phases: - install: - commands: - - sudo add-apt-repository ppa:ubuntu-toolchain-r/test - - sudo apt-get update -y - - sudo apt-get install gcc-5 cmake3 ninja-build -y - pre_build: - commands: - - export CC=gcc-5 - build: - commands: - - echo Build started on `date` - - $CODEBUILD_SRC_DIR/codebuild/common-linux.sh - post_build: - commands: - - echo Build completed on `date` - -artifacts: - discard-paths: yes - files: - - 'target/surefire-reports/**' - - 'hs_err_pid*' - - 'core*' diff --git a/codebuild/linux-gcc-6x-x64.yml b/codebuild/linux-gcc-6x-x64.yml deleted file mode 100644 index 1fbfb6878..000000000 --- a/codebuild/linux-gcc-6x-x64.yml +++ /dev/null @@ -1,25 +0,0 @@ -version: 0.2 -#this build spec assumes the ubuntu aws/codebuild/java:openjdk-8 image -phases: - install: - commands: - - sudo add-apt-repository ppa:ubuntu-toolchain-r/test - - sudo apt-get update -y - - sudo apt-get install gcc-6 cmake3 ninja-build -y - pre_build: - commands: - - export CC=gcc-6 - build: - commands: - - echo Build started on `date` - - $CODEBUILD_SRC_DIR/codebuild/common-linux.sh - post_build: - commands: - - echo Build completed on `date` - -artifacts: - discard-paths: yes - files: - - 'target/surefire-reports/**' - - 'hs_err_pid*' - - 'core*' diff --git a/codebuild/linux-gcc-7x-x64.yml b/codebuild/linux-gcc-7x-x64.yml deleted file mode 100644 index a11864061..000000000 --- a/codebuild/linux-gcc-7x-x64.yml +++ /dev/null @@ -1,26 +0,0 @@ -version: 0.2 -#this build spec assumes the ubuntu aws/codebuild/java:openjdk-8 image -phases: - install: - commands: - - sudo add-apt-repository ppa:openjdk-r/ppa - - sudo add-apt-repository ppa:ubuntu-toolchain-r/test - - sudo apt-get update -y - - sudo apt-get install gcc-7 cmake3 ninja-build -y - pre_build: - commands: - - export CC=gcc-7 - build: - commands: - - echo Build started on `date` - - $CODEBUILD_SRC_DIR/codebuild/common-linux.sh - post_build: - commands: - - echo Build completed on `date` - -artifacts: - discard-paths: yes - files: - - 'target/surefire-reports/**' - - 'hs_err_pid*' - - 'core*' diff --git a/codebuild/windows-msvc-2015-x86.yml b/codebuild/windows-msvc-2015-x86.yml deleted file mode 100644 index 398b6597e..000000000 --- a/codebuild/windows-msvc-2015-x86.yml +++ /dev/null @@ -1,11 +0,0 @@ -version: 0.2 - -env: - variables: - AWS_CMAKE_GENERATOR: Visual Studio 14 2015 - -phases: - build: - commands: - - .\codebuild\common-windows.bat - diff --git a/codebuild/windows-msvc-2015.yml b/codebuild/windows-msvc-2015.yml deleted file mode 100644 index f3cc1741f..000000000 --- a/codebuild/windows-msvc-2015.yml +++ /dev/null @@ -1,11 +0,0 @@ -version: 0.2 - -env: - variables: - AWS_CMAKE_GENERATOR: Visual Studio 14 2015 Win64 - -phases: - build: - commands: - - .\codebuild\common-windows.bat - diff --git a/codebuild/windows-msvc-2017.yml b/codebuild/windows-msvc-2017.yml deleted file mode 100644 index f6a00accf..000000000 --- a/codebuild/windows-msvc-2017.yml +++ /dev/null @@ -1,11 +0,0 @@ -version: 0.2 - -env: - variables: - AWS_CMAKE_GENERATOR: Visual Studio 15 2017 Win64 - -phases: - build: - commands: - - .\codebuild\common-windows.bat -