buildOptions does not merge correctly
See original GitHub issueSteps to reproduce
Write a project.json
that uses multiple buildOptions
objects, one under root, and one under a particular framework, e.g.:
{
"buildOptions": {
"compile": {
"include": [ "some", "goodFiles" ]
}
},
"frameworks": {
"netstandard1.5": {
"buildOptions": {
"compile": {
"exclude": [ "other", "badFiles" ]
}
}
}
}
}
Expected behavior
Both include
and exclude
to be respected for dotnet build -c netstandard1.5
, that is, the root included files to be included, and the framework excluded files to be excluded (the objects are merged).
This is inline with the proposal https://github.com/dotnet/core-proposals/pull/15 for the schema update https://github.com/aspnet/Announcements/issues/175 implemented in https://github.com/dotnet/cli/pull/2493.
The
"buildOptions"
section can be defined in:
- the root of the project file, in which case the properties apply whenever compiling the project
- under an entry in the “
configurations
” section, in which case the properties apply when compiling with that configuration- under an entry in the “
frameworks
” section, in which case the properties apply when compiling for that framework
(Added emphasis my own.)
Actual behavior
Only the buildOptions
properties under the framework is respected, thus those files are excluded, but the root included files are not included.
Currently, the only way to get the intended behavior is to duplicate my root include into each of my supported frameworks, so that only one buildOptions
object specifies everything for a particular build.
Environment data
dotnet --info
output:
.NET Command Line Tools (1.0.0-preview2-003093)
Product Information:
Version: 1.0.0-preview2-003093
Commit SHA-1 hash: f4a8df3a56
Runtime Environment:
OS Name: ubuntu
OS Version: 14.04
OS Platform: Linux
RID: ubuntu.14.04-x64
/cc @ajaybhargavb
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (8 by maintainers)
Top GitHub Comments
@piotrpMSFT @blackdwarf this is a request to layer some/all build options between the generic set and the framework specific set. Can you please triage?
Added to tracking.