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

Switch to DotNet.ReproducibleBuilds #55

Merged
merged 2 commits into from
Sep 23, 2022
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
12 changes: 1 addition & 11 deletions Source/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

<PropertyGroup Label="Build">
<!--<GenerateDocumentationFile>true</GenerateDocumentationFile>-->
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>

<!-- TODO: Disable strong name signing until Spectre.Console supports it in https://github.com/spectreconsole/spectre.console/issues/481.
Expand All @@ -13,17 +12,8 @@
<AssemblyOriginatorKeyFile>../../Key.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>-->

<PropertyGroup Label="Source Link">
<!-- Optional: Declare that the Repository URL can be published to NuSpec -->
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<!-- Optional: Embed source files that are not tracked by the source control manager to the PDB -->
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<!-- Optional: Include PDB in the built .nupkg -->
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>

<ItemGroup Label="Package References">
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="all" Version="1.1.1" />
<PackageReference Include="DotNet.ReproducibleBuilds" PrivateAssets="all" Version="1.1.1" />
</ItemGroup>

<ItemGroup Label="Files">
Expand Down
2 changes: 1 addition & 1 deletion Source/DotnetNewUI/DotnetNewUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<PackageReference Include="Nito.AsyncEx" Version="5.1.2" />
<PackageReference Include="NuGet.Versioning" Version="6.3.0" />
<PackageReference Include="SimpleExec" Version="11.0.0" />
<PackageReference Include="Spectre.Console" Version="0.44.0" />
<PackageReference Include="Spectre.Console" Version="0.45.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
<PackageReference Include="System.CommandLine.Hosting" Version="0.4.0-alpha.22272.1" />
Expand Down
5 changes: 1 addition & 4 deletions Source/DotnetNewUI/Services/PackagesService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ public PackagesService(INuGetClient nuGetClient, DotNetCli dotNetCli)

public async Task<IReadOnlyList<NuGetPackageInfo>> GetTemplatePackagesAsync()
{
if (this.cachedOnlinePackages is null)
{
this.cachedOnlinePackages = this.nuGetClient.GetNuGetTemplatesAsync();
}
this.cachedOnlinePackages ??= this.nuGetClient.GetNuGetTemplatesAsync();

var onlineTemplatePackages = await this.cachedOnlinePackages.ConfigureAwait(false);
var builtInTemplatePackages = await BuiltInTemplatePackageProvider.GetAllTemplatePackagesAsync(this.dotNetCli).ConfigureAwait(false);
Expand Down
40 changes: 21 additions & 19 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -57,26 +57,28 @@ Task("Build")

Task("Test")
.Description("Runs unit tests and outputs test results to the artefacts directory.")
.DoesForEach(GetFiles("./Tests/**/*.csproj"), project =>
{
DotNetTest(
project.ToString(),
new DotNetTestSettings()
{
Blame = true,
Collectors = new string[] { "Code Coverage", "XPlat Code Coverage" },
Configuration = configuration,
Loggers = new string[]
.DoesForEach(
GetFiles("./Tests/**/*.csproj"),
project =>
{
DotNetTest(
project.ToString(),
new DotNetTestSettings()
{
$"trx;LogFileName={project.GetFilenameWithoutExtension()}.trx",
$"junit;LogFileName={project.GetFilenameWithoutExtension()}.xml",
$"html;LogFileName={project.GetFilenameWithoutExtension()}.html",
},
NoBuild = true,
NoRestore = true,
ResultsDirectory = artefactsDirectory,
});
});
Blame = true,
Collectors = new string[] { "Code Coverage", "XPlat Code Coverage" },
Configuration = configuration,
Loggers = new string[]
{
$"trx;LogFileName={project.GetFilenameWithoutExtension()}.trx",
$"junit;LogFileName={project.GetFilenameWithoutExtension()}.xml",
$"html;LogFileName={project.GetFilenameWithoutExtension()}.html",
},
NoBuild = true,
NoRestore = true,
ResultsDirectory = artefactsDirectory,
});
});

Task("Pack")
.Description("Creates NuGet packages and outputs them to the artefacts directory.")
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"sdk": {
"allowPrerelease": false,
"rollForward": "latestMajor",
"version": "6.0.300"
"version": "6.0.401"
}
}