Skip to content

Commit

Permalink
Build cleanup and Verify (#102)
Browse files Browse the repository at this point in the history
* Make builds deterministic and completely source-linked

#100
  • Loading branch information
Romanx authored May 23, 2020
1 parent c7016be commit 73ded35
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 31 deletions.
4 changes: 4 additions & 0 deletions Stubble.Core.sln
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{954BAA8A-FA49-4952-A841-4C57B0A10869}"
ProjectSection(SolutionItems) = preProject
src\Directory.Build.props = src\Directory.Build.props
src\Directory.Build.targets = src\Directory.Build.targets
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{A02DCD25-5393-49B8-BFD2-1C49845CFEE1}"
EndProject
Expand Down
7 changes: 7 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project>
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
<Deterministic>true</Deterministic>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>
</Project>
15 changes: 15 additions & 0 deletions src/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project>
<!-- workaround for deterministic builds; see https://github.com/clairernovotny/DeterministicBuilds -->
<PropertyGroup>
<TargetFrameworkMonikerAssemblyAttributesPath>$([System.IO.Path]::Combine('$(IntermediateOutputPath)','$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)'))</TargetFrameworkMonikerAssemblyAttributesPath>
</PropertyGroup>
<ItemGroup>
<EmbeddedFiles Include="$(GeneratedAssemblyInfoFile)"/>
</ItemGroup>
<ItemGroup>
<AdditionalFiles Include="..\..\stylecop.json" Link="stylecop.json" />
<AdditionalFiles Include="..\..\version.json" Link="version.json" />
<None Include="..\..\licence.md" Pack="true" Visible="false" PackagePath=""/>
<None Include="..\..\assets\logo-128.png" Pack="true" PackagePath="\"/>
</ItemGroup>
</Project>
16 changes: 6 additions & 10 deletions src/Stubble.Compilation/Stubble.Compilation.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@
<Copyright>Copyright © 2017</Copyright>
<Version>1.0.0</Version>
<RepositoryUrl>https://github.com/stubbleorg/stubble</RepositoryUrl>
<PackageIconUrl>https://raw.githubusercontent.com/StubbleOrg/Stubble/master/assets/logo-64.png</PackageIconUrl>
<PackageIconUrl>https://raw.githubusercontent.com/StubbleOrg/Stubble/master/assets/logo-128.png</PackageIconUrl>
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
<GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
<PackageProjectUrl>https://github.com/stubbleorg/stubble</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/StubbleOrg/Stubble/blob/master/licence.md</PackageLicenseUrl>
<PackageLicenseFile>licence.md</PackageLicenseFile>
<PackageIcon>logo-128.png</PackageIcon>
<Platform>Any CPU</Platform>
<RootNamespace>Stubble.Compilation</RootNamespace>
<DebugType>portable</DebugType>
Expand All @@ -33,11 +34,6 @@
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>

<ItemGroup>
<AdditionalFiles Include="..\..\stylecop.json" Link="stylecop.json" />
<AdditionalFiles Include="..\..\version.json" Link="version.json" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
Expand All @@ -48,7 +44,7 @@
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="Microsoft.CSharp" Version="4.5.0" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
</ItemGroup>

<ItemGroup>
Expand All @@ -57,8 +53,8 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="Nerdbank.GitVersioning" Version="2.3.183" PrivateAssets="All" />
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2" PrivateAssets="All" />
<PackageReference Include="Nerdbank.GitVersioning" Version="3.1.91" PrivateAssets="All" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
Expand Down
19 changes: 7 additions & 12 deletions src/Stubble.Core/Stubble.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@
<Copyright>Copyright © 2017</Copyright>
<Version>1.0.0</Version>
<RepositoryUrl>https://github.com/stubbleorg/stubble</RepositoryUrl>
<PackageIconUrl>https://raw.githubusercontent.com/StubbleOrg/Stubble/master/assets/logo-64.png</PackageIconUrl>
<PackageIconUrl>https://raw.githubusercontent.com/StubbleOrg/Stubble/master/assets/logo-128.png</PackageIconUrl>
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
<GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
<PackageProjectUrl>https://github.com/stubbleorg/stubble</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/StubbleOrg/Stubble/blob/master/licence.md</PackageLicenseUrl>
<PackageLicenseFile>licence.md</PackageLicenseFile>
<PackageIcon>logo-128.png</PackageIcon>
<Platform>Any CPU</Platform>
<DebugType>portable</DebugType>
<LangVersion>latest</LangVersion>
Expand All @@ -36,11 +37,6 @@
<NoWarn>1701;1702;1705;1591</NoWarn>
</PropertyGroup>

<ItemGroup>
<AdditionalFiles Include="..\..\stylecop.json" Link="stylecop.json" />
<AdditionalFiles Include="..\..\version.json" Link="version.json" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
Expand All @@ -51,8 +47,7 @@
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="Microsoft.CSharp" Version="4.5.0" />
<!--<PackageReference Include="System.Reflection.TypeExtensions" Version="4.4.0" />-->
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
</ItemGroup>

<ItemGroup>
Expand All @@ -61,10 +56,10 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.1" />
<PackageReference Include="Nerdbank.GitVersioning" Version="2.3.183" PrivateAssets="All" />
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2" PrivateAssets="All" />
<PackageReference Include="Nerdbank.GitVersioning" Version="3.1.91" PrivateAssets="All" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />
<PackageReference Include="System.Collections.Immutable" Version="1.5.0" />
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.1" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Collections.Specialized" Version="4.3.0" />
<PackageReference Include="coverlet.msbuild" Version="2.6.3">
<PackageReference Include="coverlet.msbuild" Version="2.8.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
6 changes: 3 additions & 3 deletions test/Stubble.Core.Benchmark/Stubble.Core.Benchmark.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.11.5" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.11.5" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="BenchmarkDotNet" Version="0.12.1" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.12.1" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Nustache" Version="1.16.0.8" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0">
<PrivateAssets>all</PrivateAssets>
Expand Down
6 changes: 3 additions & 3 deletions test/Stubble.Core.Tests/Stubble.Core.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="2.6.3">
<PackageReference Include="coverlet.msbuild" Version="2.8.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="5.10.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
<PrivateAssets>all</PrivateAssets>
Expand Down

0 comments on commit 73ded35

Please sign in to comment.