jojojames / flycheck-gradle

Flycheck extension for projects that use gradle
GNU General Public License v3.0
6 stars 4 forks source link

Update Kotlin compile commands #7

Closed DarrienG closed 6 years ago

DarrienG commented 6 years ago

Current compile commands don't work for me. These updated ones do.

$ gradle -version

------------------------------------------------------------
Gradle 4.10.1
------------------------------------------------------------

Build time:   2018-09-12 11:33:27 UTC
Revision:     76c9179ea9bddc32810f9125ad97c3315c544919

Kotlin DSL:   1.0-rc-6
Kotlin:       1.2.61
Groovy:       2.4.15
Ant:          Apache Ant(TM) version 1.9.11 compiled on March 23 2018
JVM:          10.0.2 (Oracle Corporation 10.0.2+13)
OS:           Linux 4.18.9-arch1-1-ARCH amd64
jojojames commented 6 years ago
Kotlin/ $ ./gradlew compileKotlin
Starting a Gradle Daemon (subsequent builds will be faster)

> Configure project :app 
Observed package id 'build-tools;20.0.0' in inconsistent location '/Applications/adt-bundle-mac-x86_64-20140702/sdk/build-tools/android-4.4W' (Expected '/Applications/adt-bundle-mac-x86_64-20140702/sdk/build-tools/20.0.0')
Observed package id 'build-tools;20.0.0' in inconsistent location '/Applications/adt-bundle-mac-x86_64-20140702/sdk/build-tools/android-4.4W' (Expected '/Applications/adt-bundle-mac-x86_64-20140702/sdk/build-tools/20.0.0')

FAILURE: Build failed with an exception.

* What went wrong:
Task 'compileKotlin' not found in root project 'Kotlin'.

* Try:
Run gradlew tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 7s
Kotlin/ $ ./gradlew compileReleaseKotlin

BUILD SUCCESSFUL in 1s
12 actionable tasks: 12 up-to-date
Kotlin/ $ ./gradlew -version

------------------------------------------------------------
Gradle 4.4-rc-3
------------------------------------------------------------

Build time:   2017-11-27 10:31:38 UTC
Revision:     340c20678da78bf34d58da72071f95bb60d037e9

Groovy:       2.4.12
Ant:          Apache Ant(TM) version 1.9.9 compiled on February 2 2017
JVM:          1.8.0_102 (Oracle Corporation 25.102-b14)
OS:           Mac OS X 10.12.6 x86_64

Kotlin/ $ 

Hmnn, not too familiar with the reason for the new target not being there. (Whether it's because it's a Kotlin + Android project or because the gradle version is older than yours.

DarrienG commented 6 years ago

I'm doing a pure Kotlin project, but you're doing an Android project. I just opened an Android project and compileReleaseKotlin is a very valid command.

The Android version of Gradle is 3.1.2 also.

So uh... If there's a way to add a conditional for Android projects vs standard Kotlin projects, that's probably the way to go.

jojojames commented 6 years ago

I'll merge this for now and try to set up a heuristic to switch between th two. Thanks.

Tangential, but I am slowly copying all of my flycheck extensions to flymake.

https://github.com/jojojames/flymake-gradle