-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Conversation
…SDK style projects
…rgets} fpr SDK projects
Only pull in the buildtools targets for depproj, ilproj and non-sdk csproj
This reverts commit dce8e68.
… targets for non-sdk projects, and only default to not building sdk projects when we're part of the overall build
@RussKeldorph @weshaggard @AaronRobinsonMSFT @sbomer I havn't tried merging your changes from #18695 yet. It looks like you moved some props stuff around, so there may be some adjustment needed there |
Condition="'$(ReferenceSystemPrivateCoreLib)' == 'true' and '$(UsingMicrosoftNETSdk)' == 'true'" | ||
AfterTargets="ResolveReferences"> | ||
<ItemGroup> | ||
<ReferencePath Remove="@(ReferencePath)" Condition="$([System.String]::new('%(ReferencePath.HintPath)').EndsWith('System.Runtime.dll')) or $([System.String]::new('%(ReferencePath.HintPath)').EndsWith('System.Collections.dll'))" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How are these getting duplicated? Wouldn't it be better to try and eliminate the duplication instead of fixing it after the fact?
The generated wrapper needs to target netcoreapp on unix. I had to exclude assets from the xunit package and introduce a dependency on the private corefx bits, to resolve a dependency conflict in which the generated wrapper was depending on an older System.Runtime.dll than the helper library. I also disabled binclash logging, because the wrapper build binplaces the helper library to the same location multiple times. I couldn't find a simple way to disable binclash logging for the wrapper build only, since that requires passing an empty switch to run.exe, and bash word splitting makes this nontrivial from build-test.
Note that this will still require changes to the test wrapper to actually source the TestEnv on unix
This way, the wrappers can build even if the 2.1 SDK isn't installed on the machine.
When building wrappers using the SDK, we need some basic properties (like the build os/arch/config, and the output directories) to be set. I factored out properties used by both the old test build and the new SDK-project test build. At first I tried using Directory.Build.props (which is automatically imported by the SDK), but our test build already imports SDK targets in various places, so this was resulting in duplicate imports. Instead, I used dir.common.props, and made the imports explicit.
Use bash arrays to pass parameters for the build command. This makes it possible to pass arguments with spaces to build_Tests_internal. We use this to disable binclashlogging selectively (for the xunit wrapper build only).
tests/src/dir.common.props was only used for the desktop-specific xunit wrapper helper library. There's no need for it any more, so its properties have been moved into tests/src/dir.props. dir.sdkbuild.props has been renamed to dir.common.props, since it contains properties used by SDK projects and buildtools projects. This change also re-enables the test build.
With this, some properties shared by SDK projects can go in a global location. The TargetFramework is shared by all SDK projects in the test tree. This change also uses a property for the xunit package directory that contains the xunit.console.dll we copy to core_root.
This fixes a failure in the windows build.
On windows, the use of run.exe, config.json, and msbuild.cmd uses msbuild.exe on the path. This change will build wrappers using the local SDK via "dotnet msbuild", bypassing run.exe. Run.exe will go away entirely with the move from buildtools to arcade, so other build invocatios should follow suit.
UseBuildTools used to be true all the time. Now that we are building wrappers on core, UseBuildTools becomes false. However, the rest of the runtest.proj expects to build using buildtools, so we keep UseBuildTools true until we switch to arcade. The CSharpCoreTargetsPath was imported when running on core only. This used to happen only on unix, but now it also happens when building runtest.proj for the xunit wrappers on windows. On unix, this targets file was a symlink to itself to work around some buildtools logic that expected the file to exist. This workaround no longer appears necessary, and on windows, this was never used in the first place, so this change removes it.
UseRoslynCompilers was introduced in buildtools by dotnet/buildtools#947, with different behaviors on windows/unix. It was removed by dotnet/buildtools#1974, so we can unify our roslyn imports now.
…into merge_sven_xunit # Conflicts: # tests/src/dir.common.props
@@ -36,7 +36,7 @@ | |||
<PgoDataPackageVersion>99.99.99-master-20180703-0030</PgoDataPackageVersion> | |||
<MicrosoftNETCoreRuntimeCoreCLRPackageVersion>3.0.0-preview1-26704-01</MicrosoftNETCoreRuntimeCoreCLRPackageVersion> | |||
<XunitPackageVersion>2.2.0-beta2-build3300</XunitPackageVersion> | |||
<XunitConsoleNetcorePackageVersion>2.2.0-preview1-02830-02</XunitConsoleNetcorePackageVersion> | |||
<XunitPackageVersion>2.4.0-beta.2.build4010</XunitPackageVersion> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should remove one of these 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, this happened in my branch when I rebased. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I should have made that more clear. I merged @sbomer 's branch into this one, as we've both changed a bunch of stuff. I wonder if it's worth waiting for Sven's changes to land, then rebase onto that, so this is clearer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that would make sense.
|
||
<!-- This file contains build properties that apply only to | ||
SDK-style test projects. Properties that are shared between SDK | ||
and buildtools projects should go in dir.common.props. --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this comment!!
…hem picking up dirs.props/targets automatically
This change updates the associated targets and props files in the test directory to allow the test csproj's to be built as SDK style projects alongside traditional style projects.
It does not yet upgrade any of the projects, I'll submit a seperate batch of PRs for that, so that these changes aren't lost in a ton of mechanical refactoring.
While these changes allow the csproj's to be upgraded, there is still work to be done to allow depproj and ilproj's to be converted over to the new style. By allowing a mix of projects styles this change allows us to upgrade piece-meal rather than in a single big bang, hopefully allowing us to easier figure out bugs if they arise.