Hi,
Am 29.12.10 00:35, schrieb StormeHawke:
> Ok, so I've been searching for a while now and while I've got antlr
> generating source files (Kudos to the developers on that part - it was
> cake), I can't seem to find anything in the user guide or anywhere else
> about configuring where those source files are generated.
>
> By default they're generated in
> projectRoot/build/generated-src/antlr/main/package.
> But where I need them to be is in my sourceSets/main/java/package directory
> - We've got the .g files in the same directory in the project tree as where
> the generated src files are expected to be by the rest of our project.
As you mentioned, the antlr generated sources are generated into a
subdirectory of the "build" folder like all other artifacts, which are
generated during the build. Furthermore your generated directory
projectRoot/build/generated-src/antlr/main is added to the java
sourceset definition to be sure its considered compileJava task.
If you write the antlr generated source directly to the src/main/java
folder you're polluting your source folder with output of your build
process.
Nevertheless, If you still want to change the output folder of the
antlr-generated sources you can use the outputDirectory property of the
antlr task like this:
__________
generateGrammarSource {
    outputDirectory = file("src/main/java")
}
__________

As I mentioned, polluting your source folder during your build is an
antipattern I think.
If you want to use a custom directory, that is not configured as a
source folder for your java sources, you have to manually add this
directory to your java.main sourceset.

regards,
Rene
> I have a feeling this I'm probably missing something obvious in the overall
> gradle architecture, but I'm new to Gradle and am not really sure where else
> to search.  
>
> Thanks in advance,
> ~Brian


-- 
------------------------------------
Rene Groeschke

[email protected]
http://www.breskeby.com
http://twitter.com/breskeby
------------------------------------


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to