Skip to content
This repository has been archived by the owner on Jul 17, 2022. It is now read-only.

SourceSets syntax for javascript is inconsistent with other languages #57

Open
jamiefolson opened this issue Feb 17, 2013 · 2 comments
Open

Comments

@jamiefolson
Copy link

Other language plugins (e.g. Java, Groovy and Scala) create and or modify project.sourceSets, which allows the gradle DSL to be consistent across different languages. It would be great if the javascript source sets were consistent with the other languages in this respect.

Desirable example: specifying LESS and javascript sources

sourceSets {
    main {
        javascript {
            exclude "*.min.js"
        }
        less {
            exclude "_*"
        }
    }
}
@eriwen
Copy link
Owner

eriwen commented Feb 17, 2013

Makes sense to me. I'll investigate why this is. Thanks.

@jamiefolson
Copy link
Author

FYI, I did some looking and the DefaultSourceSetsContainer instantiates DefaultSourceSets, which kind of assume a jvm-compiled language (ie there's a classes output location). The other plugins mostly just apply the java plugin, which makes it easy for them.

For now, you can just do what java does and explicitly add your own sourcesSet object (subclassed to allow javascript-specific source sets). A more general solution could be creating a delegating SourceSetsContainer that creates javascript source sets and delegates any other source sets to the previously existing project.sourceSets object. I think this might call for talking to the Gradle folks, though.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants