From f717d87e8c512c3207c5ae1e8ab2d8f99e1187a2 Mon Sep 17 00:00:00 2001 From: Seth Goings Date: Fri, 2 Jan 2015 12:52:36 -0700 Subject: [PATCH 1/5] Add better publishing intended for Travis + establish packages for windows/linux builds --- .travis.yml | 31 +++++++++--- build.gradle | 8 +-- gradle/wrapper/gradle-wrapper.properties | 2 +- test/ci.sh | 63 ++++++++++++++++++------ 4 files changed, 72 insertions(+), 32 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0d01043096..b96f48bcc7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,27 @@ language: cpp + +before_install: + - sudo apt-get update -qq + - sudo apt-get install -y libc6-dev-i386 mingw-w64 gcc-mingw-w64-x86-64 g++-mingw-w64-i686 binutils-mingw-w64-x86-64 lib32z1-dev zlib1g-dev g++-mingw-w64-x86-64 + env: + matrix: + # - BUILD_STEP="jdk-test" + # - BUILD_STEP="test" + # - BUILD_STEP="mode=debug test" + # - BUILD_STEP="process=interpret test" + # - BUILD_STEP="mode=debug bootimage=true test" + # - BUILD_STEP="bootimage=true test" + # - BUILD_STEP="openjdk=$JAVA_HOME test" + # - BUILD_STEP="tails=true continuations=true heapdump=true test" + # - BUILD_STEP="codegen-targets=all test" + - BUILD_STEP="PUBLISH" global: - TERM=dumb - - secure: Pe7OLUvdk3DeTAShyaYsdAXBcnjdNOrtfTPt1mCP5+JKBUw3z0n7BpTgATVRBmkn866pDqxL0N3+jBgjKUpEpqOj23bTB2AeDdIzlYkFGvTd3GQQV1lMFn16I9LOgWJhkfICTJ1rIYiNf8xSkJoeKGB7eGUM0KGsTvelFfsaGVc= - # BINTRAY_USER - - secure: CauPpj2QrbgEaePEPQx+FDeZqc46HmWXHfdAyn+DA9g6np3RMyc+N/ESrJ9efc4E772rnxory2QRyyNffzi29ceNTpIzsIRDuk5WvvC+zePEsQm8kX1afsDK5g16QEvJN24jGSW9ci9uxuknqjeKVOukcFQdxssIyDe11tYWJeI= - # BINTRAY_API_KEY - - secure: Gao6KTkCbqrdCDI2hQswh1v+SpHBeF4hR1WXmCe9gjmPyJb731K2eWigQOrhPOw7Ns3nubo1FwCb5YevYmwPMLryh0f4sKJyqLL1MLbffNl5GttNF2oO3p73cJpgBfHdzabAMwAYGYbneqUZ0Qn4K8RkzXUaoBDv465KmZhqbA0= -script: "./test/ci.sh" -after_success: -- "./gradlew artifactoryPublish" + - secure: rh1utD4shKmYtokItuRYEF9WsfTnvZO5XqnTU4DHTS7quHHgLihtOO2/3+B+2W2hEd5Obr2or8zx+zmzWcNUyLokZ0j/FRLWSScNkLzTtm12pupLrncY+/g1NIdfbhn+OLRIzBz6zB6m6a2qWFEJ+bScUNGD/7wZVtzkujqlDEE= + - secure: j9DOzZMCYk/BzhKK9u4XMKpCzyGOsvP2cLTp6cXE7/tkWDAPVv6BFmeqNbiLTEqk0aGX+HYbY/2YVtpRZmDzfeWtnBFF5mL1Y1tgzx1Kf155C+P6rZgt5PiQTUdXlp2umuRifY1BbXAPc3DZ2UOPUjWKnLHVbZLQRgO1zimmMx8= + +matrix: + fast_finish: true + +script: ./test/ci.sh STEP ${BUILD_STEP} diff --git a/build.gradle b/build.gradle index 5ecf1afb07..0aad0b602a 100644 --- a/build.gradle +++ b/build.gradle @@ -107,12 +107,6 @@ model { operatingSystem SupportedOS.valueOf(platform.toUpperCase()) architecture "${arch}" } - if(platformArch != currentPlatformArch) { - create(currentPlatformArch) { - operatingSystem SupportedOS.CURRENT - architecture "${currentArch}" - } - } } tasks { @@ -235,7 +229,7 @@ publishing { artifact("${nativeBuildDir}/avian${binSuffix}") { name "avian" type publishBinSuffix - extension binSuffix + extension publishBinSuffix } artifact("${nativeBuildDir}/libavian.a") { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 84bf862c89..2ce5f17a6f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,4 +1,4 @@ -#Thu Aug 28 14:47:06 MDT 2014 +#Fri Jan 02 11:31:32 MST 2015 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/test/ci.sh b/test/ci.sh index 7040c7b921..f318897bde 100755 --- a/test/ci.sh +++ b/test/ci.sh @@ -1,9 +1,11 @@ -#!/bin/sh +#!/usr/bin/env bash -set -e +set -eo pipefail root_dir=$(pwd) +flags="${@}" + run() { echo '===============================================' if [ ! $(pwd) = ${root_dir} ]; then @@ -23,10 +25,24 @@ run_cmake() { cd .. } -flags="${@}" +publish() { + local platforms="${1}" + local arches="${2}" + + local platform + for platform in ${platforms}; do + local arch + for arch in ${arches}; do + echo "------ Publishing ${platform}-${arch} ------" + ./gradlew artifactoryPublish -Pplatform=${platform} -Parch=${arch} + done + done +} has_flag() { - local arg=$1 + local arg=${1} + + local f for f in ${flags}; do local key=$(echo $f | awk -F '=' '{print $1}') if [ ${key} = ${arg} ]; then @@ -38,19 +54,34 @@ has_flag() { make_target=test -test `uname -o` = "Cygwin" || run_cmake -DCMAKE_BUILD_TYPE=Debug +if [[ "${1}" == "STEP" ]]; then + shift 1 + if [[ "${1}" == "PUBLISH" ]]; then + if [[ $(uname -s) == "Darwin" || ${TRAVIS_OS_NAME} == "osx" ]]; then + publish "macosx" "i386 x86_64" + elif [[ $(uname -s) == "Linux" ]]; then + publish "linux windows" "i386 x86_64" + fi + else + run make ${@} + fi +else + if [[ $(uname -o) != "Cygwin" ]]; then + run_cmake -DCMAKE_BUILD_TYPE=Debug + fi -run make jdk-test -run make ${flags} ${make_target} -run make ${flags} mode=debug ${make_target} -run make ${flags} process=interpret ${make_target} + run make jdk-test + run make ${flags} ${make_target} + run make ${flags} mode=debug ${make_target} + run make ${flags} process=interpret ${make_target} -(has_flag openjdk-src || ! has_flag openjdk) && \ - run make ${flags} mode=debug bootimage=true ${make_target} && \ - run make ${flags} bootimage=true ${make_target} + (has_flag openjdk-src || ! has_flag openjdk) && \ + run make ${flags} mode=debug bootimage=true ${make_target} && \ + run make ${flags} bootimage=true ${make_target} -(! has_flag openjdk && ! has_flag android) && \ - run make ${flags} openjdk=$JAVA_HOME ${make_target} + (! has_flag openjdk && ! has_flag android) && \ + run make ${flags} openjdk=$JAVA_HOME ${make_target} -run make ${flags} tails=true continuations=true heapdump=true ${make_target} -run make ${flags} codegen-targets=all + run make ${flags} tails=true continuations=true heapdump=true ${make_target} + run make ${flags} codegen-targets=all +fi From 7e5bcbea07bd1cf5424f99a1172c1c5c952b19c9 Mon Sep 17 00:00:00 2001 From: Seth Goings Date: Fri, 2 Jan 2015 16:38:43 -0700 Subject: [PATCH 2/5] Add matrix build for all tests --- .travis.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index b96f48bcc7..c4b64bf9d4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,15 +6,15 @@ before_install: env: matrix: - # - BUILD_STEP="jdk-test" - # - BUILD_STEP="test" - # - BUILD_STEP="mode=debug test" - # - BUILD_STEP="process=interpret test" - # - BUILD_STEP="mode=debug bootimage=true test" - # - BUILD_STEP="bootimage=true test" - # - BUILD_STEP="openjdk=$JAVA_HOME test" - # - BUILD_STEP="tails=true continuations=true heapdump=true test" - # - BUILD_STEP="codegen-targets=all test" + - BUILD_STEP="jdk-test" + - BUILD_STEP="test" + - BUILD_STEP="mode=debug test" + - BUILD_STEP="process=interpret test" + - BUILD_STEP="mode=debug bootimage=true test" + - BUILD_STEP="bootimage=true test" + - BUILD_STEP="openjdk=$JAVA_HOME test" + - BUILD_STEP="tails=true continuations=true heapdump=true test" + - BUILD_STEP="codegen-targets=all test" - BUILD_STEP="PUBLISH" global: - TERM=dumb From 022efafbcc3a88f1885322c9c47a38cf92418c83 Mon Sep 17 00:00:00 2001 From: Seth Goings Date: Fri, 2 Jan 2015 16:48:43 -0700 Subject: [PATCH 3/5] Only publish to oss.jfrog.org if TRAVIS_BRANCH is master --- build.gradle | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.gradle b/build.gradle index 0aad0b602a..c71f410ced 100644 --- a/build.gradle +++ b/build.gradle @@ -243,6 +243,9 @@ publishing { } artifactoryPublish { + onlyIf { + System.env.'TRAVIS_BRANCH' == "master" + } dependsOn assemble } From ab83e852ffb42d55eeee57acd31c6411bf957a58 Mon Sep 17 00:00:00 2001 From: Seth Goings Date: Fri, 2 Jan 2015 16:52:15 -0700 Subject: [PATCH 4/5] Remove Travis CI matrix for now (best utilized when/if we have other platforms/arches) --- .travis.yml | 12 ++---------- test/ci.sh | 15 +++++---------- 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/.travis.yml b/.travis.yml index c4b64bf9d4..d0b12eeaee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,15 +6,7 @@ before_install: env: matrix: - - BUILD_STEP="jdk-test" - - BUILD_STEP="test" - - BUILD_STEP="mode=debug test" - - BUILD_STEP="process=interpret test" - - BUILD_STEP="mode=debug bootimage=true test" - - BUILD_STEP="bootimage=true test" - - BUILD_STEP="openjdk=$JAVA_HOME test" - - BUILD_STEP="tails=true continuations=true heapdump=true test" - - BUILD_STEP="codegen-targets=all test" + - BUILD_STEP="" - BUILD_STEP="PUBLISH" global: - TERM=dumb @@ -24,4 +16,4 @@ env: matrix: fast_finish: true -script: ./test/ci.sh STEP ${BUILD_STEP} +script: ./test/ci.sh ${BUILD_STEP} diff --git a/test/ci.sh b/test/ci.sh index f318897bde..b84cd7f812 100755 --- a/test/ci.sh +++ b/test/ci.sh @@ -54,16 +54,11 @@ has_flag() { make_target=test -if [[ "${1}" == "STEP" ]]; then - shift 1 - if [[ "${1}" == "PUBLISH" ]]; then - if [[ $(uname -s) == "Darwin" || ${TRAVIS_OS_NAME} == "osx" ]]; then - publish "macosx" "i386 x86_64" - elif [[ $(uname -s) == "Linux" ]]; then - publish "linux windows" "i386 x86_64" - fi - else - run make ${@} +if [[ "${1}" == "PUBLISH" ]]; then + if [[ $(uname -s) == "Darwin" || ${TRAVIS_OS_NAME} == "osx" ]]; then + publish "macosx" "i386 x86_64" + elif [[ $(uname -s) == "Linux" ]]; then + publish "linux windows" "i386 x86_64" fi else if [[ $(uname -o) != "Cygwin" ]]; then From d62d0aa9162706b896bbde8b22dd60308787b3d8 Mon Sep 17 00:00:00 2001 From: Seth Goings Date: Fri, 2 Jan 2015 17:33:13 -0700 Subject: [PATCH 5/5] Make sure not to publish if we are a pull request too... --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index c71f410ced..3534d3b3d1 100644 --- a/build.gradle +++ b/build.gradle @@ -244,7 +244,7 @@ publishing { artifactoryPublish { onlyIf { - System.env.'TRAVIS_BRANCH' == "master" + System.env.'TRAVIS_BRANCH' == "master" && !System.env.'TRAVIS_PULL_REQUEST'.toBoolean() } dependsOn assemble }