kt3k / coveralls-gradle-plugin

👨‍🔧 gradle plugin for coveralls
https://plugins.gradle.org/plugin/com.github.kt3k.coveralls
MIT License
253 stars 54 forks source link

Fix Android plugins not detected #25

Closed ksoichiro closed 10 years ago

ksoichiro commented 10 years ago

Hi, I’m developing some Android libraries and I'm using this plugin, but I have a problem.

gradle-android-plugin 0.13.x (released on this September) requires Gradle 2.1, so I thought that coveralls-gradle-plugin v2.0.0 (supports Gradle 2.x) will work… but it doesn’t:

:
No source file found on the project: “myProject"
With coverage file: /path/to/myProject/build/outputs/reports/coverage/debug/report.xml

The cause is 82ad4e27. This ignores Android plugins which are extending BasePlugin such as AppPlugin and LibraryPlugin.

// This code correctly handles subclasses of BasePlugin
project.plugins.withType(BasePlugin) {

// This doesn’t… this only see the plugin class EQUALS to the BasePlugin
project.plugins.matching { it.class.name == "com.android.build.gradle.BasePlugin" }.all {

I made a fix for this.

For Android App/Library projects,

kt3k commented 10 years ago

@ksoichiro Thank you very much for this!

I'll merge this for the moment. If you have time, I'd like you to write the test for this change.

Thanks!

kt3k commented 10 years ago

Deployed as v2.0.1. maven: http://search.maven.org/#artifactdetails%7Corg.kt3k.gradle.plugin%7Ccoveralls-gradle-plugin%7C2.0.1%7Cjar bintray: https://bintray.com/kt3k/gradle-plugins/coveralls-gradle-plugin/2.0.1/view

ksoichiro commented 10 years ago

@kt3k Thank you for merging and releasing!

I'll merge this for the moment. If you have time, I'd like you to write the test for this change.

Sorry for lacking of test codes, I'll write them in the near future.