Skip to content

Commit

Permalink
Workaround dotnet/sourcelink#91 by removing Reproducible build when S…
Browse files Browse the repository at this point in the history
…ourceLink is disabled.
  • Loading branch information
olivier-spinelli committed Aug 30, 2019
1 parent 0b38e10 commit c5e273c
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions CK.Env.Plugin.Basics/Common/SharedPropsFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,23 +134,32 @@ void HandleBasicDefinitions( IActivityMonitor m )
void HandleReproducibleBuilds( IActivityMonitor m )
{
const string sectionName = "ReproducibleBuilds";
var section = XCommentSection.FindOrCreate( Document.Root, sectionName, false );
if( section == null )
// This may be temporary: see https://github.com/dotnet/sourcelink/issues/91
// For the moment, when SourceLink is disabled, we also disable the reproducible builds.
if( _solutionSpec.DisableSourceLink )
{
// Removes previously non sectioned property group.
Document.Root.Elements( "PropertyGroup" ).Where( e => e.Element( "CKliWorldPath" ) != null )
.Select( e => e.ClearCommentsBeforeAndNewLineAfter() )
.Remove();
section = XCommentSection.FindOrCreate( Document.Root, sectionName, true );
XCommentSection.FindOrCreate( Document.Root, sectionName, false )?.Remove();
}
section.StartComment = ": See http://blog.paranoidcoding.com/2016/04/05/deterministic-builds-in-roslyn.html.";
section.SetContent(
XElement.Parse(
else
{
var section = XCommentSection.FindOrCreate( Document.Root, sectionName, false );
if( section == null )
{
// Removes previously non sectioned property group.
Document.Root.Elements( "PropertyGroup" ).Where( e => e.Element( "CKliWorldPath" ) != null )
.Select( e => e.ClearCommentsBeforeAndNewLineAfter() )
.Remove();
section = XCommentSection.FindOrCreate( Document.Root, sectionName, true );
}
section.StartComment = ": See http://blog.paranoidcoding.com/2016/04/05/deterministic-builds-in-roslyn.html.";
section.SetContent(
XElement.Parse(
$@"<PropertyGroup Condition="" '$(CakeBuild)' == 'true' "">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
<Deterministic>true</Deterministic>
<PathMap>'$(SolutionDir)'=C:\CKli-World\{GitFolder.SubPath.Path.Replace( '/', '\\' )}</PathMap>
</PropertyGroup>" ) );
}
}

void HandleZeroVersion( IActivityMonitor m )
Expand Down

0 comments on commit c5e273c

Please sign in to comment.