Skip to content

Commit 43b2c07

Browse files
⚰️Remove checked-in tools requiring Git LFS (#1052)
GitHub currently charges $5 / month due to high bandwidth of downloading tools, of which most tools are not even used except NuGet.exe. Also, checkout requires everyone to have Git LFS plugin installed. ### Changes - Delete checked in Tools folder - Download NuGet.exe in `init.ps1` script to new `.tools` folder - Change `dotnet tool install` to use `.tools` folder - Ignore `.tools` folder in Git - Update init/build/clean scripts to use NuGet.exe in new location --------- Co-authored-by: Andreas Gullberg Larsen <[email protected]>
1 parent 9f6c315 commit 43b2c07

File tree

15 files changed

+59
-617
lines changed

15 files changed

+59
-617
lines changed

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,4 @@ Artifacts
258258

259259
# Build server tooling
260260
/secure-file
261-
/Tools/reportgenerator.exe
262-
/Tools/.store/
263-
/Tools/Temp
261+
/.tools/

Build/build-functions.psm1

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
$root = "$PSScriptRoot\.."
1+
$root = (Resolve-Path "$PSScriptRoot\..").Path
22
$artifactsDir = "$root\Artifacts"
3-
$nugetOutDir = "$root\Artifacts\NuGet"
4-
$logsDir = "$root\Artifacts\Logs"
5-
$testReportDir = "$root\Artifacts\TestResults"
6-
$testCoverageDir = "$root\Artifacts\Coverage"
7-
$nuget = "$root\Tools\NuGet.exe"
3+
$nugetOutDir = "$artifactsDir\NuGet"
4+
$logsDir = "$artifactsDir\Logs"
5+
$testReportDir = "$artifactsDir\TestResults"
6+
$testCoverageDir = "$artifactsDir\Coverage"
7+
$toolsDir = "$root\.tools"
8+
9+
$nuget = "$toolsDir\NuGet.exe"
810
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
911
$msbuildPath = & $vswhere -latest -products * -requires Microsoft.Component.MSBuild -property installationPath
12+
1013
if ($msbuildPath) {
11-
$msbuild = join-path $msbuildPath 'MSBuild\Current\Bin\MSBuild.exe'
1214
$msbuildx64 = join-path $msbuildPath 'MSBuild\Current\Bin\amd64\MSBuild.exe'
1315
}
1416

@@ -34,11 +36,7 @@ function Start-Build([boolean] $IncludeNanoFramework = $false) {
3436

3537
$fileLoggerArg = "/logger:FileLogger,Microsoft.Build;logfile=$logsDir\UnitsNet.msbuild.log"
3638

37-
$appVeyorLoggerDll = "C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
38-
$appVeyorLoggerNetCoreDll = "C:\Program Files\AppVeyor\BuildAgent\dotnetcore\Appveyor.MSBuildLogger.dll"
39-
$appVeyorLoggerArg = if (Test-Path "$appVeyorLoggerNetCoreDll") { "/logger:$appVeyorLoggerNetCoreDll" } else { "" }
40-
41-
dotnet build --configuration Release /p:ContinuousIntegrationBuild=true "$root\UnitsNet.sln" $fileLoggerArg $appVeyorLoggerArg
39+
dotnet build --configuration Release /p:ContinuousIntegrationBuild=true "$root\UnitsNet.sln" $fileLoggerArg
4240
if ($lastexitcode -ne 0) { exit 1 }
4341

4442
if (-not $IncludeNanoFramework)
@@ -49,12 +47,12 @@ function Start-Build([boolean] $IncludeNanoFramework = $false) {
4947
{
5048
write-host -foreground green "Build .NET nanoFramework."
5149
$fileLoggerArg = "/logger:FileLogger,Microsoft.Build;logfile=$logsDir\UnitsNet.NanoFramework.msbuild.log"
52-
$appVeyorLoggerArg = if (Test-Path "$appVeyorLoggerDll") { "/logger:$appVeyorLoggerDll" } else { "" }
5350

5451
# msbuild does not auto-restore nugets for this project type
5552
& "$nuget" restore "$root\UnitsNet.NanoFramework\GeneratedCode\UnitsNet.nanoFramework.sln"
53+
5654
# now build
57-
& "$msbuildx64" "$root\UnitsNet.NanoFramework\GeneratedCode\UnitsNet.nanoFramework.sln" /verbosity:minimal /p:Configuration=Release /p:Platform="Any CPU" /p:ContinuousIntegrationBuild=true $fileLoggerArg $appVeyorLoggerArg
55+
& "$msbuildx64" "$root\UnitsNet.NanoFramework\GeneratedCode\UnitsNet.nanoFramework.sln" /verbosity:minimal /p:Configuration=Release /p:Platform="Any CPU" /p:ContinuousIntegrationBuild=true $fileLoggerArg
5856
if ($lastexitcode -ne 0) { exit 1 }
5957
}
6058

@@ -95,7 +93,7 @@ function Start-Tests {
9593
}
9694

9795
# Generate a summarized code coverage report for all test projects
98-
& "Tools/reportgenerator.exe" -reports:"$root/Artifacts/Coverage/*.coverage.xml" -targetdir:"$root/Artifacts/Coverage" -reporttypes:HtmlSummary
96+
& "$toolsDir/reportgenerator.exe" -reports:"$testCoverageDir/*.coverage.xml" -targetdir:"$testCoverageDir" -reporttypes:HtmlSummary
9997

10098
write-host -foreground blue "Run tests...END`n"
10199
}

Build/build-pack-nano-nugets.psm1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
$root = "$PSScriptRoot\.."
1+
$root = (Resolve-Path "$PSScriptRoot\..").Path
22
$nugetOutDir = "$root\Artifacts\NuGet"
3-
$nuget = "$root\Tools\NuGet.exe"
3+
$toolsDir = "$root\.tools"
4+
$nuget = "$toolsDir\NuGet.exe"
45

56
function Invoke-BuildNanoNugets {
67

Build/clean.ps1

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
# Don't allow using undeclared variables
22
Set-Strictmode -version latest
33

4-
$root = "$PSScriptRoot\.."
4+
$root = (Resolve-Path "$PSScriptRoot\..").Path
5+
$artifactsDir = "$root\Artifacts"
6+
$toolsDir = "$root\.tools"
7+
8+
Write-Host -Foreground Blue "Delete .tools"
9+
Remove-Item -Recurse -Force -ErrorAction Ignore "$toolsDir"
10+
11+
Write-Host -Foreground Blue "Delete Artifacts"
12+
Remove-Item -Recurse -Force -ErrorAction Ignore "$artifactsDir"
13+
514
Write-Host -Foreground Blue "Delete dirs: bin, obj"
615

716
[int]$deleteCount = 0
@@ -20,8 +29,8 @@ if ($failedToDeleteDirs) {
2029
$failCount = $failedToDeleteDirs.Count
2130
Write-Host ""
2231
Write-Host -Foreground Red "Failed to delete $failCount dirs:"
23-
$failedToDeleteDirs | %{
32+
$failedToDeleteDirs | %{
2433
Write-Host -Foreground Red $_.FullName
2534
}
2635
exit /B 1
27-
}
36+
}

Build/init.ps1

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,27 @@
11
# Don't allow using undeclared variables
22
Set-Strictmode -version latest
33

4-
$root = "$PSScriptRoot\.."
4+
$root = (Resolve-Path "$PSScriptRoot\..").Path
5+
$nugetPath = "$root/.tools/NuGet.exe"
6+
57
Write-Host -Foreground Blue "Initializing..."
68

79
# Ensure temp dir exists
8-
$tempDir = "$root/Tools/Temp"
10+
$tempDir = "$root/.tools/temp_init"
911
[system.io.Directory]::CreateDirectory($tempDir) | out-null
1012

11-
if (-not (Test-Path "$root/Tools/reportgenerator.exe")) {
12-
Write-Host -Foreground Blue "Download dotnet-reportgenerator-globaltool..."
13-
dotnet tool install dotnet-reportgenerator-globaltool --tool-path Tools
14-
Write-Host -Foreground Green "Download dotnet-reportgenerator-globaltool...OK."
13+
# Report generator for unit test coverage reports.
14+
if (-not (Test-Path "$root/.tools/reportgenerator.exe")) {
15+
Write-Host -Foreground Blue "Install dotnet-reportgenerator-globaltool..."
16+
dotnet tool install dotnet-reportgenerator-globaltool --tool-path .tools
17+
Write-Host -Foreground Green "✅ Installed dotnet-reportgenerator-globaltool"
18+
}
19+
20+
# NuGet.exe for non-SDK style projects, like UnitsNet.nanoFramework.
21+
if (-not (Test-Path "$nugetPath")) {
22+
Write-Host -Foreground Blue "Downloading NuGet.exe..."
23+
Invoke-WebRequest -Uri https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -OutFile $nugetPath
24+
Write-Host -Foreground Green "✅ Downloaded NuGet.exe: $nugetPath"
1525
}
1626

1727
###################################################

CodeGen/Generators/NanoFrameworkGenerator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public static bool UpdateNanoFrameworkDependencies(
137137
{
138138
StartInfo = new ProcessStartInfo
139139
{
140-
FileName = Path.Combine(rootDir, "Tools/nuget.exe"),
140+
FileName = Path.Combine(rootDir, ".tools/nuget.exe"),
141141
Arguments = $"restore {path}\\UnitsNet.nanoFramework.sln",
142142
UseShellExecute = false,
143143
CreateNoWindow = true,
@@ -188,7 +188,7 @@ public static bool UpdateNanoFrameworkDependencies(
188188
{
189189
StartInfo = new ProcessStartInfo
190190
{
191-
FileName = Path.Combine(rootDir, "Tools/nuget.exe"),
191+
FileName = Path.Combine(rootDir, ".tools/NuGet.exe"),
192192
Arguments = $"update {path}\\UnitsNet.nanoFramework.sln -PreRelease",
193193
UseShellExecute = false,
194194
CreateNoWindow = true,

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ Read the wiki on [Serializing to JSON, XML and more](https://github.com/angulars
359359
360360
### Continuous Integration
361361

362-
[AppVeyor](https://ci.appveyor.com/project/angularsen/unitsnet) performs the following:
362+
[Azure DevOps](https://dev.azure.com/unitsnet/Units.NET/) performs the following:
363363
* Build and test all branches
364364
* Build and test pull requests, notifies on success or error
365365
* Deploy nugets on master branch, if nuspec versions changed

Tools/7-zip/7-zip.chm

-86.1 KB
Binary file not shown.

Tools/7-zip/7za.exe

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)