typelead / etlas

Etlas, the build tool and package manager for the Eta programming language
63 stars 10 forks source link

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

Open jneira opened 5 years ago

jneira commented 5 years ago
rahulmutt commented 5 years ago

Would love this as well!

jneira commented 5 years ago

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 commented 5 years ago

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

jneira commented 5 years ago

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

rahulmutt commented 5 years ago

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

jneira commented 5 years ago

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