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
#1372)

* normalizing nuke dependencies

* normalizing nuke dependencies

* normalizing nuke dependencies

* normalizing nuke dependencies

* normalizing nuke dependencies

* normalizing nuke dependencies

* normalizing nuke dependencies

* normalizing nuke dependencies

* normalizing nuke dependencies

* normalizing nuke dependencies

* normalizing nuke dependencies

* normalizing nuke dependencies

* normalizing nuke dependencies

* normalizing nuke dependencies
  • Loading branch information
david-driscoll authored Sep 4, 2024
1 parent caecf9a commit fb42ae0
Show file tree
Hide file tree
Showing 30 changed files with 200 additions and 951 deletions.
17 changes: 0 additions & 17 deletions .appveyor.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .build/.build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace />
<RootNamespace />
<IsPackable>False</IsPackable>
<NoWarn>CS0649;CS0169</NoWarn>
</PropertyGroup>
Expand All @@ -12,7 +12,7 @@
<PackageReference Include="GitVersion.Tool" ExcludeAssets="All" />
<PackageReference Include="ReportGenerator" ExcludeAssets="All" />
<PackageReference Include="Rocket.Surgery.Nuke" />
<PackageReference Include="NuGet.ProjectModel" />
<PackageReference Include="NuGet.ProjectModel" />
</ItemGroup>

<ItemGroup>
Expand Down
51 changes: 20 additions & 31 deletions .build/Build.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using JetBrains.Annotations;
using Nuke.Common;
using Nuke.Common.CI;
using Nuke.Common.Execution;
Expand All @@ -13,7 +12,6 @@
[UnsetVisualStudioEnvironmentVariables]
[PackageIcon("https://raw.githubusercontent.com/RocketSurgeonsGuild/graphics/master/png/social-square-thrust-rounded.png")]
//[EnsureGitHooks(GitHook.PreCommit)]
[EnsureReadmeIsUpdated("Readme.md")]
[DotNetVerbosityMapping]
[MSBuildVerbosityMapping]
[NuGetVerbosityMapping]
Expand All @@ -26,13 +24,11 @@ public partial class Pipeline : NukeBuild,
ICanPackWithDotNetCore,
IHaveDataCollector,
ICanClean,
ICanLintStagedFiles,
ICanDotNetFormat,
ICanUpdateReadme,
IHaveCommonLintTargets,
// IHavePublicApis,
IGenerateCodeCoverageReport,
IGenerateCodeCoverageSummary,
IGenerateCodeCoverageBadges,
ICanRegenerateBuildConfiguration,
IHaveConfiguration<Configuration>

