[Scons-users] code styler tool in SCons

Bill Deegan bill at baddogconsulting.com
Mon Oct 14 17:02:01 EDT 2013


Rob,

There's not a hook for that.
If you're running it in your SConscripts, that's probably the best you'll
get.
At the prompt in interactive mode, the DAG is already built and it's
already loaded the md5 hashes.. So it won't reprocess the sconscripts and
thus not run your styler.

Plus once again.. if you had something modifying the files outside scons,
its likely it'd trigger a rebuild on the "styled" files after it was run..

-Bill


On Mon, Oct 14, 2013 at 12:03 AM, Rob Deckers
<Rob.Deckers at vanderlande.com>wrote:


> Bill,****

>

> ** **

>

> I do see the issue.****

>

> Currently the styler is executed while reading the SConscripts, so the md5

> checksum will be calculated over the adjusted version.****

>

> ** **

>

> If I could call this tool in some kind in a pre-build step (nog the

> pre-build of come .o file, but a general prebuild) than my issue will be

> solved.****

>

> ** **

>

> Kind regards,****

>

> Rob Deckers****

>

> ** **

>

> *From:* scons-users-bounces at scons.org [mailto:

> scons-users-bounces at scons.org] *On Behalf Of *William Deegan

> *Sent:* zaterdag 12 oktober 2013 3:50

>

> *To:* SCons users mailing list

> *Subject:* Re: [Scons-users] code styler tool in SCons****

>

> ** **

>

> Rob,****

>

> ** **

>

> Do you see the issue (describe below) with modifying a file in place and

> then being able to determine if it needs to be rebuilt?****

>

> ** **

>

> -Bill****

>

> On Oct 10, 2013, at 11:43 PM, Rob Deckers <Rob.Deckers at vanderlande.com>

> wrote:****

>

>

>

> ****

>

> Thanks Bill,****

>

> ****

>

> Indeed it’s the intent to check in the styled version of the file.****

>

> ****

>

> Kind regards,****

>

> Rob Deckers****

>

> ****

>

> *From:* scons-users-bounces at scons.org [mailto:scons-

> users-bounces at scons.org] *On Behalf Of *Bill Deegan

> *Sent:* vrijdag 11 oktober 2013 8:41

> *To:* SCons users mailing list

> *Subject:* Re: [Scons-users] code styler tool in SCons****

>

> ****

>

> Rob,****

>

> In general, having a build system with any targets where the source and

> the target are the same file is not a good idea.****

>

> The reason for this is, how do you decide if you should rebuild on the 2nd

> build?

> You've touched all the sources since the 1st build, so everything should

> get built again..****

>

> (This should be true if you are using either time or md5 signature of the

> file)****

>

> SCons will (should) detect a circular dependency..

>

>

> ****

>

> Is the intent that the styled version of the file is what should be

> checked in?****

>

> -Bill****

>

>

>

>

>

> ****

>

> ****

>

> On Thu, Oct 10, 2013 at 12:28 AM, Rob Deckers <Rob.Deckers at vanderlande.com>

> wrote:****

>

> Hi,

>

> In our current make-environment we use a code-styler / code-beautifier

> tool (named: astyle).

> Currently, in every build this tool is executed recursively from the

> project root.

> The tool itself check's for non-read-only *.cpp & *.h files (means they

> are changed) and styles the file. So source and target and the same file.

>

> Now in SCons, I tried implement the same tool. I created a simple style.py

> tool that uses a env.Execute in the generate function.

> This works fast enough and good for the regular SCons build, but this

> doesn't do anything once the developer is in the --interactive build mode.

>

> How can I let every build be preseeded by this code-styler?

>

> Kind regards,

> Rob Deckers

> ** Disclaimer **

>

> This e-mail, including any attachments, may include proprietary and

> confidential information of Vanderlande Industries and may only be read by

> the person or those persons to whom it is addressed.

> This document is forwarded to you in such a form (e-mail) that Vanderlande

> Industries cannot guarantee the completeness and/or correctness of its

> contents and information.

> If you have received this e-mail message in error, please notify us

> immediately. Please also delete this document from your computer.

> This document may not be reproduced, copied, distributed, published,

> modified, or furnished to third parties, without the prior written consent

> of Vanderlande Industries.

>

> _______________________________________________

> Scons-users mailing list

> Scons-users at scons.org

> http://four.pairlist.net/mailman/listinfo/scons-users****

>

> ****

>

> ** Disclaimer ******

>

> This e-mail, including any attachments, may include proprietary and

> confidential information of Vanderlande Industries and may only be read by

> the person or those persons to whom it is addressed.

> This document is forwarded to you in such a form (e-mail) that Vanderlande

> Industries cannot guarantee the completeness and/or correctness of its

> contents and information.

> If you have received this e-mail message in error, please notify us

> immediately. Please also delete this document from your computer.

> This document may not be reproduced, copied, distributed, published,

> modified, or furnished to third parties, without the prior written consent

> of Vanderlande Industries.****

>

> _______________________________________________

> Scons-users mailing list

> Scons-users at scons.org

> http://four.pairlist.net/mailman/listinfo/scons-users****

>

> ** **

>

> ** Disclaimer **

>

> This e-mail, including any attachments, may include proprietary and

> confidential information of Vanderlande Industries and may only be read by

> the person or those persons to whom it is addressed.

> This document is forwarded to you in such a form (e-mail) that Vanderlande

> Industries cannot guarantee the completeness and/or correctness of its

> contents and information.

> If you have received this e-mail message in error, please notify us

> immediately. Please also delete this document from your computer.

> This document may not be reproduced, copied, distributed, published,

> modified, or furnished to third parties, without the prior written consent

> of Vanderlande Industries.

>

> _______________________________________________

> Scons-users mailing list

> Scons-users at scons.org

> http://four.pairlist.net/mailman/listinfo/scons-users

>

>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20131014/5e3c0822/attachment-0001.html


More information about the Scons-users mailing list