One more thing -- it would be nice if these commands had access to the
various build directories (under bin/target/.../pkgname/... or similar):

- temp directory to dump non-buildables
- generated src directory that's included in both the src and the include
path during the build
- output directory

Via environment vars perhaps? Currently, I resort to dumping the generated
files into pkg/src and excluding them in .gitignore.

I believe there is already some support for this for syscfg, so hopefully
it isn't a huge change.

If this is available for app packages as well as targets and pkgs, there is
yet another step I could eliminate from my makefile.

simon

On 26 Feb. 2017 11:34 pm, "Simon Ratner" <[email protected]> wrote:

> Hi Chris,
>
> Something like that will work; I have two immediate comments:
>
> - I would like this to be encapsulated in the package; as is, it isn't
> much better than a top level makefile since the target has to be aware of
> specific package internals. In my case, the package contains some
> third-party code and I would prefer that to be opaque.
>
> Making them pkg.* options instead would do that while still allowing you
> to specify them in pkg.yml of the target as well. I can see both being
> useful.
>
> - My vote is for pre_build and post_build, since that's the operation they
> actually bracket :)
>
> Cheers,
> simon
>
> On 26 Feb. 2017 6:11 pm, "Christopher Collins" <[email protected]> wrote:
>
>> Hi Simon,
>>
>> On Sun, Feb 26, 2017 at 01:31:39PM -0800, Simon Ratner wrote:
>> > Hi devs,
>> >
>> > I have a package that requires a custom build step (generating
>> intermediate
>> > files). Any recommendations on how to best handle this?
>> >
>> > Currently I am doing the custom step from my top-level makefile, before
>> > invoking `newt build`, but that doesn't seem ideal.
>>
>> I don't think there is currently any better way than what you are
>> currently doing (generating the files via make).  This is definitely
>> something that is missing from newt.
>>
>> It might take some thought to get something like this right.  For now
>> I'll just throw an idea out there:
>>
>> Two new settings in the target.yml file:
>>     o target.pre_run
>>     o target.post_run
>>
>> Each specifies a sequence of executable pathnames.  The pre_run commands
>> get executed before newt builds anything; the post_run commands are
>> exected after everything gets built.  If any executable fails, the build
>> fails.
>>
>> Chris
>>
>

Reply via email to