Skip to content

Commit

Permalink
Upgrade to Gradle 5.6.4
Browse files Browse the repository at this point in the history
* Update dependencies to work with the newer Gradle version.
* Ignore new native build cache directory .cxx
* Explicitly specify ErrorProne version to work with new
  ErrorProne gradle plugin version (otherwise it fails with
  Java 8).
  • Loading branch information
kruton committed Nov 6, 2019
1 parent 803bfd2 commit ebc029b
Show file tree
Hide file tree
Showing 15 changed files with 69 additions and 33 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ matrix:
env:
- ANDROID_TOOLS_URL="https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip"
- ANDROID_HOME="$HOME/android-sdk-linux"
- ANDROID_NDK_HOME="$ANDROID_HOME/ndk-bundle"
- JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
- JAVA7_HOME=/usr/lib/jvm/java-7-openjdk-amd64
- JAVA11_HOME=/usr/lib/jvm/java-11-openjdk-amd64
Expand All @@ -40,11 +39,11 @@ matrix:
# Append tr '\r' '\n' | uniq to all the commands to suppress it
- $ANDROID_HOME/tools/bin/sdkmanager tools | tr '\r' '\n' | uniq
- $ANDROID_HOME/tools/bin/sdkmanager platform-tools | tr '\r' '\n' | uniq
- $ANDROID_HOME/tools/bin/sdkmanager 'build-tools;27.0.3' | tr '\r' '\n' | uniq
- $ANDROID_HOME/tools/bin/sdkmanager 'build-tools;28.0.3' | tr '\r' '\n' | uniq
- $ANDROID_HOME/tools/bin/sdkmanager 'platforms;android-26' | tr '\r' '\n' | uniq
- $ANDROID_HOME/tools/bin/sdkmanager 'extras;android;m2repository' | tr '\r' '\n' | uniq
- $ANDROID_HOME/tools/bin/sdkmanager ndk-bundle | tr '\r' '\n' | uniq
- $ANDROID_HOME/tools/bin/sdkmanager 'cmake;3.6.4111459' | tr '\r' '\n' | uniq
- $ANDROID_HOME/tools/bin/sdkmanager 'cmake;3.10.2.4988404' | tr '\r' '\n' | uniq
- gimme 1.13 # Needed for BoringSSL build
- source ~/.gimme/envs/go1.13.env

Expand Down
1 change: 1 addition & 0 deletions android/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
\.externalNativeBuild/
\.cxx/
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ install:
- yes 2> nul | "%ANDROID_HOME%\tools\bin\sdkmanager.bat" --licenses
- '%ANDROID_HOME%\tools\bin\sdkmanager.bat tools'
- '%ANDROID_HOME%\tools\bin\sdkmanager.bat platform-tools'
- '%ANDROID_HOME%\tools\bin\sdkmanager.bat build-tools;27.0.3'
- '%ANDROID_HOME%\tools\bin\sdkmanager.bat build-tools;29.0.2'
- '%ANDROID_HOME%\tools\bin\sdkmanager.bat platforms;android-26'
- '%ANDROID_HOME%\tools\bin\sdkmanager.bat extras;android;m2repository'
- '%ANDROID_HOME%\tools\bin\sdkmanager.bat ndk-bundle'
- '%ANDROID_HOME%\tools\bin\sdkmanager.bat cmake;3.6.4111459'
- '%ANDROID_HOME%\tools\bin\sdkmanager.bat cmake;3.10.2.4988404'

build_script:
- gradlew.bat assemble
Expand Down
6 changes: 4 additions & 2 deletions benchmark-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ if (androidSdkInstalled) {
}

