Skip to content

Commit

Permalink
Added repository updates to move to GlobalPackageReferences, as well …
Browse files Browse the repository at this point in the history
…as few improvements to how nuke works and starts
  • Loading branch information
david-driscoll committed Sep 4, 2024
1 parent 12f7ba0 commit 01f13c6
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 1,267 deletions.
30 changes: 0 additions & 30 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,33 +1,3 @@
<?xml version="1.0" encoding="utf-8" ?>
<Project>
<ItemGroup>
<PackageReference
Include="Microsoft.NETFramework.ReferenceAssemblies"
IncludeAssets="analyzers;build;buildMultitargeting;buildTransitive"
PrivateAssets="All"
/>
<PackageReference Include="Microsoft.SourceLink.GitHub" IncludeAssets="analyzers;build;buildMultitargeting;buildTransitive" PrivateAssets="All" />
<PackageReference Include="Rocket.Surgery.MSBuild.CI" IncludeAssets="analyzers;build;buildMultitargeting;buildTransitive" PrivateAssets="All" />
<PackageReference Include="Rocket.Surgery.MSBuild.GitVersion" IncludeAssets="analyzers;build;buildMultitargeting;buildTransitive" PrivateAssets="All" />
<PackageReference
Include="Rocket.Surgery.MSBuild.JetBrains.Annotations"
IncludeAssets="analyzers;build;buildMultitargeting;buildTransitive"
PrivateAssets="All"
Condition="'$(MSBuildProjectName)'!='.build'"
/>
<PackageReference Include="Rocket.Surgery.MSBuild.SourceLink" IncludeAssets="analyzers;build;buildMultitargeting;buildTransitive" PrivateAssets="All" />
<!--
<PackageReference
Include="Polyfill"
IncludeAssets="runtime;build;buildMultitargeting;buildTransitive;native;contentfiles;analyzers"
PrivateAssets="All"
Condition="'$(MSBuildProjectName)'!='.build'"
/>
-->
<PackageReference Include="Roslynator.Analyzers" IncludeAssets="analyzers;build;buildMultitargeting;buildTransitive" PrivateAssets="All" />
<PackageReference Include="Roslynator.Formatting.Analyzers" IncludeAssets="analyzers;build;buildMultitargeting;buildTransitive" PrivateAssets="All" />
<PackageReference Include="Roslynator.CodeAnalysis.Analyzers" IncludeAssets="analyzers;build;buildMultitargeting;buildTransitive" PrivateAssets="All" />
<PackageReference Include="Roslynator.CodeFixes" IncludeAssets="analyzers;build;buildMultitargeting;buildTransitive" PrivateAssets="All" />
<PackageReference Include="Roslynator.Refactorings" IncludeAssets="analyzers;build;buildMultitargeting;buildTransitive" PrivateAssets="All" />
</ItemGroup>
</Project>
43 changes: 31 additions & 12 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<GlobalPackageReference Include="Rocket.Surgery.MSBuild.CI" Version="1.2.1" />
<GlobalPackageReference Include="Rocket.Surgery.MSBuild.GitVersion" Version="1.2.1" />
<GlobalPackageReference Include="Rocket.Surgery.MSBuild.SourceLink" Version="1.2.1" />
<GlobalPackageReference Include="JetBrains.ExternalAnnotations" Version="10.2.152" />
<GlobalPackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" />
<GlobalPackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.4" />
<GlobalPackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
<GlobalPackageReference Include="Roslynator.Analyzers" Version="4.12.4" />
<GlobalPackageReference Include="Roslynator.Formatting.Analyzers" Version="4.12.4" />
<GlobalPackageReference Include="Roslynator.CodeAnalysis.Analyzers" Version="4.12.4" />
<GlobalPackageReference Include="Roslynator.CodeFixes" Version="4.12.4" />
<GlobalPackageReference Include="Roslynator.Refactorings" Version="4.12.4" />
<GlobalPackageReference Include="FakeItEasy.Analyzer.CSharp" Version="6.1.1"
Condition="'$(IsTestProject)'=='true'" />
<GlobalPackageReference Include="FluentAssertions.Analyzers" Version="0.26.0"
Condition="'$(IsTestProject)'=='true'" />
<GlobalPackageReference Include="xunit.analyzers" Version="1.15.0"
Condition="'$(IsTestProject)'=='true'" />
</ItemGroup>
<ItemGroup>
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="8.8.0" />
<PackageVersion Include="Microsoft.Extensions.ServiceDiscovery" Version="8.2.0" />
Expand All @@ -18,15 +41,11 @@
<PackageVersion Include="Roslynator.CodeAnalysis.Analyzers" Version="4.12.4" />
<PackageVersion Include="Roslynator.CodeFixes" Version="4.12.4" />
<PackageVersion Include="Roslynator.Refactorings" Version="4.12.4" />
</ItemGroup>
<ItemGroup>
<PackageVersion Include="GitVersion.Tool" Version="6.0.2" />
<PackageVersion Include="JetBrains.ReSharper.GlobalTools" Version="2024.2.3" />
<PackageVersion Include="Nuke.Common" Version="8.0.0" />
<PackageVersion Include="ReportGenerator" Version="5.3.9" />
<PackageVersion Include="Rocket.Surgery.Nuke" Version="1.8.36" />
</ItemGroup>
<ItemGroup>
<PackageVersion Include="AutoMapper" Version="13.0.1" />
<PackageVersion Include="AppAny.HotChocolate.FluentValidation" Version="0.11.2" />
<PackageVersion Include="FluentValidation" Version="11.9.2" />
Expand Down Expand Up @@ -72,7 +91,8 @@
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="8.0.8" />
<PackageVersion Include="Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions" Version="8.0.8" />
<PackageVersion Include="Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions"
Version="8.0.8" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="8.0.2" />
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" />
Expand Down Expand Up @@ -139,8 +159,6 @@
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.9.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Runtime" Version="1.9.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.9.0" />
</ItemGroup>
<ItemGroup>
<PackageVersion Include="Alba" Version="8.0.0" />
<PackageVersion Include="Bogus" Version="35.6.1" />
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
Expand All @@ -151,7 +169,8 @@
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
<PackageVersion Include="Rocket.Surgery.Extensions.Testing.FakeItEasy" Version="8.1.0-next.1" />
<PackageVersion Include="Rocket.Surgery.Extensions.Testing.XUnit" Version="8.1.0-next.1" />
<PackageVersion Include="Rocket.Surgery.Extensions.Testing.SourceGenerators" Version="8.1.0-next.1" />
<PackageVersion Include="Rocket.Surgery.Extensions.Testing.SourceGenerators"
Version="8.1.0-next.1" />
<PackageVersion Include="xunit" Version="2.9.0" />
<PackageVersion Include="xunit.analyzers" Version="1.16.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
Expand All @@ -162,7 +181,7 @@
<PackageVersion Include="Verify.SourceGenerators" Version="2.4.0" />
</ItemGroup>
<Import
Project="$(MSBuildThisFileDirectory)/Directory.Packages.support.props"
Condition="Exists('$(MSBuildThisFileDirectory)/Directory.Packages.support.props')"
/>
Project="$(MSBuildThisFileDirectory)/Directory.Packages.support.props"
Condition="Exists('$(MSBuildThisFileDirectory)/Directory.Packages.support.props')"
/>
</Project>
2 changes: 1 addition & 1 deletion NuGet.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<packageRestore>
<add key="enabled" value="True" />
Expand Down
13 changes: 11 additions & 2 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
# CONFIGURATION
###########################################################################

