typelead / gradle-eta

Gradle plugin for the Eta programming language
BSD 3-Clause "New" or "Revised" License
30 stars 7 forks source link

support for multiple source directories #39

Closed joshsh closed 5 years ago

joshsh commented 6 years ago

It would be helpful if gradle-eta were to support multiple source directories at a time. For example, I have a pure Haskell directory I would like to keep separate from src/main/eta (so that its contents can be built independently, with GHC). Right now, I have a script which creates symlinks from src/main/eta into the pure Haskell directory src/main/haskell, but this is a bit of a hack. I have noticed that this works (in build.gradle):

sourceSets {
    main {
        eta {
            srcDir 'eta'
        }
    }
}

while this does not:

sourceSets {
    main {
        eta {
            srcDirs = ['eta']
        }
    }
}

Support for the following would be ideal:

sourceSets {
    main {
        eta {
            srcDirs = ['eta', 'haskell']
        }
    }
}
rahulmutt commented 6 years ago

I think you're looking for this?

sourceSets {
    main {
        eta {
            srcDir 'src/main/haskell'
        }
    }
}

Doing srcDirs = will invoke the underlying set function and override the default as well. Calling srcDir will add the specified directory to the existing list of source directories (which defaults to src/main/eta). This is nothing specific to the gradle-eta plugin - this is default Gradle source set configuration behavior.

joshsh commented 5 years ago

Thanks; this is all that was required. Closing.