gradle: Factor out dagger apt code into its own file

parent e1f31ad3
......@@ -6,6 +6,7 @@ apply plugin: 'ru.vyarus.animalsniffer'
apply plugin: 'idea'
apply plugin: 'witness'
apply from: 'witness.gradle'
apply from: '../gradle/dagger.gradle'
dependencies {
implementation project(path: ':bramble-api', configuration: 'default')
......@@ -32,21 +33,6 @@ dependencies {
signature 'org.codehaus.mojo.signature:java16:1.1@signature'
}
sourceSets.configureEach { sourceSet ->
tasks.named(sourceSet.compileJavaTaskName).configure {
options.annotationProcessorGeneratedSourcesDirectory = file("$buildDir/generated/source/apt/${sourceSet.name}")
}
}
idea {
module {
sourceDirs += compileJava.options.annotationProcessorGeneratedSourcesDirectory
generatedSourceDirs += compileJava.options.annotationProcessorGeneratedSourcesDirectory
testSourceDirs += compileTestJava.options.annotationProcessorGeneratedSourcesDirectory
generatedSourceDirs += compileTestJava.options.annotationProcessorGeneratedSourcesDirectory
}
}
// needed to make test output available to bramble-java
configurations {
testOutput.extendsFrom(testCompile)
......
......@@ -5,6 +5,7 @@ targetCompatibility = 1.8
apply plugin: 'idea'
apply plugin: 'witness'
apply from: 'witness.gradle'
apply from: '../gradle/dagger.gradle'
configurations {
tor
......@@ -32,21 +33,6 @@ dependencies {
testAnnotationProcessor 'com.google.dagger:dagger-compiler:2.19'
}
sourceSets.configureEach { sourceSet ->
tasks.named(sourceSet.compileJavaTaskName).configure {
options.annotationProcessorGeneratedSourcesDirectory = file("$buildDir/generated/source/apt/${sourceSet.name}")
}
}
idea {
module {
sourceDirs += compileJava.options.annotationProcessorGeneratedSourcesDirectory
generatedSourceDirs += compileJava.options.annotationProcessorGeneratedSourcesDirectory
testSourceDirs += compileTestJava.options.annotationProcessorGeneratedSourcesDirectory
generatedSourceDirs += compileTestJava.options.annotationProcessorGeneratedSourcesDirectory
}
}
def torBinariesDir = 'src/main/resources'
task unpackTorBinaries {
......
......@@ -6,6 +6,7 @@ apply plugin: 'ru.vyarus.animalsniffer'
apply plugin: 'idea'
apply plugin: 'witness'
apply from: 'witness.gradle'
apply from: '../gradle/dagger.gradle'
dependencies {
implementation project(path: ':briar-api', configuration: 'default')
......@@ -31,18 +32,3 @@ dependencies {
signature 'org.codehaus.mojo.signature:java16:1.1@signature'
}
sourceSets.configureEach { sourceSet ->
tasks.named(sourceSet.compileJavaTaskName).configure {
options.annotationProcessorGeneratedSourcesDirectory = file("$buildDir/generated/source/apt/${sourceSet.name}")
}
}
idea {
module {
sourceDirs += compileJava.options.annotationProcessorGeneratedSourcesDirectory
generatedSourceDirs += compileJava.options.annotationProcessorGeneratedSourcesDirectory
testSourceDirs += compileTestJava.options.annotationProcessorGeneratedSourcesDirectory
generatedSourceDirs += compileTestJava.options.annotationProcessorGeneratedSourcesDirectory
}
}
sourceSets.configureEach { sourceSet ->
tasks.named(sourceSet.compileJavaTaskName).configure {
options.annotationProcessorGeneratedSourcesDirectory = file("$buildDir/generated/source/apt/${sourceSet.name}")
}
}
idea {
module {
sourceDirs += compileJava.options.annotationProcessorGeneratedSourcesDirectory
generatedSourceDirs += compileJava.options.annotationProcessorGeneratedSourcesDirectory
testSourceDirs += compileTestJava.options.annotationProcessorGeneratedSourcesDirectory
generatedSourceDirs += compileTestJava.options.annotationProcessorGeneratedSourcesDirectory
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment