www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Dub recursive build and forcing pre-build commands to run

reply Meta <jared771 gmail.com> writes:
I have two questions.

1. Is it possible to build subpackages when dub build is invoked 
for the main package? It's a pain to first do dub build 
:mysubpackage and then dub build.

2. It seems that when dub detects that no dependencies need to be 
updated, it does not run the pre-build commands. I have some 
pre-build commands that generate data to be imported by the main 
package and thus must always be run for a build. Is there a way 
to specify this?
Jul 08 2016
parent reply Antonio Corbi <aaacorbi mail.com> writes:
On Saturday, 9 July 2016 at 00:03:22 UTC, Meta wrote:
 I have two questions.

 1. Is it possible to build subpackages when dub build is 
 invoked for the main package? It's a pain to first do dub build 
 :mysubpackage and then dub build.

 2. It seems that when dub detects that no dependencies need to 
 be updated, it does not run the pre-build commands. I have some 
 pre-build commands that generate data to be imported by the 
 main package and thus must always be run for a build. Is there 
 a way to specify this?
I use the "preGenerateCommands" and "dependencies" like this: "configurations" : [ { "comment" : "Classic app.", "name" : "eqapp", "preGenerateCommands" : ["sed -e 's#topdir src/config/constants.d"], "dependencies" : {":dgtalib" : "*", "gtk-d:gtkd": "~>3.3.0"}, }, .... Hope this helps you. Antonio
Jul 09 2016
parent reply Meta <jared771 gmail.com> writes:
On Saturday, 9 July 2016 at 07:52:56 UTC, Antonio Corbi wrote:
 I use the "preGenerateCommands" and "dependencies" like this:

     "configurations" : [
         {
             "comment"             : "Classic app.",
             "name"                : "eqapp",
             "preGenerateCommands" : ["sed -e 
 's#topdir
 src/config/constants.d"],
             "dependencies"        : {":dgtalib" : "*", 
 "gtk-d:gtkd": "~>3.3.0"},
         },
       ....

 Hope this helps you.
 Antonio
When are pre-generate commands run?
Jul 10 2016
parent Antonio Corbi <amcb ggmail.com> writes:
On Sunday, 10 July 2016 at 07:00:18 UTC, Meta wrote:
 On Saturday, 9 July 2016 at 07:52:56 UTC, Antonio Corbi wrote:
 I use the "preGenerateCommands" and "dependencies" like this:

     "configurations" : [
         {
             "comment"             : "Classic app.",
             "name"                : "eqapp",
             "preGenerateCommands" : ["sed -e 
 's#topdir
 src/config/constants.d"],
             "dependencies"        : {":dgtalib" : "*", 
 "gtk-d:gtkd": "~>3.3.0"},
         },
       ....

 Hope this helps you.
 Antonio
When are pre-generate commands run?
Official docs say this: preGenerateCommands string[] A list of shell commands that is executed before project generation is started If my memory serves me well I started to use it instead of preBuildCommands because they are always executed and, in my case, I needed that (to simulate the autoconf/cmake 'file.in -> file' idiom). Antonio
Jul 10 2016