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

Update build project to .net 8 #776

Merged
merged 4 commits into from
May 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions build/build.fsproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<OutputType>Exe</OutputType>
<OutputPath>buildOutput</OutputPath>
</PropertyGroup>
Expand All @@ -14,10 +14,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Build" Version="17.3.2" />
<PackageReference Include="Microsoft.Build.Framework" Version="17.3.2" />
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="17.3.2" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="17.3.2" />
<PackageReference Include="Microsoft.Build" Version="17.9.5" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="17.9.5" />
<PackageReference Include="MSBuild.StructuredLogger" Version="2.2.235" />
<PackageReference Include="Fake.DotNet.Cli" Version="6.0.0" />
<PackageReference Include="Fake.Tools.Git" Version="6.0.0" />
Expand Down
25 changes: 25 additions & 0 deletions build/build.sln
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need a separate solution file in the build directory? We already have one in the root directory NSubstitute.sln

Copy link
Contributor Author

@Romfos Romfos Feb 4, 2024

Choose a reason for hiding this comment

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

because build.fs have task to build main solution
this is circular dependency. we cannot build project during run project =)

Copy link
Member

Choose a reason for hiding this comment

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

build.fs uses dotnet test Docs.csproj so it shouldn't need the sln afaict. 🤔 What's the error it's giving without this?

        let projPath = outputCodePath </> "Docs.csproj"
        FileReaderWriter.Write projPath csproj
        DotNet.restore (fun p -> p) projPath
        DotNet.build (fun p -> p) projPath
        DotNet.test (fun p -> p) projPath

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no error, it just stuck at build phase if add build project to main solution

let solution = (root </> "NSubstitute.sln")
....


    Target.description("Restore dependencies")
    Target.create "Restore" (fun _ ->
        DotNet.restore (fun p -> p) solution
    )

    Target.description("Compile all projects")
    Target.create "Build" (fun _ ->
        DotNet.build (fun p ->
            { p with Configuration = DotNet.BuildConfiguration.fromString configuration
                     MSBuildParams = { p.MSBuildParams with Properties = additionalArgs }
            }) solution

Copy link
Member

Choose a reason for hiding this comment

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

I still don't follow why it's required. But happy to merge as-is. 👍

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.8.34525.116
MinimumVisualStudioVersion = 10.0.40219.1
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "build", "build.fsproj", "{80930547-418C-49D9-9966-2A578389957C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{80930547-418C-49D9-9966-2A578389957C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{80930547-418C-49D9-9966-2A578389957C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{80930547-418C-49D9-9966-2A578389957C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{80930547-418C-49D9-9966-2A578389957C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {60C493F8-CB37-405C-8D66-8A05D7537755}
EndGlobalSection
EndGlobal
Loading