Build script configuration file #3528
Replies: 16 comments
|
Using something like XML or JSON could give a little more future flexibly, like multiline content etc. |
|
+1 JSON |
|
Supporting Expanding Environment Variables for values would be nice too, then sensitive info could be excluded from config/buildscript bit easily mapped/concatenated in config file. I.e. |
|
I see your point. However, this configuration file is just default parameters for the command line so I think that XML or JSON would be overkill. You wouldn't write anything in this file that you wouldn't write as a command line parameter. Everything other than that could be done in the actual cake script. I would prefer JSON for this, but the reason I suggested key/value is that I'm not sure that |
|
@devlead Yes, that would be really useful. Would also be cool if the argument parser would understand environment variables as well. |
|
My two cents is that most new projects, for example AspNet, are all migrating to having a json formatted default configuration file. Hence cake.json or something like that. Also, I'm curious why not Newtonsoft.Json? It's the defacto json parsing library. My only issue with env variables in arguments is at that point, why not use a bootstrapper that understands env variables like powershell or bash? I have a feeling adding env var support to arguments might end up messy. Not sure how env var expanding in config would work. Never heard of that before. And why would sensitive information be passed in through dynamic -Args or read directly using |
|
@RichiCoder1 Environment variables is really nice on build servers, you can keep config file in source repo without exposing sensitive information, also a config file would be cross platform, which a bash/ps/bat file isn't. Having it on a config file would also allow build script reuse only changing config file, I have many projects using Cake with very similar build scripts and only small pieces different between them. Regarding adding more binary references, personally I don't add dependencies lightly, anything not internal is hard to change later ;) though anything adding substantial value I'm all for! |
|
While Newtonsoft.Json might be the most popular one in the .NET world, it likely has tons of features that aren't necessary for Cake. There are also some pains with the loads of versions out there conflicting with one another. I would vote for a smaller faster JSON library. OR Not using JSON as originally suggested. |
|
I'm cool with smaller then :). And one thing that NPM does that cake could do is it looks for Edit: in addition to config, that is. |
|
It seems to me that it doesn't worth the effort, bringing this functionality into Cake's core. At the moment Instead, we could implement a "native" JSON support (in Cake's core, that is not hooking up to external dependencies). |
|
@cake-build/team am I right in saying that we can close this issue? Or is there still items outstanding on this that we want to bring in? |
|
@gep13 do we really support overriding argument defaults via config as suggested in the issue? |
|
Is this implemented? What is the alternative otherwise if I want to specify arguments in a config file, and not pass as parameters when invoking cake.exe? |
|
@nawfalhasan no this is still an open issue, if you don't want to use command line parameters, your options today are to either use environment variables, or just serialize state to something like a json or yaml file. |
|
Did a quick little search through the open issues, and a text search in this one about moving the pinning of addin/tool versions to a config file. Ideally, such a version pinning file would be generated whenever the script is run and there doesn't already exist this file. This way, pinning would be as easy as checking that file in instead of the current syntax. Think that could have a place in the config file being discussed here? |
Uh oh!
There was an error while loading. Please reload this page.
Add support for a build script config file. The build config would be a simple key-value pair file. The filename would be the same as the build script with a
.configprefix (i.e.build.cake.config).The configuration would only provide defaults. Any values in the build script config file would be
overridden by any arguments passed to cake directly.
Would use the
verbosityanddryrunfrom the config file, but thetargetfrom the command line arguments.All reactions