dependencies {
depsJarApi project(path: ':conscrypt-android', configuration: 'default'),
depsJarApi project(path: ':conscrypt-android'),
libraries.bouncycastle_provider,
libraries.bouncycastle_apis

Expand All @@ -84,7 +84,9 @@ if (androidSdkInstalled) {
// configure task where the "from" contents is set inside a doLast stanza to ensure it is run
// after the execution phase of the "assemble" task.
task configureDepsJar {
dependsOn assemble
dependsOn assemble, \
configurations.depsJarApi.artifacts, \
configurations.depsJarImplementation.artifacts
doLast {
depsJar.from {
[
Expand Down
4 changes: 2 additions & 2 deletions benchmark-graphs/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apply plugin: 'application'

dependencies {
compile 'com.bazaarvoice.jolt:jolt-core:0.1.0'
compile 'com.bazaarvoice.jolt:json-utils:0.1.0'
compile 'com.bazaarvoice.jolt:jolt-core:0.1.1'
compile 'com.bazaarvoice.jolt:json-utils:0.1.1'
}

// We're not distributing this, so it's safe to use newer language features.
Expand Down
2 changes: 1 addition & 1 deletion benchmark-jmh/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'me.champeau.gradle.jmh' version '0.4.7'
id 'me.champeau.gradle.jmh' version '0.4.8'
}

apply plugin: 'idea'
Expand Down
27 changes: 18 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import org.gradle.util.VersionNumber

buildscript {
ext.android_tools = 'com.android.tools.build:gradle:3.1.3'
ext.android_tools = 'com.android.tools.build:gradle:3.5.0'
ext.errorproneVersion = '2.3.3'
ext.errorproneJavacVersion = '9+181-r4173-1'
repositories {
google()
jcenter()
Expand All @@ -8,15 +12,15 @@ buildscript {
// This must be applied in the root project otherwise each subproject will
// have it in a different ClassLoader.
classpath android_tools
classpath 'biz.aQute.bnd:biz.aQute.bnd.gradle:4.2.0'
classpath 'biz.aQute.bnd:biz.aQute.bnd.gradle:4.3.0'
}
}

plugins {
// Add dependency for build script so we can access Git from our
// build script.
id 'org.ajoberstar.grgit' version '2.2.1'
id 'net.ltgt.errorprone' version '0.0.11'
id 'org.ajoberstar.grgit' version '3.1.1'
id 'net.ltgt.errorprone' version '1.1.1'
}

subprojects {
Expand Down Expand Up @@ -98,14 +102,14 @@ subprojects {
javaExecutable32 = System.getProperty('javaExecutable32', System.env.CONSCRYPT_JAVA_EXECUTABLE_32)
javaExecutable64 = System.getProperty('javaExecutable64', System.env.CONSCRYPT_JAVA_EXECUTABLE_64)

jmhVersion = '1.19'
jmhVersion = '1.21'
libraries = [
android_tools: android_tools,
roboelectric: 'org.robolectric:android-all:7.1.0_r7-robolectric-0',

// Test dependencies.
bouncycastle_apis: 'org.bouncycastle:bcpkix-jdk15on:1.56',
bouncycastle_provider: 'org.bouncycastle:bcprov-jdk15on:1.56',
bouncycastle_apis: 'org.bouncycastle:bcpkix-jdk15on:1.63',
bouncycastle_provider: 'org.bouncycastle:bcprov-jdk15on:1.63',
junit : 'junit:junit:4.12',
mockito: 'org.mockito:mockito-core:1.9.5',
truth : 'com.google.truth:truth:0.28',
Expand All @@ -116,8 +120,8 @@ subprojects {
jmh_generator_asm: "org.openjdk.jmh:jmh-generator-asm:${jmhVersion}",
jmh_generator_bytecode: "org.openjdk.jmh:jmh-generator-bytecode:${jmhVersion}",
jmh_generator_reflection: "org.openjdk.jmh:jmh-generator-reflection:${jmhVersion}",
netty_handler: 'io.netty:netty-handler:4.1.8.Final',
netty_tcnative: 'io.netty:netty-tcnative-boringssl-static:1.1.33.Fork26',
netty_handler: 'io.netty:netty-handler:4.1.24.Final',
netty_tcnative: 'io.netty:netty-tcnative-boringssl-static:2.0.26.Final',
]

signJar = { jarPath ->
Expand All @@ -144,6 +148,11 @@ subprojects {
toolVersion = "0.8.4"
}

dependencies {
errorprone("com.google.errorprone:error_prone_core:$errorproneVersion")
errorproneJavac("com.google.errorprone:javac:$errorproneJavacVersion")
}

task generateProperties(type: WriteProperties) {
ext {
parsedVersion = VersionNumber.parse(version)
Expand Down
2 changes: 1 addition & 1 deletion gradle/publishing.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ signing {
sign publishing.publications
}

task("signPublications").doFirst {
tasks.register("signPublications").configure {
configurations.archives.allArtifacts.each {
if (it.type == 'jar' && it.classifier != 'sources' && it.classifier != 'javadoc') {
signJar(it.file.absolutePath)
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
22 changes: 19 additions & 3 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
#!/usr/bin/env sh

#
# Copyright 2015 the original author or authors.
#
# 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
#
# https://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.
#

##############################################################################
##
## Gradle start up script for UN*X
Expand Down Expand Up @@ -28,7 +44,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
Expand Down Expand Up @@ -109,8 +125,8 @@ if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
Expand Down
18 changes: 17 additions & 1 deletion gradlew.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
Expand All @@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
Expand Down
5 changes: 0 additions & 5 deletions libcore-stub/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,5 @@ dependencies {
compile libraries.junit
}

javadoc {
options.doclet = "org.conscrypt.doclet.FilterDoclet"
options.docletpath = configurations.publicApiDocs.files as List
}

// Disable the javadoc task.
tasks.withType(Javadoc).all { enabled = false }
2 changes: 1 addition & 1 deletion openjdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ task testInterop(type: Test) {
check.dependsOn testInterop

jacocoTestReport {
additionalSourceDirs = files("$rootDir/openjdk/src/test/java", "$rootDir/common/src/main/java")
additionalSourceDirs.from files("$rootDir/openjdk/src/test/java", "$rootDir/common/src/main/java")
executionData tasks.withType(Test)
}

Expand Down
2 changes: 0 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,3 @@ project(':conscrypt-libcore-stub').projectDir = "$rootDir/libcore-stub" as File
project(':conscrypt-openjdk').projectDir = "$rootDir/openjdk" as File
project(':conscrypt-openjdk-uber').projectDir = "$rootDir/openjdk-uber" as File
project(':conscrypt-testing').projectDir = "$rootDir/testing" as File

enableFeaturePreview('STABLE_PUBLISHING')

0 comments on commit ebc029b

Please sign in to comment.