Refactor dependencies to satisfy Android Studio's linter.

If an Android module depends on another module's default configuration, Android Studio's linter won't recognise references to classes in the other module. Instead, the Android module must depend on the other module without specifying a configuration. This entails some changes in the handling of transitive dependencies, and the other module must include its main classes in its testOutput artifact so the Android module's tests can use them.
This commit is contained in:
akwizgran
2022-11-29 13:30:04 +00:00
parent c855967d56
commit c16d0e8f45
13 changed files with 238 additions and 201 deletions

View File

@@ -40,8 +40,17 @@ configurations {
}
dependencies {
implementation project(path: ':bramble-core', configuration: 'default')
// To satisfy Android Studio's linter, an Android module that depends on another module must
// not specify which configuration of the other module it depends on. Therefore we don't
// inherit implementation dependencies of the other module and must declare any such
// dependencies we want to use.
implementation project(':bramble-api')
implementation project(':bramble-core')
implementation 'androidx.annotation:annotation:1.5.0'
implementation "org.briarproject:jtorctl:$jtorctl_version"
implementation "com.google.dagger:dagger:$dagger_version"
tor "org.briarproject:tor-android:$tor_version"
tor "org.briarproject:obfs4proxy-android:$obfs4proxy_version"
tor "org.briarproject:snowflake-android:$snowflake_version"
@@ -51,6 +60,7 @@ dependencies {
compileOnly 'javax.annotation:jsr250-api:1.0'
testImplementation project(path: ':bramble-api', configuration: 'testOutput')
testImplementation "junit:junit:$junit_version"
testImplementation "org.jmock:jmock:$jmock_version"
testImplementation "org.jmock:jmock-junit4:$jmock_version"