Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Add sample projects #45

Merged
merged 3 commits into from
Aug 20, 2019
Merged

Add sample projects #45

merged 3 commits into from
Aug 20, 2019

Conversation

tasomaniac
Copy link
Collaborator

Added sample projects by using Gradle composite builds.

Composite builds is a very nice concept and is very helpful when it comes down using Gradle plugins in samples. It first builds the Pickle and makes it available in the sample project.

Composite builds automatically match the dependencies. In order to do this, Gradle Project's group and name properties should match. That's why I moved lib to pickle-lib etc and set group to com.fourlastor. Thanks to this consistency, Gradle can handle the rest.

Added sample for Kotlin and Java modules. First uses kapt and kaptAndroidTest. Java only uses androidTestAnnotationProcessor configuration.

Kotlin one currently fails with Collection is empty message. I investigated this. It turns out that it comes from the following line: https://github.com/fourlastor/pickle/blob/master/processor/src/main/java/com/fourlastor/pickle/Options.kt#L9 This means that the class with Pickle annotation is not recognized 😢

}

sourceSets {
androidTest.java.srcDir 'build/generated/source/pickle/androidTest/debug'
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So good news and bad news 🎉

I was able to solve the Kotlin issue with this change in the sample itself.

I also tried bunch of things including doing this automatically in the plugin (eventhough it would be hacky) but it didn't even work. The problem is with registerJavaGeneratingTask in the Plugin code. Somehow this is not picked up by Kotlin compiler.

@fourlastor fourlastor merged commit 520f352 into fourlastor:master Aug 20, 2019
@tasomaniac tasomaniac mentioned this pull request Oct 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants