defano / wyldcard

A clone of Apple's HyperCard and HyperTalk scripting language.
https://github.com/defano/wyldcard/wiki
MIT License
117 stars 12 forks source link

FIXED: Deprecated-To-Be "JacocoReportBase.setClassDirectories(FileCollection)" function in gradle build file #69

Closed Jimw338 closed 5 years ago

Jimw338 commented 5 years ago

I'm getting a deprecated error with: JacocoReportBase.setClassDirectories(FileCollection), with the recommendation to use" "getClassDirectories().from(...)" A Google turns up a similar error someone got (https://github.com/gradle/gradle/issues/7753). I changed the script as follows, replacing the "jacocoTestReport" block:

//
// ****** Deprecation error ******
// (Gradle 5.2.1, will be deprecated in 6.0)
// [jw 3/5/2019]
//
// *** ORIGINAL (works with Gradle 5.2.1):
/*
jacocoTestReport {
    afterEvaluate {
        classDirectories = files(classDirectories.files.collect {
            fileTree(dir: it, exclude: 'com/defano/hypertalk/parser/**')
        })
    }
}
*/

// *** Fix:

jacocoTestReport {
    afterEvaluate {
        getClassDirectories().setFrom(classDirectories.files.collect {
            fileTree(dir: it, exclude: 'com/defano/hypertalk/parser/**')
        })

//*     classDirectories = files(classDirectories.files.collect {
//*         fileTree(dir: it, exclude: 'com/defano/hypertalk/parser/**')
//*     })
    }
}

// ****** End of deprecation error fix ******