gradle-clojure icon indicating copy to clipboard operation
gradle-clojure copied to clipboard

Support for multiple source sets...

Open jszakmeister opened this issue 8 years ago • 8 comments

It appears that gradle-clojure only has support for the main and test source sets, but it would be nice to support other source sets too. Unfortunately, I'm not sure how to integrate such functionality into the plugin... and the Gradle docs aren't helping much either. :-( Several plugins implement this ability (the antlr, groovy, and scala plugins), so there's some scheme for doing it. It's just not clear what that scheme is.

FWIW, we need to split our application into several pieces to make sure things get compiled in the right order, and this would help in that endeavor.

jszakmeister avatar Nov 10 '16 19:11 jszakmeister

Ok, that sounds reasonable. What sort of support would you want? Just that it would compile etc from other source sets too? I'll check out the other plugins to see what they do with them.

cursive-ide avatar Nov 10 '16 20:11 cursive-ide

The typical methodology seems to involve creating tasks for the individual source sets. The hope here would be to do the same for Clojure, which would allow us to do things like:

compileSomeSourceSetClojure.dependsOn compileSomeOtherSourceSetClojure

I was trying to dig into other plugins to see how they implement such functionality, but it's not very clear how it works. :-(

jszakmeister avatar Nov 10 '16 20:11 jszakmeister

Oh, and also allowing customization of the source sets. For example,

sourceSets {
    equipment {
        clojure {
            compileClasspath += main.output
            runtimeClasspath += main.output
        }

        java {
            compileClasspath += main.output
            runtimeClasspath += main.output
        }
    }
}

jszakmeister avatar Nov 10 '16 20:11 jszakmeister

@jszakmeister I have implemented a POC for multiple source sets in PR #12.

Please, do let me know if you have any suggestions.

pbzdyl avatar Nov 25 '16 21:11 pbzdyl

I'm definitely interested in this... I'll check it out.

jszakmeister avatar Nov 26 '16 14:11 jszakmeister

I'm sorry I haven't gotten around to trying this yet. I'm hoping I get a chance to this weekend.

jszakmeister avatar Dec 09 '16 15:12 jszakmeister

Similarly, my apologies for not having reviewed this yet - I was at the conj and am also travelling with my family.

cursive-ide avatar Dec 09 '16 15:12 cursive-ide

@jszakmeister, @cursive-ide No worries. Let me know if you have any issues or questions when you get to it.

pbzdyl avatar Dec 09 '16 15:12 pbzdyl