Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with the kaptKotlin directory #1

Closed
StefMa opened this issue Mar 29, 2018 · 1 comment
Closed

Issue with the kaptKotlin directory #1

StefMa opened this issue Mar 29, 2018 · 1 comment

Comments

@StefMa
Copy link
Owner

StefMa commented Mar 29, 2018

See 7d5038f

The kaptKotlin directoy (in build/generated/source/) is not set as a sourceSet.
But the kapt directory (also in build/generated/source/) is set as a sourceSet.

I don't know it is a kapt issue or what.. So investiage why that is like it is.
(Would also be helpful if we can check how it is generated in pure java/kotlin projects).

AC:

  • Either remove the workaround
  • Or remove the todo because it works correctly...
@StefMa
Copy link
Owner Author

StefMa commented Apr 5, 2018

This is fixed in a743ab0 (#11)
It's moved to the kaptKotlin dir.
But for now Android users have to add these config:

// Add the generated source as sourceSet
android.applicationVariants.all { variant ->
    variant.addJavaSourceFoldersToModel()
    def kotlinGenerated = file("$buildDir/generated/source/kaptKotlin/${variant.name}")
    variant.addJavaSourceFoldersToModel(kotlinGenerated)
}

and plain kotlin users this one (if sourceSet is main):

// Add generated kapt source code to main sourceSet
java.sourceSets {
    getByName("main") {
        java.srcDir("$buildDir/generated/source/kaptKotlin")
    }
}

@StefMa StefMa closed this as completed Apr 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant