etlas icon indicating copy to clipboard operation
etlas copied to clipboard

Support file globs and/or @file in java-sources stanza

Open jneira opened this issue 7 years ago • 6 comments

  • To let users refer to directories (like src/main/java/** for example)

jneira avatar Sep 11 '18 06:09 jneira

Would love this as well!

rahulmutt avatar Sep 11 '18 06:09 rahulmutt

Well, there is a workaround and moreover i am not sure if file globs is enough cause in windows the call to javac fails with 20 files or so. If we use file globs to extract names and then pass them to javac we will hit the issue quickly (javac does not support file globs.. sic!)

The way to pass multiple java files to javac is to create a file with the list of java sources to be compiled, then refer to that file using @file notation

So if you set java-sources: @classes.java in the cabal file and creates a file classes.java in the project directory with a list of java files, it works!. You have to name @classes.java to cheat eta and make it believe that it is a source file. I'll would add support for the @file syntax in etlas/eta instead file globs.

jneira avatar Sep 13 '18 08:09 jneira

We can take in account that etlas sdist should include all the source files in the @file

jneira avatar Jan 15 '19 10:01 jneira

Maybe we can reuse https://github.com/haskell/cabal/pull/5996

jneira avatar May 03 '19 11:05 jneira

@jneira That looks pretty cool. Do you mean to include that feature in the Eta compiler itself or Etlas?

rahulmutt avatar May 06 '19 10:05 rahulmutt

Mmmm, good question, it would be helpful in eta too

jneira avatar May 06 '19 17:05 jneira