Skip to content
This repository has been archived by the owner on Dec 18, 2017. It is now read-only.

A few overlapping script fixes #942

Closed
wants to merge 4 commits into from
Closed

A few overlapping script fixes #942

wants to merge 4 commits into from

Conversation

dougbu
Copy link
Member

@dougbu dougbu commented Dec 1, 2014

See individual commits for details

… scripts

- provide `%project:Configuration%` and `%project:TargetFramework%` to scripts
- remove extra quotes around `cmd /c` arguments
 - prevented && and similar special cases
- don't strip quotes surrounding command-line arguments
 - prevented command paths and arguments containing spaces
- `CommandGrammar` may need additional generalizations
 - e.g. unquoted term can't contain more than one escape sequence
 - but it's probably good enough for now
- handle wrapping a .NET 4.5 project that builds a console application
@dougbu
Copy link
Member Author

dougbu commented Dec 1, 2014

/cc @troydai, @davidfowl

@troydai
Copy link
Contributor

troydai commented Dec 1, 2014

The change introduces a few new build script blocks which will be executed asymmetrically. If there are two build configuration and two target framework. prebuild.perconfiguration will be executed twice and the prebuild.perframework will be executed four times, while others will be executed only once. This bothers me because it makes the project.json more slightly ambiguous.

Other then this, the scope in which the variables are exposed should be controlled. For example, project:TargetFramework shouldn't be exposed to postbuild or prebuild since they're executed once per build therefore these variables are meaningless. They should be hiding to prevent incorrect usage.

I think we should overall rethink the role of executing scripts in project script. What's the real use case of these two new introduced build script block.

@@ -99,6 +101,9 @@ public bool Build()
// Build all specified configurations
foreach (var configuration in configurations)
{
_configuration = configuration;
ScriptExecutor.Execute(project, _buildOptions.Reports, "prebuild.perconfiguration", GetScriptVariable);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetScriptVariable should not be shared among all build script blocks. Variables of configurations and target frameworks shouldn't been exposed to postbuildor prebuild.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not share GetScriptVariable()? The additional variables aren't exposed in prebuild or postbuild because the corresponding fields are reset to null at the correct points.

@davidfowl
Copy link
Member

These bugs were never triaged and never put in a milestone. @dougbu Ping @glennc and the triage team about these issues if you want to get them into beta2.

@davidfowl davidfowl closed this Dec 1, 2014
@dougbu
Copy link
Member Author

dougbu commented Dec 1, 2014

@davidfowl OK in general. I didn't realized these two bugs (both without an assigned milestone) had been triaged. Could you please let me know offline who's on the triage team?

Separately, any objection to leaving the bugs assigned to me? I'll resurrect this PR or the commits it contains when the bugs get milestones.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants