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

Expose project build configuration in scripts section of project.json #887

Closed
troydai opened this issue Nov 12, 2014 · 6 comments
Closed

Comments

@troydai
Copy link
Contributor

troydai commented Nov 12, 2014

There are a few variables surfaced in the scripts section of project.json. However, the current build configuration is not among them.

The variable is useful in such a scenario: copying the output to a folder other than default output

{
  "scripts":{
    "postbuild": [
      "xcopy /F /Y /I bin\\%project:BuildConfiguration%\\* C:\\Playground"
    ]
  }
}

It worth to mention that kpm build support multiple configurations in one build run. If this variable is exposed, the scripts need to be executed multiple times to match each configuration.

@borgdylan
Copy link

👍

@dougbu
Copy link
Member

dougbu commented Dec 1, 2014

kpm build support[s] multiple configurations in one build run

should add at least a prebuild.perconfiguration (sample name) script since prebuild is executed just once and repeating it may mess up other uses. also recommend adding prebuild.perframework which would execute once per configuration : target framework pair.

I'll send a PR out containing this fix shortly.

@dougbu dougbu self-assigned this Dec 1, 2014
dougbu added a commit that referenced this issue Dec 1, 2014
… scripts

- provide `%project:Configuration%` and `%project:TargetFramework%` to scripts
dougbu added a commit that referenced this issue Mar 29, 2015
… scripts

- provide `%project:Configuration%` and `%project:TargetFramework%` to scripts
@glennc glennc added this to the 1.0.0 backlog milestone Jul 17, 2015
@glennc glennc modified the milestones: 1.0.0-beta8, 1.0.0 backlog Aug 13, 2015
@glennc glennc assigned troydai and unassigned dougbu Aug 13, 2015
@Eilon
Copy link
Member

Eilon commented Aug 13, 2015

In the design meeting we need to discuss whether doing #2450 would eliminate or at least alleviate the need for the feature in this issue.

@glennc
Copy link
Member

glennc commented Sep 4, 2015

Will run the *build *pack method per configuration and pass the configuration in.

@victorhurdugaci
Copy link
Contributor

Assigning to Pawel because he needs this to unblock his other change

moozzyk pushed a commit that referenced this issue Sep 9, 2015
moozzyk pushed a commit that referenced this issue Sep 9, 2015
moozzyk pushed a commit that referenced this issue Sep 9, 2015
moozzyk pushed a commit that referenced this issue Sep 9, 2015
moozzyk pushed a commit that referenced this issue Sep 9, 2015
moozzyk pushed a commit that referenced this issue Sep 9, 2015
moozzyk pushed a commit that referenced this issue Sep 10, 2015
moozzyk pushed a commit that referenced this issue Sep 10, 2015
moozzyk pushed a commit that referenced this issue Sep 10, 2015
Prebuild/postbuild scripts will now run for each configuration
and framework while prepack/postpack scripts will run for each
configuration.

Required to fix #887
@apawsey
Copy link

apawsey commented Apr 20, 2016

Hi guys,

Can we actually run a different script depending on build configuration or architecture now then? If so how?

Thanks.

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

Successfully merging a pull request may close this issue.

9 participants