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

1.15.0 can't find task w/ name "check" #65

Closed
kenyee opened this issue Jul 23, 2018 · 4 comments
Closed

1.15.0 can't find task w/ name "check" #65

kenyee opened this issue Jul 23, 2018 · 4 comments

Comments

@kenyee
Copy link

kenyee commented Jul 23, 2018

plugins {
id 'org.jmailen.kotlinter' version '1.15.0'
}
in the root gradle (not the app gradle) file causes this error

* What went wrong:
An exception occurred applying plugin request [id: 'org.jmailen.kotlinter', version: '1.15.0']
> Failed to apply plugin [id 'org.jmailen.kotlinter']
   > Task with name 'check' not found in root project 'android'.

1.14.0 didn't have a problem.
We do have flavors and build types.
Switching back to 1.14.0, gradle tasks does show the "check" task:

Verification tasks
------------------
check - Runs all checks.
connectedAndroidTest - Installs and runs instrumentation tests for all flavors on connected devices.
@jeremymailen
Copy link
Owner

Thanks for the report and sorry for the trouble. I'll look into it ASAP.

jeremymailen pushed a commit that referenced this issue Jul 25, 2018
If you accidentally apply the kotlinter plugin to a gradle module which is not an android or kotlin-jvm module you'll get an error when it tries to create the parent tasks and make the non-existent `check` task depend on them.
See #65
@jeremymailen
Copy link
Owner

In the prior version was that configuration actually linting any of your source code? For a multi-module android project I believe the correct way to configure the plugin is similar to the android plugin itself:

In the root build.gradle

buildscript {
    repositories {
        ...
        maven {
            url "https://plugins.gradle.org/m2/"
        }
    }
    dependencies {
        classpath 'gradle.plugin.org.jmailen.gradle:kotlinter-gradle:1.15.0'
     }
}

In each module which has kotlin source code and applies either the kotlin-android or org.jetbrains.kotlin.jvm plugins:

apply plugin: 'org.jmailen.kotlinter'

It does look like I've accidentally removed the safeguards that prevent the creation of the parent tasks from blowing up if there is no check (or source code) in the current module. I'll fix it in 1.15.1

jeremymailen added a commit that referenced this issue Jul 25, 2018
* Safeguard plugin applying code to only support module types

If you accidentally apply the kotlinter plugin to a gradle module which is not an android or kotlin-jvm module you'll get an error when it tries to create the parent tasks and make the non-existent `check` task depend on them.
See #65

* update README.md
@jeremymailen
Copy link
Owner

Failure fixed in 1.15.1 and documentation added: https://github.com/jeremymailen/kotlinter-gradle#multi-module-and-android

@kenyee
Copy link
Author

kenyee commented Jul 25, 2018

"It does look like I've accidentally removed the safeguards that prevent the creation of the parent tasks from blowing up if there is no check (or source code) in the current module"

That explains why I never saw any warnings from it but Detekt flagged stuff 😂

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

2 participants