Scuilion / gradle-syntastic-plugin

A Gradle plugin for integrating your Java project with Vim and Syntastic.
47 stars 3 forks source link

Android support #8

Open vitorprado opened 8 years ago

vitorprado commented 8 years ago

Would be awesome if we can use this with android plugin.

Scuilion commented 8 years ago

Could you point me to an example project?

vitorprado commented 8 years ago

I need to use the Android application plugin apply plugin: 'com.android.application' instead of java plugin in gradle build file.

I think the project structure is the same when it's java only. Another problem I found here: syntastic can't found the dependencies, I don't know if it's working for java projects.

I create a workaround here, in my build file, to use temporary:

task("syntasticJars") << {
    def parsedItems = (new XmlParser()).parse('build/intermediates/dex-cache/cache.xml')
    def jarCollection = new HashSet<String>()
    parsedItems.item.each { item ->
        jarCollection.add(item.@jar)
    }

    def paths = jarCollection.collect().join(":")
    def output = new File(".syntastic_javac_config")
    output.write "let g:syntastic_java_javac_classpath = '" + paths + "'"
}

But my syntastic still missing the project classes. :/

Scuilion commented 8 years ago

I'm not familiar at all with the com.android.application plugin. This syntastic plugin relies on sourceSets to have been created and then extracts the classpath from those (main and test sourceSets in java and groovy projects).

Do you know where the classpath is store in an android project?

Nevermind, found it under project.android.sourceSets.