Skip to content

Commit

Permalink
Generating test files under different package
Browse files Browse the repository at this point in the history
  • Loading branch information
thsaravana committed May 20, 2020
1 parent 4c5e1ab commit 136bebf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

group 'com.madrapps'
version '1.0'
version '1.1'

repositories {
mavenCentral()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class DaggerProcessor : AbstractProcessor() {
roundEnv.getElementsAnnotatedWith(GenerateTest::class.java).forEach { element ->
if (element is Symbol.ClassSymbol) {
val ann: GenerateTest = element.getAnnotation(GenerateTest::class.java)
val packageName = element.owner.qualifiedName.toString()
val packageName = element.owner.qualifiedName.toString() + "." + ann.directory
val className = element.simpleName.toString()
val injectFile = File(testDateFile, ann.directory)

Expand All @@ -41,6 +41,8 @@ class DaggerProcessor : AbstractProcessor() {
"""
package $packageName
import com.madrapps.dagger.$className
class $testClassName : $className() {
${getTestMethods(folder)}
}
Expand Down

0 comments on commit 136bebf

Please sign in to comment.