$IsCI = $env:CI -eq "true"
$BuildProjectFile = "$PSScriptRoot\.build\.build.csproj"
$TempDirectory = "$PSScriptRoot\\.nuke\temp"

Expand Down Expand Up @@ -63,7 +64,15 @@ else {
$env:DOTNET_EXE = "$DotNetDirectory\dotnet.exe"
}

Write-Output "Microsoft (R) .NET Core SDK version $(& $env:DOTNET_EXE --version)"
# only execute the build if not running in CI or if running in CI and the project has not been built
if ($IsCI) {
if (-not (Test-Path "$PSScriptRoot\.nuke\temp\ci")) {
ExecSafe { & $env:DOTNET_EXE build $BuildProjectFile /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet }
New-Item -Type File = "$PSScriptRoot\.nuke\temp\ci" | Out-Null
}
} else {
Write-Output "Microsoft (R) .NET Core SDK version $(& $env:DOTNET_EXE --version)"
ExecSafe { & $env:DOTNET_EXE build $BuildProjectFile /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet }
}

ExecSafe { & $env:DOTNET_EXE build $BuildProjectFile /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet }
ExecSafe { & $env:DOTNET_EXE run --project $BuildProjectFile --no-build -- $BuildArguments }
17 changes: 15 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
# CONFIGURATION
###########################################################################

IsCI=false
if [ "$CI" == "true" ]; then
IsCI=true
fi
BUILD_PROJECT_FILE="$SCRIPT_DIR/.build/.build.csproj"
TEMP_DIRECTORY="$SCRIPT_DIR//.nuke/temp"

Expand Down Expand Up @@ -56,7 +60,16 @@ else
export DOTNET_EXE="$DOTNET_DIRECTORY/dotnet"
fi

echo "Microsoft (R) .NET Core SDK version $("$DOTNET_EXE" --version)"

"$DOTNET_EXE" build "$BUILD_PROJECT_FILE" /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet
# only execute the build if not running in CI or if running in CI and the project has not been built
if [ "$IsCI" == "true" ]; then
if [ ! -f "$PSScriptRoot/.nuke/temp/ci" ]; then
"$DOTNET_EXE" build "$BUILD_PROJECT_FILE" /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet
touch "$PSScriptRoot/.nuke/temp/ci"
fi
else
echo "Microsoft (R) .NET Core SDK version $("$DOTNET_EXE" --version)"
"$DOTNET_EXE" build "$BUILD_PROJECT_FILE" /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet
fi

"$DOTNET_EXE" run --project "$BUILD_PROJECT_FILE" --no-build -- "$@"
Loading

0 comments on commit 01f13c6

Please sign in to comment.