gradle-syntastic-plugin icon indicating copy to clipboard operation
gradle-syntastic-plugin copied to clipboard

Android support

Open vitorprado opened this issue 9 years ago • 3 comments

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

vitorprado avatar Nov 10 '15 19:11 vitorprado

Could you point me to an example project?

Scuilion avatar Nov 10 '15 21:11 Scuilion

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. :/

vitorprado avatar Nov 11 '15 12:11 vitorprado

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.

Scuilion avatar Nov 13 '15 02:11 Scuilion