{
Expand All @@ -43,39 +39,32 @@ public partial class Pipeline : NukeBuild,
/// - Microsoft VisualStudio https://nuke.build/visualstudio
/// - Microsoft VSCode https://nuke.build/vscode
/// </summary>
public static int Main()
{
return Execute<Pipeline>(x => x.Default);
}
public static int Main() => Execute<Pipeline>(x => x.Default);

public Target Default => _ => _
.DependsOn(Restore)
.DependsOn(Build)
.DependsOn(Test)
.DependsOn(Pack);

[OptionalGitRepository]
public GitRepository? GitRepository { get; }
public Target Build => _ => _;
public Target Pack => _ => _;
public Target Clean => _ => _;
public Target Lint => _ => _.Inherit<ICanLint>(x => x.Lint);
public Target Restore => _ => _;
public Target Test => _ => _;

[Solution(GenerateProjects = true)]
private Solution Solution { get; } = null!;

public Target Build => _ => _.Inherit<ICanBuildWithDotNetCore>(x => x.CoreBuild);

public Target Pack => _ => _
.Inherit<ICanPackWithDotNetCore>(x => x.CorePack)
.DependsOn(Clean)
.After(Test);
/// <summary>
/// Only run the JetBrains cleanup code when running on the server
/// </summary>
public Target JetBrainsCleanupCode => _ => _
.Inherit<ICanDotNetFormat>(x => x.JetBrainsCleanupCode)
.OnlyWhenStatic(() => IsServerBuild);

public Target Clean => _ => _.Inherit<ICanClean>(x => x.Clean);
public Target Restore => _ => _.Inherit<ICanRestoreWithDotNetCore>(x => x.CoreRestore);
[Solution(GenerateProjects = true)] private Solution Solution { get; } = null!;
Nuke.Common.ProjectModel.Solution IHaveSolution.Solution => Solution;

[ComputedGitVersion]
public GitVersion GitVersion { get; } = null!;

public Target Test => _ => _.Inherit<ICanTestWithDotNetCore>(x => x.CoreTest);

[Parameter("Configuration to build")]
public Configuration Configuration { get; } = IsLocalBuild ? Configuration.Debug : Configuration.Release;
}
[OptionalGitRepository] public GitRepository? GitRepository { get; }
[GitVersion(NoFetch = true, NoCache = false)] public GitVersion GitVersion { get; } = null!;
[Parameter("Configuration to build")] public Configuration Configuration { get; } = IsLocalBuild ? Configuration.Debug : Configuration.Release;
}
26 changes: 19 additions & 7 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,43 @@
"tools": {
"gitversion.tool": {
"version": "6.0.2",
"commands": ["dotnet-gitversion"]
"commands": ["dotnet-gitversion"],
"rollForward": false
},
"dotnet-reportgenerator-globaltool": {
"version": "5.3.9",
"commands": ["reportgenerator"]
"commands": ["reportgenerator"],
"rollForward": false
},
"nuke.globaltool": {
"version": "8.0.0",
"commands": ["nuke"]
"commands": ["nuke"],
"rollForward": false
},
"codecov.tool": {
"version": "1.13.0",
"commands": ["codecov"]
"commands": ["codecov"],
"rollForward": false
},
"jetbrains.resharper.globaltools": {
"version": "2024.2.3",
"commands": ["jb"]
"commands": ["jb"],
"rollForward": false
},
"nukeeper": {
"version": "0.35.0",
"commands": ["nukeeper"]
"commands": ["nukeeper"],
"rollForward": false
},
"dotnet-outdated-tool": {
"version": "4.6.4",
"commands": ["dotnet-outdated"]
"commands": ["dotnet-outdated"],
"rollForward": false
},
"husky": {
"version": "0.7.1",
"commands": ["husky"],
"rollForward": false
}
}
}
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,19 +118,19 @@ jobs:
- name: 🎁 Restore
id: restore
run: |
dotnet nuke Restore --skip
dotnet nuke DotnetCoreRestore Restore --skip
- name: ⚙️ Build
id: build
run: |
dotnet nuke Build --skip
dotnet nuke DotnetCoreBuild Build --skip
- name: 🚦 Test
id: test
run: |
dotnet nuke Test TriggerCodeCoverageReports GenerateCodeCoverageReportCobertura GenerateCodeCoverageBadges GenerateCodeCoverageSummary GenerateCodeCoverageReport --skip
dotnet nuke DotnetCoreTest Test TriggerCodeCoverageReports GenerateCodeCoverageReportCobertura GenerateCodeCoverageBadges GenerateCodeCoverageSummary GenerateCodeCoverageReport --skip
- name: 📦 Pack
id: pack
run: |
dotnet nuke Pack --skip
dotnet nuke DotnetCorePack Pack --skip
- name: 🏺 Publish coverage data
if: always()
uses: actions/[email protected]
Expand Down
47 changes: 40 additions & 7 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ jobs:
id: commit-message
run: |
echo "message=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT"
- name: npm ci
run: |
npm ci --ignore-scripts
- name: 🔨 Use .NET Core 6.0 SDK
uses: actions/setup-dotnet@v4
with:
Expand All @@ -74,18 +71,54 @@ jobs:
- name: ⚒️ dotnet tool restore
run: |
dotnet tool restore
- name: 🎁 Restore
id: restore
run: |
dotnet nuke DotnetCoreRestore Restore --skip
- name: Lint
id: lint
run: |
dotnet nuke Lint --skip
- name: Regenerate Build Configurations
id: regenerateBuildConfigurations
run: |
dotnet nuke RegenerateBuildConfigurations --skip
- name: Lint Staged
id: lintStaged
- name: Lint Public Api Analyzers
id: lintPublicApiAnalyzers
run: |
dotnet nuke LintPublicApiAnalyzers --skip
- name: Prettier
id: prettier
run: |
dotnet nuke Prettier --skip
- name: Dotnet Format
id: dotnetFormat
run: |
dotnet nuke DotnetFormat --skip
- name: Jet Brains Cleanup Code
id: jetBrainsCleanupCode
run: |
dotnet nuke JetBrainsCleanupCode --skip
- name: Generate Solution Items
id: generateSolutionItems
run: |
dotnet nuke GenerateSolutionItems --skip
- name: Generate Readme
id: generateReadme
run: |
dotnet nuke GenerateReadme --skip
- name: Move Unshipped to Shipped
id: moveUnshippedToShipped
run: |
dotnet nuke MoveUnshippedToShipped --skip
- name: Lint Git Add
id: lintGitAdd
run: |
dotnet nuke LintStaged --skip
dotnet nuke LintGitAdd --skip
- name: Add & Commit
env:
GITHUB_TOKEN: '${{ secrets.RSG_BOT_TOKEN }}'
if: "'${{ steps.commit-message.outputs.message }}' == 'Automatically linting code'"
if: "contains('${{ steps.commit-message.outputs.message }}', 'Automatically linting code')"
uses: planetscale/[email protected]
with:
commit_message: 'Automatically linting code'
Expand Down
7 changes: 2 additions & 5 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

