Announcement Announcement Module
Collapse
No announcement yet.
additional source directory Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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.

    Comment


    • #3
      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 ?

      Comment


      • #4
        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.

        Comment

        Working...
        X