Skip to content

Commit

Permalink
Merge pull request #11 from SilkyFowl/SilkyFowl/issue7
Browse files Browse the repository at this point in the history
  • Loading branch information
SilkyFowl authored Jun 22, 2022
2 parents 73a2525 + 37296e8 commit e68bf49
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 15 deletions.
8 changes: 8 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
### 0.0.1-alpha4

* Remove unnecessary dependencies

### 0.0.1-alpha3

* Fix Dependencies

### 0.0.1-alpha2

* Add License
Expand Down
27 changes: 16 additions & 11 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ module Nuspec =
open System.IO.Compression

let addLicense (proj: ProjSetting) =
let xn = XName.Get

let ns localName =
XName.Get(localName, "http://schemas.microsoft.com/packaging/2011/10/nuspec.xsd")

let unzipedPath =
outputPath
Expand All @@ -91,17 +95,20 @@ module Nuspec =

let nupkgDoc = XDocument.Load nuspecPath

let xn localName =
XName.Get(localName, "http://schemas.microsoft.com/packaging/2011/10/nuspec.xsd")

nupkgDoc.Descendants(xn "authors")
nupkgDoc.Descendants(ns "authors")
|> Seq.iter (fun metadata ->
metadata.AddAfterSelf(
XElement(xn "requireLicenseAcceptance", "false"),
XElement(xn "license", XAttribute(XName.Get "type", "file"), "LICENSE.md"),
XElement(xn "licenseUrl", "https://aka.ms/deprecateLicenseUrl")
XElement(ns "requireLicenseAcceptance", "false"),
XElement(ns "license", XAttribute(xn "type", "file"), "LICENSE.md"),
XElement(ns "licenseUrl", "https://aka.ms/deprecateLicenseUrl")
))

if proj = analyzerProjSetting then
nupkgDoc.Descendants(ns "dependency")
|> Seq.filter (fun dependency -> dependency.Attribute(xn "id").Value <> "FSharp.Analyzers.SDK")
|> Seq.toList
|> List.iter (fun dependency -> dependency.Remove())

nupkgDoc.Save nuspecPath
Shell.rm nupkgPath

Expand Down Expand Up @@ -141,15 +148,13 @@ Target.create "Pack" (fun _ ->
SelfContained = Some false
Framework = Some "net6.0" })

let isAvalyzer = setting.projSetting = analyzerProjSetting

Paket.pack (fun p ->
{ p with
ToolType = ToolType.CreateLocalTool()
TemplateFile = Option.toObj setting.templateParams.TemplateFilePath
OutputPath = outputPath
MinimumFromLockFile = not isAvalyzer
IncludeReferencedProjects = not isAvalyzer })
MinimumFromLockFile = true
IncludeReferencedProjects = true })

Nuspec.addLicense setting.projSetting)

Expand Down
4 changes: 2 additions & 2 deletions src/Avalonia.FuncUI.LiveView.Analyzer/paket.template
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
type project
id SilkyFowl.Avalonia.FuncUI.LiveView.Analyzer
version 0.0.1-alpha2
version 0.0.1-alpha4
description Live fs/fsx previewer for Avalonia.FuncUI.
authors SilkyFowl
projectUrl https://github.com/SilkyFowl/Avalonia.FuncUI.LiveView
releaseNotes Add License
releaseNotes Remove unnecessary dependencies
files
..\..\LICENSE.md ==>
bin\Release\net6.0\publish ==> lib\net6.0
4 changes: 2 additions & 2 deletions src/Avalonia.FuncUI.LiveView/paket.template
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
type project
id SilkyFowl.Avalonia.FuncUI.LiveView
version 0.0.1-alpha2
version 0.0.1-alpha4
description Live fs/fsx previewer for Avalonia.FuncUI.
authors SilkyFowl
projectUrl https://github.com/SilkyFowl/Avalonia.FuncUI.LiveView
releaseNotes Add License
releaseNotes Remove unnecessary dependencies
files ..\..\LICENSE.md ==>

0 comments on commit e68bf49

Please sign in to comment.