Skip to content
This repository has been archived by the owner on Jan 25, 2021. It is now read-only.

Commit

Permalink
Merge branch 'gradle' into develop
Browse files Browse the repository at this point in the history
# Conflicts:
#	build.gradle

Fix build with gradle 4.6 and latest android sdk
  • Loading branch information
dcendents committed Mar 23, 2018
2 parents f695264 + 4b62387 commit 6b1454b
Show file tree
Hide file tree
Showing 16 changed files with 384 additions and 91 deletions.
209 changes: 171 additions & 38 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ repositories {
}

ext {
gradleVersions = '4.1,4.2,4.2.1,4.3,4.3.1,4.4,4.4.1,4.5,4.5.1'
androidGradleBuildVersion = '3.0.0-beta3'
androidCompileSdkVersion = 'android-26'
androidBuildToolsVersion = '26.0.1'
gradleVersions = '4.6'
androidGradleBuildVersion = '3.0.1'
androidCompileSdkVersion = 'android-27'
androidBuildToolsVersion = '27.0.3'
}

configurations {
Expand Down Expand Up @@ -48,46 +48,179 @@ task createClasspathManifest {
}

ext {
versions = [:]
libraries = [:]
testLibraries = [:]
}

versions.commons_io = '2.2'
versions.groovy = "2.4.12"
versions.maven = "3.0.4"
versions.findbugs = "2.0.1"
// from gradle/gradle/dependencies.gradle
libraries.aether_connector = [coordinates: 'org.sonatype.aether:aether-connector-wagon', version: '1.13.1']
libraries.ant = [coordinates: 'org.apache.ant:ant', version: '1.9.9']
libraries.asm = [coordinates: 'org.ow2.asm:asm', version: '6.0']
libraries.asm_commons = [coordinates: 'org.ow2.asm:asm-commons', version: libraries.asm.version]
libraries.asm_tree = [coordinates: 'org.ow2.asm:asm-tree', version: libraries.asm.version]
libraries.asm_util = [coordinates: 'org.ow2.asm:asm-util', version: libraries.asm.version]
libraries.asm_analysis = [coordinates: 'org.ow2.asm:asm-analysis', version: libraries.asm.version]
libraries.awsS3_core = [coordinates: 'com.amazonaws:aws-java-sdk-core', version: '1.11.267']
libraries.awsS3_s3 = [coordinates: 'com.amazonaws:aws-java-sdk-s3', version: libraries.awsS3_core.version]
libraries.awsS3_kms = [coordinates: 'com.amazonaws:aws-java-sdk-kms', version: libraries.awsS3_core.version]
libraries.bouncycastle_provider = [coordinates: 'org.bouncycastle:bcprov-jdk15on', version: '1.58']
libraries.bouncycastle_pgp = [coordinates: 'org.bouncycastle:bcpg-jdk15on', version: libraries.bouncycastle_provider.version]
libraries.bndlib = [coordinates: 'biz.aQute.bnd:biz.aQute.bndlib', version: '3.4.0']
libraries.bsh = [coordinates: 'org.apache-extras.beanshell:bsh', version: '2.0b6']
libraries.commons_cli = [coordinates: 'commons-cli:commons-cli', version: '1.2']
libraries.commons_codec = [coordinates: 'commons-codec:commons-codec', version: '1.10']
libraries.commons_collections = [coordinates: 'commons-collections:commons-collections', version: '3.2.2']
libraries.commons_compress = [coordinates: 'org.apache.commons:commons-compress', version: '1.14']
libraries.commons_httpclient = [coordinates: 'org.apache.httpcomponents:httpclient', version: '4.5.5']
libraries.commons_io = [coordinates: 'commons-io:commons-io', version: '2.4']
libraries.commons_lang = [coordinates: 'commons-lang:commons-lang', version: '2.6']
libraries.fastutil = [coordinates: 'it.unimi.dsi:fastutil', version: '7.2.1']
libraries.gcs = [coordinates: 'com.google.apis:google-api-services-storage', version: 'v1-rev116-1.23.0']
libraries.groovy = [coordinates: 'org.codehaus.groovy:groovy-all', version: '2.4.12']
libraries.gson = [coordinates: 'com.google.code.gson:gson', version: '2.7']
libraries.guava = [coordinates: 'com.google.guava:guava-jdk5', version: '17.0']
libraries.inject = [coordinates: 'javax.inject:javax.inject', version: '1']
libraries.ivy = [coordinates: 'org.apache.ivy:ivy', version: '2.2.0']
libraries.jackson_core = [coordinates: 'com.fasterxml.jackson.core:jackson-core', version: '2.8.11']
libraries.jackson_annotations = [coordinates: 'com.fasterxml.jackson.core:jackson-annotations', version: libraries.jackson_core.version]
libraries.jackson_databind = [coordinates: 'com.fasterxml.jackson.core:jackson-databind', version: libraries.jackson_core.version]
libraries.jansi = [coordinates: 'org.fusesource.jansi:jansi', version: '1.14']
libraries.jatl = [coordinates: 'com.googlecode.jatl:jatl', version: '0.2.2']
libraries.jcifs = [coordinates: 'org.samba.jcifs:jcifs', version: '1.3.17']
libraries.jcip = [coordinates: 'net.jcip:jcip-annotations', version: '1.0']
libraries.jgit = [coordinates: 'org.eclipse.jgit:org.eclipse.jgit', version: '4.5.3.201708160445-r', because: '4.6+ requires Java 8']
libraries.joda = [coordinates: 'joda-time:joda-time', version: '2.8.2']
libraries.jsch = [coordinates: 'com.jcraft:jsch', version: '0.1.54']
libraries.jsr305 = [coordinates: 'com.google.code.findbugs:jsr305', version: '2.0.1']
libraries.junit = [coordinates: 'junit:junit', version: '4.12']
libraries.junitPlatform = [coordinates: 'org.junit.platform:junit-platform-launcher', version: '1.0.3']
libraries.kryo = [coordinates: 'com.esotericsoftware.kryo:kryo', version: '2.20']
libraries.maven3 = [coordinates: 'org.apache.maven:maven-core', version: '3.0.4']
libraries.maven3_wagon_file = [coordinates: 'org.apache.maven.wagon:wagon-file', version: '2.4']
libraries.maven3_wagon_http = [coordinates: 'org.apache.maven.wagon:wagon-http', version: libraries.maven3_wagon_file.version]
libraries.nativePlatform = [coordinates: 'net.rubygrapefruit:native-platform', version: '0.14']
libraries.nekohtml = [coordinates: 'net.sourceforge.nekohtml:nekohtml', version: '1.9.20']
libraries.objenesis = [coordinates: 'org.objenesis:objenesis', version: '1.2']
libraries.plexus_container = [coordinates: 'org.codehaus.plexus:plexus-container-default', version: '1.5.5']
libraries.plist = [coordinates: 'com.googlecode.plist:dd-plist', version: '1.20', because: 'for XCode IDE integration support']
libraries.pmaven_common = [coordinates: 'org.sonatype.pmaven:pmaven-common', version: '0.8-20100325']
libraries.pmaven_groovy = [coordinates: 'org.sonatype.pmaven:pmaven-groovy', version: libraries.pmaven_common.version]
libraries.rhino = [coordinates: 'org.mozilla:rhino', version: '1.7R3']
libraries.simple = [coordinates: 'org.simpleframework:simple', version: '4.1.21']
libraries.testng = [coordinates: 'org.testng:testng', version: '6.3.1']
libraries.xerces = [coordinates: 'xerces:xercesImpl', version: '2.11.0']
libraries.xmlApis = [coordinates: 'xml-apis:xml-apis', version: '1.4.01', because: '2.0.x has a POM with relocation Gradle does not handle well']
libraries.slf4j_api = [coordinates: 'org.slf4j:slf4j-api', version: '1.7.16']
libraries.jcl_to_slf4j = [coordinates: 'org.slf4j:jcl-over-slf4j', version: libraries.slf4j_api.version]
libraries.jul_to_slf4j = [coordinates: 'org.slf4j:jul-to-slf4j', version: libraries.slf4j_api.version]
libraries.log4j_to_slf4j = [coordinates: 'org.slf4j:log4j-over-slf4j', version: libraries.slf4j_api.version]

// these are transitive dependencies that are part of the Gradle distribution
libraries.jetbrains_annotations = [coordinates: 'org.jetbrains:annotations', version: '13.0']
libraries.ant_launcher = [coordinates: 'org.apache.ant:ant-launcher', version: libraries.ant.version]
libraries.asm_util = [coordinates: 'org.ow2.asm:asm-util', version: libraries.asm.version]
libraries.minlog = [coordinates: 'com.esotericsoftware.minlog:minlog', version: '1.2']
libraries.aether_api = [coordinates: 'org.sonatype.aether:aether-api', version: libraries.aether_connector.version]
libraries.aether_impl = [coordinates: 'org.sonatype.aether:aether-impl', version: libraries.aether_connector.version]
libraries.aether_spi = [coordinates: 'org.sonatype.aether:aether-spi', version: libraries.aether_connector.version]
libraries.aether_util = [coordinates: 'org.sonatype.aether:aether-util', version: libraries.aether_connector.version]
libraries.google_api_client = [coordinates: 'com.google.api-client:google-api-client', version: '1.23.0']
libraries.google_http_client = [coordinates: 'com.google.http-client:google-http-client', version: '1.23.0']
libraries.google_http_client_jackson2 = [coordinates: 'com.google.http-client:google-http-client-jackson2', version: '1.23.0']
libraries.google_oauth_client = [coordinates: 'com.google.oauth-client:google-oauth-client', version: '1.23.0']
libraries.hamcrest = [coordinates: 'org.hamcrest:hamcrest-core', version: '1.3']
libraries.httpcore = [coordinates: 'org.apache.httpcomponents:httpcore', version: '4.4.9']
libraries.jcommander = [coordinates: 'com.beust:jcommander', version: '1.47']
libraries.maven3_aether_provider = [coordinates: 'org.apache.maven:maven-aether-provider', version: libraries.maven3.version]
libraries.maven3_artifact = [coordinates: 'org.apache.maven:maven-artifact', version: libraries.maven3.version]
libraries.maven3_compat = [coordinates: 'org.apache.maven:maven-compat', version: libraries.maven3.version]
libraries.maven3_model = [coordinates: 'org.apache.maven:maven-model', version: libraries.maven3.version]
libraries.maven3_model_builder = [coordinates: 'org.apache.maven:maven-model-builder', version: libraries.maven3.version]
libraries.maven3_plugin_api = [coordinates: 'org.apache.maven:maven-plugin-api', version: libraries.maven3.version]
libraries.maven3_repository_metadata = [coordinates: 'org.apache.maven:maven-repository-metadata', version: libraries.maven3.version]
libraries.maven3_settings = [coordinates: 'org.apache.maven:maven-settings', version: libraries.maven3.version]
libraries.maven3_settings_builder = [coordinates: 'org.apache.maven:maven-settings-builder', version: libraries.maven3.version]
libraries.plexus_cipher = [coordinates: 'org.sonatype.plexus:plexus-cipher', version: '1.7']
libraries.plexus_classworlds = [coordinates: 'org.codehaus.plexus:plexus-classworlds', version: '2.4']
libraries.plexus_component_annotations = [coordinates: 'org.codehaus.plexus:plexus-component-annotations', version: '1.5.5']
libraries.plexus_interpolation = [coordinates: 'org.codehaus.plexus:plexus-interpolation', version: '1.14']
libraries.plexus_sec_dispatcher = [coordinates: 'org.codehaus.plexus:plexus-sec-dispatcher', version: '1.3']
libraries.plexus_utils = [coordinates: 'org.codehaus.plexus:plexus-utils', version: '3.0.8']
libraries.snakeyaml = [coordinates: 'org.yaml:snakeyaml:1.6', version: '1.6'] //added by testng, could be avoided with newer TestNG version
libraries.maven3_wagon_http_shared4 = [coordinates: 'org.apache.maven.wagon:wagon-http-shared4', version: libraries.maven3_wagon_file.version]
libraries.maven3_wagon_provider_api = [coordinates: 'org.apache.maven.wagon:wagon-provider-api', version: libraries.maven3_wagon_file.version]
libraries.xbean_reflect = [coordinates: 'org.apache.xbean:xbean-reflect', version: '3.4']

// from gradle/gradle/testDependencies.gradle
testLibraries.spock = 'org.spockframework:spock-core:1.0-groovy-2.4'
testLibraries.jsoup = 'org.jsoup:jsoup:1.6.3'
testLibraries.xmlunit = 'xmlunit:xmlunit:1.3'
testLibraries.jetty = 'org.mortbay.jetty:jetty:6.1.26'
testLibraries.sshd = 'org.apache.sshd:sshd-core:1.2.0'
testLibraries.jmock = [
'org.hamcrest:hamcrest-core',
'org.hamcrest:hamcrest-library:1.3',
'org.jmock:jmock:2.5.1',
'org.jmock:jmock-junit4:2.5.1',
'org.jmock:jmock-legacy:2.5.1'
]

dependencies {
jacocoRuntime "org.jacoco:org.jacoco.agent:${jacoco.toolVersion}:runtime"

compile gradleApi()

// from gradle/gradle/dependencies.gradle
compileOnly "org.apache.maven:maven-core:${versions.maven}"

testRuntime files(createClasspathManifest)

testCompile('org.spockframework:spock-core:1.0-groovy-2.4') {
exclude module: 'groovy-all'
// from gradle/subprojects/distributions-dependencies/distributions-dependencies.gradle
constraints {
libraries.values().each { lib ->
compile(lib.coordinates) {
version {
strictly lib.version
if (lib.because) { because lib.because }
}
}
}
}

testCompile 'junit:junit:4.12',
'org.hamcrest:hamcrest-all:1.3',
"org.codehaus.groovy:groovy-all:${versions.groovy}"

// from gradle/subprojects/core/core.gradle, gradle/subprojects/internal-testing/internal-testing.gradle and gradle/gradle/dependencies.gradle
testCompile "commons-io:commons-io:${versions.commons_io}",
'commons-lang:commons-lang:2.6',
'org.objenesis:objenesis:1.2',
'cglib:cglib:3.2.5',
'org.jmock:jmock:2.5.1',
dependencies.create('org.jmock:jmock-junit4:2.5.1') { exclude group: 'junit', module: 'junit-dep' }, //junit-dep pulls old definitions of core junit types.
'org.jmock:jmock-legacy:2.5.1',
'com.google.guava:guava-jdk5:17.0',
'org.jsoup:jsoup:1.6.3',
"com.google.code.findbugs:findbugs:${versions.findbugs}",
'org.ow2.asm:asm:6.0'
testCompile 'org.apache.ivy:ivy:2.2.0'
testCompile 'org.apache.ant:ant:1.9.9'
// from gradle/subprojects/maven/maven.gradle
compileOnly libraries.groovy.coordinates
compileOnly libraries.slf4j_api.coordinates

compileOnly libraries.maven3.coordinates
compileOnly libraries.pmaven_common.coordinates
compileOnly libraries.pmaven_groovy.coordinates

//implementation libraries.maven3_wagon_file.coordinates
//implementation libraries.maven3_wagon_http.coordinates
//implementation libraries.plexus_container.coordinates
//implementation libraries.aether_connector.coordinates

testRuntime files(createClasspathManifest)

testCompile testLibraries.spock

// from gradle/subprojects/core/core.gradle
//testCompile libraries.asm.coordinates
//testCompile libraries.asm_commons.coordinates
//testCompile libraries.slf4j_api.coordinates
//testCompile libraries.commons_collections.coordinates
//testCompile libraries.commons_io.coordinates
testCompile libraries.commons_lang.coordinates
//testCompile libraries.jcip.coordinates
//testCompile libraries.nativePlatform.coordinates
//testCompile libraries.commons_compress.coordinates
//testCompile libraries.xmlApis.coordinates

// from gradle/subprojects/internal-testing/internal-testing.gradle
//testCompile libraries.slf4j_api.coordinates
testCompile libraries.guava.coordinates
//testCompile libraries.commons_lang.coordinates
testCompile libraries.commons_io.coordinates
testCompile libraries.ant.coordinates
testCompile libraries.asm.coordinates
//testCompile libraries.asm_tree.coordinates
//testCompile libraries.junit.coordinates
testCompile testLibraries.jmock
//testCompile testLibraries.spock
testCompile testLibraries.jsoup
}

sourceCompatibility = 1.6
Expand Down Expand Up @@ -174,7 +307,7 @@ pluginBundle {
}

jacoco {
toolVersion = "0.7.7.201606060606"
toolVersion = "0.8.0"
}

jacocoTestReport {
Expand All @@ -190,7 +323,7 @@ jacocoTestReport.dependsOn test
check.dependsOn jacocoTestReport

task wrapper(type: Wrapper) {
gradleVersion = '4.5'
gradleVersion = '4.6'
distributionUrl = "https://services.gradle.org/distributions/gradle-${gradleVersion}-all.zip"
}

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.6-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.5-all.zip
3 changes: 2 additions & 1 deletion src/main/java/org/gradle/api/plugins/AndroidMavenPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import org.gradle.api.publication.maven.internal.MavenFactory;
import org.gradle.api.tasks.Upload;
import org.gradle.configuration.project.ProjectConfigurationActionContainer;
import org.gradle.internal.Describables;
import org.gradle.internal.Factory;
import org.gradle.internal.logging.LoggingManagerInternal;

Expand Down Expand Up @@ -181,7 +182,7 @@ public void execute(Project project) {
pom.getArtifactId().equals(MavenProject.EMPTY_PROJECT_ARTIFACT_ID) ? module.getName() : pom.getArtifactId(),
pom.getVersion().equals(MavenProject.EMPTY_PROJECT_VERSION) ? module.getVersion() : pom.getVersion()
);
publicationRegistry.registerPublication(project.getPath(), new DefaultProjectPublication(publicationId));
publicationRegistry.registerPublication(project.getPath(), new DefaultProjectPublication(Describables.withTypeAndName("Maven repository", resolver.getName()), publicationId, true));
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@

package org.gradle.api.tasks

import org.gradle.api.file.FileCollection
import org.gradle.api.internal.AbstractTask
import org.gradle.api.internal.TaskInternal
import org.gradle.api.internal.file.CompositeFileCollection
import org.gradle.api.internal.file.collections.FileCollectionResolveContext
import org.gradle.api.internal.tasks.TaskPropertyUtils
import org.gradle.api.internal.tasks.properties.GetInputFilesVisitor
import org.gradle.api.internal.tasks.properties.GetInputPropertiesVisitor
import org.gradle.api.internal.tasks.properties.PropertyWalker

Expand All @@ -33,4 +37,23 @@ class TaskPropertyTestUtils {
//noinspection ConstantConditions
return visitor.getPropertyValuesFactory().create();
}

static FileCollection getInputFiles(AbstractTask task) {
GetInputFilesVisitor visitor = new GetInputFilesVisitor()
def walker = task.getServices().get(PropertyWalker)
TaskPropertyUtils.visitProperties(walker, task, visitor)
return new CompositeFileCollection() {
@Override
String getDisplayName() {
return task + " input files"
}

@Override
void visitContents(FileCollectionResolveContext context) {
for (def filePropertySpec : visitor.fileProperties) {
context.add(filePropertySpec.getPropertyFiles())
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@

package org.gradle.cache.internal;

import com.google.common.base.Throwables;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import com.google.common.util.concurrent.UncheckedExecutionException;
import org.gradle.api.internal.file.TestFiles;
import org.gradle.internal.serialize.Serializer;

Expand All @@ -25,9 +30,20 @@ public class TestFileContentCacheFactory implements FileContentCacheFactory {
@Override
public <V> FileContentCache<V> newCache(String name, int normalizedCacheSize, final Calculator<? extends V> calculator, Serializer<V> serializer) {
return new FileContentCache<V>() {
LoadingCache<File, V> cache = CacheBuilder.newBuilder().build(new CacheLoader<File, V>() {
@Override
public V load(File file) throws Exception {
return calculator.calculate(file, TestFiles.fileSystem().stat(file).getType());
}
});

@Override
public V get(File file) {
return calculator.calculate(file, TestFiles.fileSystem().stat(file).getType());
try {
return cache.getUnchecked(file);
} catch (UncheckedExecutionException e) {
throw Throwables.propagate(e.getCause());
}
}
};
}
Expand Down
Loading

0 comments on commit 6b1454b

Please sign in to comment.