mill
mill copied to clipboard
Customize the native binary output file name
This allows customizing the output file name from out to anything.
Previously it would require:
def nativeLink = T {
os.Path(scalaNativeWorker().nativeLink(nativeConfig(), (T.dest / "binaryname").toIO))
}
With this PR, it would be: def nativeBinaryName = "binaryname"
Now it's passing :)
Can you elaborate whether this is pure convenience or there is a real need for this? I'm not so deep in Scala Native workflows, so I also cc'ing @lolgab here.
It's purely for convenience for setting up the output binary name. Currently it's hard-coded to "out".
I changed to:
def nativeBinaryName: String = { this.toString }
So the output binary would be named as the object being generated (also could be set by the user if needed). I think it's even more useful and keeps build.sc cleaner.
I don't want to bloat the API in any way. The motivation is to give flexibility to the user without bloating build.sc itself (I remember as a user looking at both build.sc and build.sbt and thinking "why the hell are they so complex!").
No problem canceling this PR if it would cause maintenance burden in the future.