Switch from "compile" to "implementation" in gradle dependencies

compile/testCompile has been deprecated for a long time, and will be
removed in the next major version of gradle.
This commit is contained in:
Ben Gruver 2021-03-01 14:10:15 -08:00
parent ecd68918ac
commit 53b52f023d
5 changed files with 31 additions and 29 deletions

View File

@ -39,13 +39,14 @@ buildscript {
} }
dependencies { dependencies {
compile project(':util') implementation project(':util')
compile project(':dexlib2') implementation project(':dexlib2')
compile depends.guava implementation depends.guava
compile depends.jcommander implementation depends.jcommander
testCompile depends.junit testImplementation depends.junit
testCompile project(':smali') testImplementation project(':smali')
testImplementation depends.antlr_runtime
} }
processResources.inputs.property('version', version) processResources.inputs.property('version', version)
@ -54,7 +55,7 @@ processResources.expand('version': version)
// Build a separate jar that contains all dependencies // Build a separate jar that contains all dependencies
task fatJar(type: Jar) { task fatJar(type: Jar) {
from sourceSets.main.output from sourceSets.main.output
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
classifier = 'fat' classifier = 'fat'

View File

@ -30,10 +30,10 @@
*/ */
dependencies { dependencies {
compile project(':util') implementation project(':util')
compile 'com.google.code.findbugs:jsr305:1.3.9' implementation 'com.google.code.findbugs:jsr305:1.3.9'
compile 'com.google.guava:guava:13.0.1' implementation 'com.google.guava:guava:13.0.1'
compile 'org.antlr:ST4:4.0.7' implementation 'org.antlr:ST4:4.0.7'
testCompile 'junit:junit:4.6' testImplementation 'junit:junit:4.6'
} }

View File

@ -46,11 +46,11 @@ configurations {
} }
dependencies { dependencies {
compile depends.findbugs implementation depends.findbugs
compile depends.guava implementation depends.guava
testCompile depends.junit testImplementation depends.junit
testCompile depends.mockito testImplementation depends.mockito
accessorTestGenerator project('accessorTestGenerator') accessorTestGenerator project('accessorTestGenerator')

View File

@ -45,7 +45,7 @@ buildscript {
configurations { configurations {
// Remove the full antlr library that's added by the antlr plugin. We manually // Remove the full antlr library that's added by the antlr plugin. We manually
// add the smaller antlr_runtime library instead // add the smaller antlr_runtime library instead
compile.exclude group: 'org.antlr', module: 'antlr' implementation.exclude group: 'org.antlr', module: 'antlr'
} }
sourceSets { sourceSets {
@ -73,13 +73,14 @@ idea {
} }
dependencies { dependencies {
compile project(':util') implementation project(':util')
compile project(':dexlib2') implementation project(':dexlib2')
compile depends.antlr_runtime implementation depends.antlr_runtime
compile depends.jcommander implementation depends.jcommander
compile depends.stringtemplate implementation depends.stringtemplate
implementation depends.guava
testCompile depends.junit testImplementation depends.junit
antlr depends.antlr antlr depends.antlr
} }
@ -90,7 +91,7 @@ processResources.expand('version': version)
// Build a separate jar that contains all dependencies // Build a separate jar that contains all dependencies
task fatJar(type: Jar, dependsOn: jar) { task fatJar(type: Jar, dependsOn: jar) {
from sourceSets.main.output from sourceSets.main.output
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
classifier = 'fat' classifier = 'fat'

View File

@ -30,11 +30,11 @@
*/ */
dependencies { dependencies {
compile project(':dexlib2') implementation project(':dexlib2')
compile depends.findbugs implementation depends.findbugs
compile depends.guava implementation depends.guava
compile depends.jcommander implementation depends.jcommander
testCompile depends.junit testImplementation depends.junit
} }
uploadArchives { uploadArchives {