Annotation processor to help with the dagger-plugin project. This project is to be used exclusively with dagger-plugin
project.
@GenerateTest
directory
=> The root directory that contains the test case foldersexclude
=> List of directories to exclude in the annotation processing
@GenerateTest(directory = "inject", exclude = ["assets"])
abstract class InjectTestCase : BaseTestCase("inject")
testData
|_inject
|_assets
|_AbstractClass
|_AbstractClass.java
|_ConcreteClass.java
|_KSuccessComponent.kt
|_KFailureComponent.kt
|_FinalFields
|_ClassWithFinalField.java
|_ClassWithNonFinalField.java
|_KFailureComponent.kt
|_KSuccessComponent.kt
The above config will generate the following Test files under build/generated/source/kapt/test/...
directory:
package com.madrapps.dagger.inject
import com.madrapps.dagger.InjectTestCase
class AbstractClass : InjectTestCase() {
fun testKFailureComponent() = testValidation()
fun testConcreteClass() = testValidation()
fun testAbstractClass() = testValidation()
fun testKSuccessComponent() = testValidation()
}
package com.madrapps.dagger.inject
import com.madrapps.dagger.InjectTestCase
class FinalFields : InjectTestCase() {
fun testClassWithFinalField() = testValidation()
fun testKFailureComponent() = testValidation()
fun testKSuccessComponent() = testValidation()
fun testClassWithNonFinalField() = testValidation()
}