Skip to content

Commit

Permalink
Merge pull request #503 from TimLariviere/fix-extensions-dependencies
Browse files Browse the repository at this point in the history
Fix extensions dependencies on NuGet
  • Loading branch information
TimLariviere authored Jul 7, 2019
2 parents 8085916 + 10925a3 commit c837a12
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>Fabulous.XamarinForms.Maps</id>
<title>Fabulous.XamarinForms.Maps</title>
<version>0.0.1</version>
<authors>Fabulous contributors</authors>
<description>Fabulous extension for Xamarin.Forms.Maps</description>
<projectUrl>https://fsprojects.github.io/Fabulous/</projectUrl>
<repository type="git" url="https://github.com/fsprojects/Fabulous" />
<license type="expression">Apache-2.0</license>
<copyright>Copyright 2018</copyright>
<tags>Maps;Xamarin.Forms;Fabulous;F#;Elmish;Elm</tags>
<dependencies>
<dependency id="Fabulous.XamarinForms" version="0.40.0" />
</dependencies>
</metadata>
<files>
<file src="..\..\..\build_output\Fabulous.XamarinForms\Extensions\Fabulous.XamarinForms.Maps\Fabulous.XamarinForms.Maps.dll" target="lib\netstandard2.0\Fabulous.XamarinForms.Maps.dll" />
<file src="..\..\..\build_output\Fabulous.XamarinForms\Extensions\Fabulous.XamarinForms.Maps\Fabulous.XamarinForms.Maps.pdb" target="lib\netstandard2.0\Fabulous.XamarinForms.Maps.pdb" />
</files>
</package>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>Fabulous.XamarinForms.OxyPlot</id>
<title>Fabulous.XamarinForms.OxyPlot</title>
<version>0.0.1</version>
<authors>Fabulous contributors</authors>
<description>Fabulous extension for OxyPlot</description>
<projectUrl>https://fsprojects.github.io/Fabulous/</projectUrl>
<repository type="git" url="https://github.com/fsprojects/Fabulous" />
<license type="expression">Apache-2.0</license>
<copyright>Copyright 2018</copyright>
<tags>OxyPlot;Charting;2D;Xamarin.Forms;Fabulous;F#;Elmish;Elm</tags>
<dependencies>
<dependency id="Fabulous.XamarinForms" version="0.40.0" />
</dependencies>
</metadata>
<files>
<file src="..\..\..\build_output\Fabulous.XamarinForms\Extensions\Fabulous.XamarinForms.OxyPlot\Fabulous.XamarinForms.OxyPlot.dll" target="lib\netstandard2.0\Fabulous.XamarinForms.OxyPlot.dll" />
<file src="..\..\..\build_output\Fabulous.XamarinForms\Extensions\Fabulous.XamarinForms.OxyPlot\Fabulous.XamarinForms.OxyPlot.pdb" target="lib\netstandard2.0\Fabulous.XamarinForms.OxyPlot.pdb" />
</files>
</package>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>Fabulous.XamarinForms.SkiaSharp</id>
<title>Fabulous.XamarinForms.SkiaSharp</title>
<version>0.0.1</version>
<authors>Fabulous contributors</authors>
<description>Fabulous extension for SkiaSharp</description>
<projectUrl>https://fsprojects.github.io/Fabulous/</projectUrl>
<repository type="git" url="https://github.com/fsprojects/Fabulous" />
<license type="expression">Apache-2.0</license>
<copyright>Copyright 2018</copyright>
<tags>SkiaSharp;Drawing;2D;Xamarin.Forms;Fabulous;F#;Elmish;Elm</tags>
<dependencies>
<dependency id="Fabulous.XamarinForms" version="0.40.0" />
</dependencies>
</metadata>
<files>
<file src="..\..\..\build_output\Fabulous.XamarinForms\Extensions\Fabulous.XamarinForms.SkiaSharp\Fabulous.XamarinForms.SkiaSharp.dll" target="lib\netstandard2.0\Fabulous.XamarinForms.SkiaSharp.dll" />
<file src="..\..\..\build_output\Fabulous.XamarinForms\Extensions\Fabulous.XamarinForms.SkiaSharp\Fabulous.XamarinForms.SkiaSharp.pdb" target="lib\netstandard2.0\Fabulous.XamarinForms.SkiaSharp.pdb" />
</files>
</package>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>Fabulous.XamarinForms.VideoManager</id>
<title>Fabulous.XamarinForms.VideoManager</title>
<version>0.0.1</version>
<authors>Fabulous contributors</authors>
<description>Fabulous extension for VideoManager</description>
<projectUrl>https://fsprojects.github.io/Fabulous/</projectUrl>
<repository type="git" url="https://github.com/fsprojects/Fabulous" />
<license type="expression">Apache-2.0</license>
<copyright>Copyright 2018</copyright>
<tags>VideoManager;Audio;Video;Player;Xamarin.Forms;Fabulous;F#;Elmish;Elm</tags>
<dependencies>
<dependency id="Fabulous.XamarinForms" version="0.40.0" />
</dependencies>
</metadata>
<files>
<file src="..\..\..\build_output\Fabulous.XamarinForms\Extensions\Fabulous.XamarinForms.VideoManager\Fabulous.XamarinForms.VideoManager.dll" target="lib\netstandard2.0\Fabulous.XamarinForms.VideoManager.dll" />
<file src="..\..\..\build_output\Fabulous.XamarinForms\Extensions\Fabulous.XamarinForms.VideoManager\Fabulous.XamarinForms.VideoManager.pdb" target="lib\netstandard2.0\Fabulous.XamarinForms.VideoManager.pdb" />
</files>
</package>
31 changes: 16 additions & 15 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<string * string>) (doc : System.Xml.XmlDocument) =
let replaceXPathAttributeNSIfExists xpath (attribute:string) value (namespaces : #seq<string * string>) (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
)
Expand Down Expand Up @@ -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 _ ->
Expand Down Expand Up @@ -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 _ ->
Expand Down

0 comments on commit c837a12

Please sign in to comment.