Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rids #93

Closed
wants to merge 7 commits into from
Closed

Rids #93

wants to merge 7 commits into from

Conversation

clairernovotny
Copy link
Collaborator

@clairernovotny clairernovotny commented Jul 10, 2018

Add support for RID's.

What currently works: Adding a TFM with an RID like this netstandard2.0+win or a set like netstandard2.0+unix;netstandard2.0+win

It will set a define for both NETSTANDARD2_0 and NETSTANDARD2_0_UNIX.

Currently requires msbuild.exe to build. Will require MSBuild 15.8 on .NET Core (2.1.4xx). You can build the csproj directly. Sln is a WIP.

/cc @Drawaes

To Do

  • Pack correctly
  • Restore from sln doesn't work

@clairernovotny
Copy link
Collaborator Author

/cc @jeffkl as well for use of the RoslynCodeTaskFactory. Any idea what build of the CLI tools it'll be in? 2.1.400-preview-008975 does not appear to have it yet.

@jeffkl
Copy link

jeffkl commented Jul 10, 2018

The built-in RoslynCodeTaskFactory didn't make it until 15.8 which is in preview now. So using my NuGet package is the safest bet until then.

var ns = doc.Root.GetDefaultNamespace();

// Escape this to avoid MSBuild issues
var tf = "$" + "(TargetFramework)";
Copy link

Choose a reason for hiding this comment

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

You can set Evaluate="False" on the <Task /> element above to have MSBuild not evaluate the task body.

https://docs.microsoft.com/en-us/visualstudio/msbuild/taskbody-element-msbuild

<_SdkFileLocation>$(MSBuildProjectExtensionsPath)</_SdkFileLocation>
<_SdkPropsFileLocation>$(_SdkFileLocation)$(MSBuildProjectFile).nuget.g.props</_SdkPropsFileLocation>
<_SdkTargetsFileLocation>$(_SdkFileLocation)$(MSBuildProjectFile).nuget.g.targets</_SdkTargetsFileLocation>
<_SdkTargetsFileLocationOut>$(_SdkFileLocation)$(MSBuildProjectFile).extras.g.targets</_SdkTargetsFileLocationOut>
Copy link

Choose a reason for hiding this comment

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

This is a great use of my MSBuildProjectExtensions feature!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It was really a hack since I couldn't directly manipulate the generated file....access denied because msbuild already had a lock on it :P

@clairernovotny
Copy link
Collaborator Author

Closing in favor of #94, which is less invasive

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

Successfully merging this pull request may close these issues.

2 participants