Skip to content
This repository was archived by the owner on Jun 20, 2023. It is now read-only.

Commit cf8e8b8

Browse files
committed
Fix proguard file addition to nuspec
1 parent 01c5d48 commit cf8e8b8

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

build.cake

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ Task ("nuget-setup").IsDependentOn ("buildtasks").IsDependentOn ("externals")
340340

341341
projElem.Add (new System.Xml.Linq.XElement (nsTargets + "ItemGroup",
342342
new System.Xml.Linq.XElement (nsTargets + "ProguardConfiguration",
343-
new System.Xml.Linq.XAttribute (nsTargets + "Include", "$(MSBuildThisFileDirectory)..\\proguard\\proguard.txt"))));
343+
new System.Xml.Linq.XAttribute ("Include", "$(MSBuildThisFileDirectory)..\\proguard\\proguard.txt"))));
344344
}
345345

346346
xTargets.Save (MakeAbsolute(targetsFile).FullPath);
@@ -366,15 +366,16 @@ Task ("nuget-setup").IsDependentOn ("buildtasks").IsDependentOn ("externals")
366366
var xNuspec = System.Xml.Linq.XDocument.Load (MakeAbsolute(nuspecFile).FullPath);
367367
System.Xml.Linq.XNamespace nsNuspec = xNuspec.Root.Name.Namespace;
368368

369-
// // Check if we have a proguard.txt file for this artifact and include it in the nuspec if so
370-
// if (FileExists (proguardFile)) {
371-
// var filesElem = xNuspec.Root.Descendants (nsNuspec + "files")?.FirstOrDefault();
372-
// filesElem.Add (new System.Xml.Linq.XElement (nsNuspec + "file",
373-
// new System.Xml.Linq.XAttribute(nsNuspec + "src", proguardFile.ToString()),
374-
// new System.Xml.Linq.XAttribute(nsNuspec + "target", "proguard/proguard.txt")));
375-
// }
369+
// Check if we have a proguard.txt file for this artifact and include it in the nuspec if so
370+
if (FileExists (proguardFile)) {
371+
Information ("Adding {0} to {1}", "proguard.txt", nuspecFile);
372+
var filesElem = xNuspec.Root.Descendants (nsNuspec + "files")?.FirstOrDefault();
373+
filesElem.Add (new System.Xml.Linq.XElement (nsNuspec + "file",
374+
new System.Xml.Linq.XAttribute(nsNuspec + "src", proguardFile.ToString()),
375+
new System.Xml.Linq.XAttribute(nsNuspec + "target", "proguard/proguard.txt")));
376+
}
376377

377-
// xNuspec.Save(MakeAbsolute(new FilePath(art.ArtifactId + "/nuget/" + art.NugetId + ".nuspec")).FullPath);
378+
xNuspec.Save(MakeAbsolute(nuspecFile).FullPath);
378379
}
379380
});
380381

0 commit comments

Comments
 (0)