-
-
Notifications
You must be signed in to change notification settings - Fork 957
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
Farewell project json #357
Conversation
…ot supported anymore?)
Hi @adamsitnik, I'm your friendly neighborhood .NET Foundation Pull Request Bot (You can call me DNFBOT). Thanks for your contribution! The agreement was validated by .NET Foundation and real humans are currently evaluating your PR. TTYL, DNFBOT; |
@adamsitnik, looks awesome! Great job! What the current state of this PR? What else do you want to commit? Should I already try it? |
@AndreyAkinshin thanks! @CesarBS helped me ;) In general there are few issues with the tools (VS/msbuild/dotnet cli), our part (code) is ok. I thinks it's quite good (we even have now project.json/csproj auto-detection so users will not need to configure anything) The problems:
I would like to wait for VS 2017 RC4, make sure everything works, update the docs and then release. |
If you are curious you can already try it. Maybe we can add ref returns support? |
using BenchmarkDotNet.Characteristics; | ||
using BenchmarkDotNet.Environments; | ||
using BenchmarkDotNet.Helpers; | ||
using BenchmarkDotNet.Jobs; | ||
using BenchmarkDotNet.Running; | ||
using BenchmarkDotNet.Toolchains.DotNetCli; | ||
using System.Reflection; | ||
using System.Text; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
||
File.WriteAllText(artifactsPaths.ProjectFilePath, content); | ||
} | ||
|
||
protected override string SetDependencyToExecutingAssembly(string template, Type benchmarkTarget) | ||
{ | ||
if (!GetSolutionRootDirectory(out var solutionRootDirectory)) | ||
{ | ||
throw new NotSupportedException("Unable to find .sln or global.json file, hence can not find the csproj path"); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
var csprojs = solutionRootDirectory.GetFiles(csprojName, SearchOption.AllDirectories); | ||
if (csprojs.Length != 1) | ||
{ | ||
throw new NotSupportedException($"Unable to find single {csprojName} in {solutionRootDirectory} and it's subfolders. Most probably the name of output exe is different than the name of the .csproj"); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
<ItemGroup> | ||
<ProjectReference Include="..\..\src\BenchmarkDotNet.Core\BenchmarkDotNet.Core.csproj"> | ||
<Project>{95f5d645-19e3-432f-95d4-c5ea374dd15b}</Project> | ||
<Name>BenchmarkDotNet.Core</Name> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
<Name>BenchmarkDotNet.Core</Name> | ||
</ProjectReference> | ||
<ProjectReference Include="..\..\src\BenchmarkDotNet\BenchmarkDotNet.csproj"> | ||
<Project>{af1e6f8a-5c63-465f-96f4-5e5f183a33b9}</Project> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
</PropertyGroup> | ||
<ItemGroup> | ||
<Content Include="xunit.runner.json"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
build/common.props
Outdated
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
</PropertyGroup> | ||
|
||
<!-- does not work ;/ |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
<ProjectReference Include="..\..\src\BenchmarkDotNet.Diagnostics.Windows\BenchmarkDotNet.Diagnostics.Windows.csproj" /> | ||
<Reference Include="System.Reflection" /> | ||
<Reference Include="System" /> | ||
<Reference Include="Microsoft.CSharp" /> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@adamsitnik, than I have the following suggestion: we release v0.10.3 from the master branch now (I have some changes that I want to have in the stable version), and we release v0.10.4 with your update as soon as it is ready. Is it ok for you? |
@CesarBS, you did a nice review, thanks for the help! |
if (!gcMode.HasChanges) | ||
return; | ||
|
||
var runtimeConfigContent = new StringBuilder(80) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
…ble (32 or 64bit), samples running!
@CesarBS @natemcmaster thanks for the review! I adopted the code to your comments. @AndreyAkinshin I am very close to getting it done, you can start downloading VS 2017 RC4 and give it a try ;) I have one dilemma:
|
4c23167
to
1a7bd42
Compare
… support net451 and gives silent errors
…very referenced project
@@ -1,4 +1,4 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@adamsitnik, I installed the latest VS2017 RC4, opened the
Why BDN generates a |
@AndreyAkinshin we run |
Yeah, I have the old version of dotnet in the path:
Could we detect such situations? I think, it doesn't make any sense to run benchmarks on |
sure, the thing is how to check it right? Maybe I could search for |
LGTM |
Ok, I updated my PATH:
New result:
Could we print some additional information about the failed build? |
Another concern. Here is my env info:
Could we print |
Sure
Yes, I will restore the old behaviour (+the flag) |
Also I spent a lot of time in the build stage (probably because of restore). |
I noticed, that we still generate benchmark folders (like |
We could, but there is a chance that we would get hit by too long path exception again.
that is minor bug, I will fix it |
Yeah, it can be a problem. But current solution (which we need only in specific situation) are too ugly. Also, we still could have some problems even with the root folder. |
By the way, I think we are ready to merge it into master (v0.10.3 will support new csproj). I also want do to some improvements here and there. What do you think? |
I agree. Right now I am working on getting the tests passed + adapting to your comments. Should finish today |
@adamsitnik, by the way, our CI build is red again: https://ci.appveyor.com/project/PerfDotNet/benchmarkdotnet/history |
@CesarBS I removed the |
@adamsitnik, could you move the generated folders to the binary folder before we release 0.10.3? There are still in the root solution directory. |
@AndreyAkinshin Ok, I have just moved it. Personally, I am afraid of TooLongPathExceptions, but let's wait and see where it can take us. |
I have ported our projects to the new csproj format (
except F# for .NET Core which does not work yet).Users don't need to do anything else than just package upgrade. We detect if they are using project.json files or the new csproj by checking the
dotnet --version
It means that we still support project.json files ;)Problems:
today we can't easily run the test for classic .NET framework, bug reported hereAgain big thanks to @CesarBS for help!