output=$(git diff --cached --name-only | wc -l)
if [ $output -gt 0 ]; then
dotnet nuke lint-staged
fi

dotnet nuke lint
dotnet husky run --group pre-commit
5 changes: 5 additions & 0 deletions .husky/task-runner.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "https://alirezanet.github.io/Husky.Net/schema.json",
"variables": [],
"tasks": []
}
9 changes: 0 additions & 9 deletions .lintstagedrc.js

This file was deleted.

36 changes: 24 additions & 12 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,26 +89,32 @@
"enum": [
"Build",
"Clean",
"CoreBuild",
"CorePack",
"CoreRestore",
"CoreTest",
"CleanWellKnownTemporaryFiles",
"Default",
"DotNetFormat",
"DotnetCoreBuild",
"DotnetCorePack",
"DotnetCoreRestore",
"DotnetCoreTest",
"DotnetFormat",
"DotnetToolRestore",
"GenerateCodeCoverageBadges",
"GenerateCodeCoverageReport",
"GenerateCodeCoverageReportCobertura",
"GenerateCodeCoverageSummary",
"GenerateReadme",
"GenerateSolutionItems",
"HuskyLint",
"JetBrainsCleanupCode",
"Lint",
"LintGitAdd",
"LintStaged",
"LintPublicApiAnalyzers",
"MoveUnshippedToShipped",
"Pack",
"PostLint",
"Prettier",
"RegenerateBuildConfigurations",
"Restore",
"ShipPublicApis",
"Test",
"TriggerCodeCoverageReports"
]
Expand All @@ -126,26 +132,32 @@
"enum": [
"Build",
"Clean",
"CoreBuild",
"CorePack",
"CoreRestore",
"CoreTest",
"CleanWellKnownTemporaryFiles",
"Default",
"DotNetFormat",
"DotnetCoreBuild",
"DotnetCorePack",
"DotnetCoreRestore",
"DotnetCoreTest",
"DotnetFormat",
"DotnetToolRestore",
"GenerateCodeCoverageBadges",
"GenerateCodeCoverageReport",
"GenerateCodeCoverageReportCobertura",
"GenerateCodeCoverageSummary",
"GenerateReadme",
"GenerateSolutionItems",
"HuskyLint",
"JetBrainsCleanupCode",
"Lint",
"LintGitAdd",
"LintStaged",
"LintPublicApiAnalyzers",
"MoveUnshippedToShipped",
"Pack",
"PostLint",
"Prettier",
"RegenerateBuildConfigurations",
"Restore",
"ShipPublicApis",
"Test",
"TriggerCodeCoverageReports"
]
Expand Down
4 changes: 3 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
Tags
-->
<LangVersion>preview</LangVersion>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<Features>strict</Features>
<Nullable>enable</Nullable>
<AnalysisMode>AllEnabledByDefault</AnalysisMode>
Expand Down Expand Up @@ -47,6 +46,9 @@
<ProjectCapability Include="DynamicFileNesting" />
</ItemGroup>
<ItemGroup>
<Using Include="JetBrains.Annotations" />
<Using Include="System.Diagnostics.CodeAnalysis" />
<Using Include="System.Diagnostics.CodeAnalysis.NotNullAttribute" Alias="NotNullAttribute" />
<Using Include="System.Collections.Concurrent" />
</ItemGroup>
</Project>
Loading

0 comments on commit fb42ae0

Please sign in to comment.