On 25/03/2015 2:24 a.m., Bruno Medeiros wrote:
On 23/03/2015 15:35, Ben Boeckel via Digitalmars-d-announce wrote:
Running a Python script to generate D code?

Yes, in DUB you can run arbitrary external commands before and after the
D sources compilation.

But not in between? Basically, can you have a tool written in D built
with the project and then used to generate code in the same project?


That should be possible if you split it into two bundles or so, if I
understood that case correctly. The external commands run before and
after a compilation of a bundle (known in DUB as "package"). So you
could have:

1. bundleA - pre external commands
2. bundleA - D sources compilation
3. bundleA - post external commands
4. bundleB - pre external commands
5. bundleB - D sources compilation
and so on.. (if bundleA is set as a dependency of bundleB)

Actually I was thinking along the lines of using sub packages to do this.

  depends on subPackage2
  pre: do stuff
  compile D
  post: do stuff
  depends on subPackage1
  pre: do stuff
  compile D
  post: do stuff

Of course you could chain this as long as you want.

Reply via email to