Comments (8)
I started working on this, my patches are here - https://github.com/duncanmak/mill/tree/generate-zipmap
from mill.
@duncanmak Looks pretty good!
But how about instead of actually generating source files (which is kinda messy?), just print out the lines needed to go into the file and paste them in by-hand?
...Because I'm thinking this is a job you don't normally to very often; maybe it's a one-time-job. Just generate the code necessary, paste it in there, and call it a day.
But of course keep the code for generating the code around; with unit tests! (for risk-free refactoring in the future)
e.g. something like this:
assert(generateZipMap(2) == """def zipMap[A, B, Z](a: A, b: B, z: Z) = .......""")
Opinions? @lihaoyi ?
from mill.
from mill.
Okay - I did a bit more work tonight and now I have code-gen for mill.define.Applicative
, mill.define.Target
and the test ApplicativeTests
.
I tested it by running the generate.sc
scripts that generate FooGenerated.scala
files, and compiling it using sbt core/test
. It's all compiling and the tests pass.
The next step is to patch build.sbt
and build.sc
to run these generate.sc
files prior to actually compiling the sources.
from mill.
@duncanmak any updates on this one?
from mill.
Hey @lihaoyi, I added the code generation into build.sc
just now and now it runs as part of the mill build. The commit is here - https://github.com/duncanmak/mill/commit/1b27a0b2e56ceccaaffa4b3c49d4b8aa14aab6b6
The SBT part felt really above my head, so I'd need more direction for how best to integrate the code generation into build.sbt
.
from mill.
I submitted #81 which is my first completed attempt of implementing this issue.
from mill.
@lihaoyi merged #81 so I'm closing this.
from mill.
Related Issues (20)
- Migrate `build.sc` to Scala 3 (1000USD Bounty) HOT 5
- BSP's dependencyModules do not return transitive libraries HOT 8
- url pattern need update HOT 4
- MatchError when do ` mill.idea.GenIdea/idea` HOT 14
- Add new built in command in Test suite that lists full names of all test classes or test cases. HOT 1
- Compile time slower in version 0.11.7-86-18d144 HOT 2
- Publish to winget HOT 1
- Add support in import IDEA scala plugin? HOT 1
- GenIdea: Illegal char <:> HOT 2
- `TestModule.testOnly` should fail if no tests were matched
- Feature Request: Support for Publishing POM Artifacts HOT 2
- Automatically exclude Mill transitive depedencies from build classpath HOT 6
- Not so TASTy to 0.11.8? HOT 5
- Warn user about incompatible Java / Scala versions HOT 2
- Refactor `CompileModule` out of `JavaModule` HOT 2
- Mill omits projects when generating a BSP project when you have a foreign modules with same names as in project
- Classes don't seem to be always put in `compiledClassesAndSemanticDbFiles.dest` HOT 1
- First compile error after changed the build.sc HOT 1
- Mill clean should stop/close workers HOT 1
- Windows CI seems to be broken on newer versions of Mill (500USD) HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mill.