Results 1 to 4 of 4

Thread: additional source directory

  1. #1

    Default additional source directory

    Maybe this is a basic question but i'm wondering how to add additional source directory for compilation, for instance target/src.
    I will appreciate any help

  2. #2
    Join Date
    Jun 2010
    Location
    London
    Posts
    304

    Default

    That's not the kind of thing that's easy to do with the Grails build system. You could raise an issue to make it easier, but your best bet is to compile the source in that directory separately, perhaps after the usual source folders have been compiled.

    See the $GRAILS_HOME/scripts/_GrailsCompile.groovy file for an example of doing compilation from within a Gant script. The compilation is basically done by the 'ant.groovyc()' call.

  3. #3

    Default

    Again thanks for your help
    i will definitely have a look on it
    May I ask you if there is a way to compile this source folder before the usual source folders have been compiled ?

  4. #4
    Join Date
    Jun 2010
    Location
    London
    Posts
    304

    Default

    You can write an event handler for CompileStart:
    Code:
    eventCompileStart = {
        // Compile my custom source folders before the main compilation...
    }
    Not sure whether it's possible to add your compiled classes to the classpath for the main compilation though. In fact, it doesn't really look doable without a lot of copy and pasting from the core Grails scripts.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •