-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add support for android library plugin #305
Comments
Could you elaborate a bit on what you can and can't do with the current android support? I don't fully understand why this plugin needs to explicitly support these libraries. Can you not simply add this dependency yourself? Or do you need this plugin to recognise com.android.library as something that should be treated as an android plugin? Hopefully @ben-manes and @samskiter could offer an opinion on this too :) |
@joelittlejohn this is probably the same basic issue as #266 @yomik i guess you are receiving an error about the java plugin being incompatible with the android plugin. I imagine that this should be an easy fix for someone who knows more about the system. Looks as though it would just require an addition here: |
Is this something that every Gradle plugin has to go through? Something
|
im probably less familiar. are there any other ways to integrate other than as a plugin? |
I didn't realize that the Android stack has two plugins (library and application). As Sam said, its probably as simple as adding an OR condition to inspect for that plugin as well. I'd like to have a sample project like last time to verify with. Most Gradle plugins don't have this complexity with Android as they don't need to integrate into a compilation workflow. This is one of the few cases where Maven's phase model is easier than a task graph, because the code generation would always occur prior to the compiler plugin's execution. In Gradle, we need to setup the dependencies which due to Android's non-standard workflow adds complexity. We could of course make our users configure the DAG themselves, but that would annoy them and spam you with a lot of basic setup questions. If @yomik provided a sample project, perhaps by extending @samskiter's, this should be an easy task. |
Fantastic, thanks for the detailed explanation Ben.
|
Sorry, I should have given more details. @ben-manes I checked the official Android documentation (https://developer.android.com/tools/building/plugin-for-gradle.html) and apparently the library part is omitted. It is referenced in the (outdated) documentation : http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Library-projects but has the deprecated naming "android-library", which changed to "com.android.library" (this has been announced in the changelog of the Android gradle plugin at some time but I couldn't find it). @samskiter I'm getting the error "generateJsonSchema: Java or Android plugin required", thrown exactly where the link you gave points at. I believe the fix consists in adding "com.android.library" to the condition, with the same call to configureAndroid(). I will try to provide a sample project later. I realize that this is very confusing for a non-Android developer :/ |
#305 : Add android lib sample + Add support for android library plugin
@yomik Just checked up on this issue and I see that you have a branch with a sample and the fix. If it works, can you send a pull request? The changes lgtm except that I'd ask to keep it to 100c by indenting the second clause in the if statement. |
Oh, just found #311. Closing |
0.4.8 added support for Android gradle plugin (com.android.application).
However, it lacks support for Android libraries (com.android.library). It would be nice to have support for these as well.
The text was updated successfully, but these errors were encountered: