question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

buildOptions does not merge correctly

See original GitHub issue

Steps 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:closed
  • Created 7 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
ericstjcommented, Jun 23, 2016

@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?

0reactions
brthorcommented, Sep 19, 2016

Added to tracking.

Read more comments on GitHub >

github_iconTop Results From Across the Web

github - git merge does not merge
The reason I say it didn't merge is that there are changes in the master branch that are not reflected in the PersonalSite...
Read more >
Gradle build failed with Unity 2018.3 - Error while merging ...
Hello everyone! I open this tread because I can not create a working build of my project since I updated Unity to version...
Read more >
Customizing Package Build Options in the RStudio IDE
Customizing Package Build Options Overview There are three R package build commands used by the package development tools in the RStudio...
Read more >
[Merged] build options for modules
I have been hacking at cmakelists to slim down build time. I saw juergen had done the same on the assembly branch. I...
Read more >
Export `pcre2` path for git build options - Merge requests
What does this Merge Request do and why? This MR adds GIT_APPEND_BUILD_OPTIONS to gdkrc to point to Homebrew installation of pcre2...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found