diff --git a/Fabulous.XamarinForms/extensions/Maps/Fabulous.XamarinForms.Maps.nuspec b/Fabulous.XamarinForms/extensions/Maps/Fabulous.XamarinForms.Maps.nuspec new file mode 100644 index 000000000..c38837391 --- /dev/null +++ b/Fabulous.XamarinForms/extensions/Maps/Fabulous.XamarinForms.Maps.nuspec @@ -0,0 +1,22 @@ + + + + Fabulous.XamarinForms.Maps + Fabulous.XamarinForms.Maps + 0.0.1 + Fabulous contributors + Fabulous extension for Xamarin.Forms.Maps + https://fsprojects.github.io/Fabulous/ + + Apache-2.0 + Copyright 2018 + Maps;Xamarin.Forms;Fabulous;F#;Elmish;Elm + + + + + + + + + \ No newline at end of file diff --git a/Fabulous.XamarinForms/extensions/OxyPlot/Fabulous.XamarinForms.OxyPlot.nuspec b/Fabulous.XamarinForms/extensions/OxyPlot/Fabulous.XamarinForms.OxyPlot.nuspec new file mode 100644 index 000000000..15a38a333 --- /dev/null +++ b/Fabulous.XamarinForms/extensions/OxyPlot/Fabulous.XamarinForms.OxyPlot.nuspec @@ -0,0 +1,22 @@ + + + + Fabulous.XamarinForms.OxyPlot + Fabulous.XamarinForms.OxyPlot + 0.0.1 + Fabulous contributors + Fabulous extension for OxyPlot + https://fsprojects.github.io/Fabulous/ + + Apache-2.0 + Copyright 2018 + OxyPlot;Charting;2D;Xamarin.Forms;Fabulous;F#;Elmish;Elm + + + + + + + + + \ No newline at end of file diff --git a/Fabulous.XamarinForms/extensions/SkiaSharp/Fabulous.XamarinForms.SkiaSharp.nuspec b/Fabulous.XamarinForms/extensions/SkiaSharp/Fabulous.XamarinForms.SkiaSharp.nuspec new file mode 100644 index 000000000..c0fa03e66 --- /dev/null +++ b/Fabulous.XamarinForms/extensions/SkiaSharp/Fabulous.XamarinForms.SkiaSharp.nuspec @@ -0,0 +1,22 @@ + + + + Fabulous.XamarinForms.SkiaSharp + Fabulous.XamarinForms.SkiaSharp + 0.0.1 + Fabulous contributors + Fabulous extension for SkiaSharp + https://fsprojects.github.io/Fabulous/ + + Apache-2.0 + Copyright 2018 + SkiaSharp;Drawing;2D;Xamarin.Forms;Fabulous;F#;Elmish;Elm + + + + + + + + + \ No newline at end of file diff --git a/Fabulous.XamarinForms/extensions/VideoManager/Fabulous.XamarinForms.VideoManager.nuspec b/Fabulous.XamarinForms/extensions/VideoManager/Fabulous.XamarinForms.VideoManager.nuspec new file mode 100644 index 000000000..f163b098f --- /dev/null +++ b/Fabulous.XamarinForms/extensions/VideoManager/Fabulous.XamarinForms.VideoManager.nuspec @@ -0,0 +1,22 @@ + + + + Fabulous.XamarinForms.VideoManager + Fabulous.XamarinForms.VideoManager + 0.0.1 + Fabulous contributors + Fabulous extension for VideoManager + https://fsprojects.github.io/Fabulous/ + + Apache-2.0 + Copyright 2018 + VideoManager;Audio;Video;Player;Xamarin.Forms;Fabulous;F#;Elmish;Elm + + + + + + + + + \ No newline at end of file diff --git a/build.fsx b/build.fsx index b34877f4f..6308e6921 100644 --- a/build.fsx +++ b/build.fsx @@ -85,21 +85,16 @@ let nugetPack paths = ReleaseNotes = (String.toLines release.Notes) }) nuspecPath /// Replaces the value of attribute in an xml node in the XML document specified by a XPath expression. -let replaceXPathAttributeNS xpath (attribute:string) value (namespaces : #seq) (doc : System.Xml.XmlDocument) = +let replaceXPathAttributeNSIfExists xpath (attribute:string) value (namespaces : #seq) (doc : System.Xml.XmlDocument) = let nsmgr = System.Xml.XmlNamespaceManager(doc.NameTable) namespaces |> Seq.iter nsmgr.AddNamespace let node = doc.SelectSingleNode(xpath, nsmgr) - if isNull node then - failwithf "XML node '%s' not found" xpath - else + if not (isNull node) then let attributeValue = node.Attributes.[attribute] - if isNull attributeValue then - failwithf "XML node '%s' does not have attribute '%s'" xpath attribute - else + if not (isNull attributeValue) then attributeValue.Value <- value doc - Target.create "Clean" (fun _ -> Shell.cleanDir buildDir ) @@ -151,11 +146,17 @@ Target.create "UpdateVersion" (fun _ -> |> (fun o -> JsonConvert.SerializeObject(o, Formatting.Indented)) |> File.writeString false template - // Updates Fabulous.XamarinForms.nuspec - let nuspec = "Fabulous.XamarinForms/src/Fabulous.XamarinForms.nuspec" - Xml.loadDoc nuspec - |> replaceXPathAttributeNS "//x:package/x:metadata/x:dependencies/x:dependency[@id=\"Fabulous\"]" "version" release.NugetVersion [ "x", "http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd" ] - |> Xml.saveDoc nuspec + // Updates nuspec files + let updateVersionInNuSpecs files = + for nuspec in files do + Xml.loadDoc nuspec + |> replaceXPathAttributeNSIfExists "//x:package/x:metadata/x:dependencies/x:dependency[@id=\"Fabulous\"]" "version" release.NugetVersion [ "x", "http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd" ] + |> replaceXPathAttributeNSIfExists "//x:package/x:metadata/x:dependencies/x:dependency[@id=\"Fabulous.XamarinForms\"]" "version" release.NugetVersion [ "x", "http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd" ] + |> Xml.saveDoc nuspec + + !! "Fabulous.XamarinForms/src/Fabulous.XamarinForms.nuspec" + ++ "Fabulous.XamarinForms/extensions/**/*.nuspec" + |> updateVersionInNuSpecs ) Target.create "BuildTools" (fun _ -> @@ -231,8 +232,8 @@ Target.create "PackFabulousXamarinFormsTemplates" (fun _ -> ) Target.create "PackFabulousXamarinFormsExtensions" (fun _ -> - !! "Fabulous.XamarinForms/extensions/**/*.fsproj" - |> dotnetPack + !! "Fabulous.XamarinForms/extensions/**/*.nuspec" + |> nugetPack ) Target.create "PackFabulousStaticView" (fun _ ->