Skip to content

Commit

Permalink
Switch from msbuild to dotnet build and publish
Browse files Browse the repository at this point in the history
  • Loading branch information
menees committed Jun 1, 2024
1 parent 9b136b1 commit 48d8d64
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
6 changes: 2 additions & 4 deletions eng/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ if ($build)
{
foreach ($configuration in $configurations)
{
# Restore NuGet packages first
msbuild $slnPath /p:Configuration=$configuration /t:Restore /v:$msBuildVerbosity /nologo
msbuild $slnPath /p:Configuration=$configuration /v:$msBuildVerbosity /nologo
dotnet build $slnPath /p:Configuration=$configuration /v:$msBuildVerbosity /nologo
}
}

Expand Down Expand Up @@ -60,7 +58,7 @@ if ($publish)
# The Publish target in "C:\Program Files\dotnet\sdk\3.1.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.CrossTargeting.targets"
# throws an exception if the .csproj uses <TargetFrameworks>. We have to override that and force a specific <TargetFramework> instead.
$targetFramework = GetXmlPropertyValue $profile 'TargetFramework'
msbuild $slnPath /t:Publish /p:PublishProfile=$profileName /p:TargetFramework=$targetFramework /v:$msBuildVerbosity /nologo /p:Configuration=$configuration
dotnet publish $slnPath /t:Publish /p:PublishProfile=$profileName /p:TargetFramework=$targetFramework /v:$msBuildVerbosity /nologo /p:Configuration=$configuration

Remove-Item "$artifactsPath\$profileName\*.pdb"

Expand Down
2 changes: 2 additions & 0 deletions src/Diff.Net/Diff.Net.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
<UseWindowsForms>true</UseWindowsForms>
<ApplicationIcon>Images\DiffDotNet.ico</ApplicationIcon>
<ApplicationManifest>app.manifest</ApplicationManifest>
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Menees.Diffs.Windows.Forms" Version="5.0.3" />
<PackageReference Include="System.Resources.Extensions" Version="6.0.0"/>
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<ProduceReferenceAssembly>false</ProduceReferenceAssembly>
<_SkipUpgradeNetAnalyzersNuGetWarning >true</_SkipUpgradeNetAnalyzersNuGetWarning>

<!-- Make the assembly, file, and NuGet package versions the same. -->
<Version>4.1.2</Version>
Expand Down

0 comments on commit 48d8d64

Please sign in to comment.