unbroken-dome / gradle-testsets-plugin

A plugin for the Gradle build system that allows specifying test sets (like integration or acceptance tests).
MIT License
230 stars 50 forks source link

Gradle 562 Deprecation warning #90

Closed marchc closed 5 years ago

marchc commented 5 years ago

Hi

We are getting the following warning using the atest version 2.2.0 with gradle 5.6.2 running under intelij

Configure project : Internal API constructor DefaultPolymorphicDomainObjectContainer(Class, Instantiator) has been deprecated. This is scheduled to be removed in Gradle 6.0. The ProjectLayout.configurableFiles() method has been deprecated. This is scheduled to be removed in Gradle 6.0. Please use the ObjectFactory.fileCollection() method instead. at build_7tqcqh2iulbtdjjnhaso0nq7s$_run_closure2$_closure6.doCall(/Users/chrismarch/dev/tt/travelthing-connectors/build.gradle:111) (Run with --stacktrace to get the full stack trace of this deprecation warning.)

We are using a simple configuration

testSets {
    integrationTest
}

The warning relates to the integrationTest line.

Is there a different way of describing the test set that is forward compatible?

The gradle build file: `

buildscript { repositories { jcenter() mavenCentral() maven { setUrl('https://plugins.gradle.org/m2/') } } dependencies { classpath 'com.github.fgiannesini.libsass.gradle.plugin:libsass-gradle-plugin:+' classpath 'org.apache.cxf.xjcplugins:cxf-xjc-javadoc:3.0.5' classpath 'org.jvnet.jaxb2_commons:jaxb2-basics:0.11.0' classpath 'org.jvnet.jaxb2_commons:jaxb2-fluent-api:3.0' classpath 'org.slf4j:slf4j-simple:1.7.22' // wsdl2java classpath group: 'no.nils', name: 'wsdl2java', version: '0.8' classpath group: 'javax.activation', name: 'activation', version: '1.1.1' classpath group: 'javax.jws', name: 'jsr181-api', version: '1.0-MR1' classpath group: 'javax.xml.bind', name: 'jaxb-api', version: '2.4.0-b180830.0359' classpath group: 'javax.xml.ws', name: 'jaxws-api', version: '2.3.1' classpath group: 'com.sun.xml.bind', name: 'jaxb-core', version: '2.3.0.1' classpath group: 'com.sun.xml.bind', name: 'jaxb-impl', version: '2.4.0-b180830.0438' classpath group: 'com.sun.xml.bind', name: 'jaxb-xjc', version: '2.4.0-b180830.0438' } }

plugins { id 'org.sonarqube' version '2.6.2' id 'org.unbroken-dome.test-sets' version '2.2.0' }

wrapper { gradleVersion = '5.6.2' }

subprojects { apply plugin: 'idea' apply plugin: 'java' apply plugin: 'maven-publish' apply plugin: 'org.unbroken-dome.test-sets'

setGroup('io.play')
setVersion('1.3.17.1')

repositories {
    mavenCentral()
    mavenLocal()
    maven {
        setUrl('http://archiva.tts.io/repository/internal/')
        credentials {
            username archivaUserName
            password archivaPassword
        }
    }
    maven {
        setUrl('http://archiva.tts.io/repository/public/')
        credentials {
            username archivaUserName
            password archivaPassword
        }
    }
}
configurations.all {
    resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}

ext {
    apacheCxfVersion = '3.3.0'
    commonsCollections4Version = '4.2'
    commonsIoVersion = '2.6'
    commonsLang3Version = '3.8.1'
    elasticSearchVersion = '7.1.1'
    hamcrestAllVersion = '1.3'
    hazelCastVersion = '3.12.2'
    httpclientVersion = '4.5.9'
    httpcoreVersion = '4.4.11'
    jacksonVersion = '2.9.9'
    javaxActivationVersion = '1.1.1'
    javaxAnnotationApiVersion = '1.3.2'
    javaxPersistenceApiVersion = '2.2'
    javaxValidationVersion = '2.0.1.Final'
    javaxXmlSoapApiVersion = '1.4.0'
    jaxbApiVersion = '2.4.0-b180830.0359'
    jaxbImplVersion = '2.4.0-b180830.0438'
    jaxwsApiVersion = '2.3.1'
    jetbrainsAnnotationsVersion = '17.0.0'
    jsr181ApiVersion = '1.0-MR1'
    junitJupiterEngineVersion = '5.5.1'
    logbackVersion = '1.2.3'
    lombokVersion = '1.18.8'
    netBytebuddyVersion = '1.9.6'
    slf4jVersion = '1.7.25'
    springDataCommonsVersion = '2.1.1.RELEASE'
    springDataCommonsCoreVersion = '1.4.1.RELEASE'
    springDataElasticVersion = '3.1.8.RELEASE'
    springVersion = '5.1.8.RELEASE'
    sunIstackCommonsRuntimeVersion = '3.0.7'
    sunXmlBindJaxbCoreVersion = '2.3.0.1'
    wsdl4jVersion='1.6.3'

}

testSets {
    integrationTest
}

dependencies {
    annotationProcessor group: 'org.projectlombok', name: 'lombok', version: lombokVersion, ext: 'jar'

    compile group: 'org.apache.httpcomponents', name: 'httpclient', version: httpclientVersion, ext: 'jar'
    compile group: 'org.apache.httpcomponents', name: 'httpcore', version: httpcoreVersion, ext: 'jar'
    compile group: 'org.apache.httpcomponents', name: 'fluent-hc', version: httpclientVersion, ext: 'jar'
    compile group: 'com.hazelcast', name: 'hazelcast', version: hazelCastVersion, ext: 'jar'

    compileOnly group: 'org.projectlombok', name: 'lombok', version: lombokVersion, ext: 'jar'

    testAnnotationProcessor group: 'org.projectlombok', name: 'lombok', version: lombokVersion, ext: 'jar'

    testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: junitJupiterEngineVersion
    testCompile group: 'org.springframework', name: 'spring-test', version: springVersion, ext: 'jar'

    testRuntime group: 'ch.qos.logback', name: 'logback-classic', version: logbackVersion, ext: 'jar'
    testRuntime group: 'ch.qos.logback', name: 'logback-core', version: logbackVersion, ext: 'jar'
    testRuntime group: 'com.sun.istack', name: 'istack-commons-runtime', version: sunIstackCommonsRuntimeVersion, ext: 'jar'
    testRuntime group: 'com.sun.xml.bind', name: 'jaxb-core', version: sunXmlBindJaxbCoreVersion, ext: 'jar'
    testRuntime group: 'com.sun.xml.bind', name: 'jaxb-impl', version: jaxbImplVersion, ext: 'jar'
    testRuntime group: 'com.sun.xml.bind', name: 'jaxb-xjc', version: jaxbImplVersion, ext: 'jar'
    testRuntime group: 'javax.activation', name: 'activation', version: javaxActivationVersion, ext: 'jar'
    testRuntime group: 'javax.persistence', name: 'javax.persistence-api', version: javaxPersistenceApiVersion, ext: 'jar'
    testRuntime group: 'net.bytebuddy', name: 'byte-buddy', version: netBytebuddyVersion, ext: 'jar'
    testRuntime group: 'org.slf4j', name: 'jcl-over-slf4j', version: slf4jVersion, ext: 'jar'
    testRuntime group: 'org.slf4j', name: 'log4j-over-slf4j', version: slf4jVersion, ext: 'jar'
    testRuntime group: 'org.springframework', name: 'spring-aop', version: springVersion, ext: 'jar'
    testRuntime group: 'org.springframework', name: 'spring-expression', version: springVersion, ext: 'jar'

    testCompileOnly group: 'org.projectlombok', name: 'lombok', version: lombokVersion, ext: 'jar'
}

sourceCompatibility = 11

jar {
    manifest.attributes provider: 'Travel Technology Systems Ltd'
    from sourceSets.main.output
}

tasks.withType(JavaCompile) {
    options.compilerArgs << "-Xlint:-unchecked" << "-Xlint:-deprecation"
}

tasks.withType(Test) {
    useJUnitPlatform()
}

task sourcesJar(type: Jar, dependsOn: classes) {
    from sourceSets.main.allSource
}

publishing() {
    publications {
        mavenJava(MavenPublication) {
            from components.java

            artifact sourcesJar {
                classifier = "sources"
            }

        }
    }
    repositories {
        maven {
            setUrl("http://archiva.tts.io/repository/${project.version.endsWith('-SNAPSHOT') ? 'snapshots' : 'internal'}" as Object)
            credentials {
                username archivaUserName
                password archivaPassword
            }
        }
    }
}

test {
    useJUnitPlatform()
    outputs.upToDateWhen {false}
}

}

`

tkrullmann commented 5 years ago

Hi, unfortunately there isn't a way to do this which would both be backward-compatible with Gradle 4 and forward-compatible with Gradle 6. Gradle 4 is still in widespread usage so I'm not quite willing to give up the compatibility yet. I'm considering to either create a fork that stays Gradle4-compatible, or to declare a version which is the last supported one for Gradle 4.

marchc commented 5 years ago

Hi No worries I understand, gradle 6 is a way off currently so not likely to create me problem in the short term.

Thanks for the response

simonbasle commented 4 years ago

@marchc @tkrullmann Gradle 6 is now in RC1 so it is probably not that way off. I would strongly consider implementing one of your two ideas @tkrullmann, as the improvements to dependency management in Gradle 6 will likely be a strong incentive for people to upgrade.

tkrullmann commented 4 years ago

Opened a new issue for this: #92

tkrullmann commented 4 years ago

Actually when I use the plugin with Gradle 6.0-rc-1, all the deprecations that were "scheduled to be removed in Gradle 6.0" are now "scheduled to be removed in Gradle 7.0" ;-)