Skip to content
Permalink
Browse files

Use XpandPwsh Update-Nuspec

  • Loading branch information...
apobekiaris committed Jun 22, 2019
1 parent 3ad7b67 commit 390ba97a5e4c060a9a19901525a7f0b4381f2b4d
@@ -12,7 +12,6 @@
| <img src="http://logo.expandframework.com" width=150 height=68 alt="eXpandFramework logo"/> | Build | Nuget
|----------|--------|--------
**Stable**|[![Build Status](https://dev.azure.com/eXpandDevOps/eXpandFramework/_apis/build/status/DevExpress.XAF-Release?branchName=master)](https://dev.azure.com/eXpandDevOps/eXpandFramework/_build/latest?definitionId=25&branchName=master)|`nuget.exe list Xpand.XAF`
**Lab**|[![Build Status](https://dev.azure.com/eXpandDevOps/eXpandFramework/_apis/build/status/Packages/XAF-Lab?branchName=lab)](https://dev.azure.com/eXpandDevOps/eXpandFramework/_build/latest?definitionId=23?branchName=lab)|`nuget.exe list Xpand.XAF -source https://xpandnugetserver.azurewebsites.net/nuget`
<sub><sup>[How do I set up a package source in Visual Studio?](https://go.microsoft.com/fwlink/?linkid=698608)</sup></sub>
@@ -26,11 +26,11 @@ The module follows the Nuget [Version Basics](https://docs.microsoft.com/en-us/n
|<!-- -->|<!-- -->
|----|----
|**DevExpress.ExpressApp**|**Any**
|[Xpand.VersionConverter](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/tools/Xpand.VersionConverter)|1.0.28
|[Xpand.XAF.Modules.Reactive](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Xpand.XAF.Modules.Reactive)|1.2.33.2
|fasterflect|2.1.3
|fasterflect|2.1.3
|System.Reactive|4.1.5
|System.ValueTuple|4.5.0
|[Xpand.XAF.Modules.Reactive](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Xpand.XAF.Modules.Reactive)|1.2.33
|[Xpand.VersionConverter](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/tools/Xpand.VersionConverter)|1.0.29

## Issues-Debugging-Troubleshooting

@@ -33,10 +33,10 @@ The module follows the Nuget [Version Basics](https://docs.microsoft.com/en-us/n
|<!-- -->|<!-- -->
|----|----
|**DevExpress.ExpressApp**|**Any**
|[Xpand.VersionConverter](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/tools/Xpand.VersionConverter)|1.0.28
|[Xpand.XAF.Modules.Reactive](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Xpand.XAF.Modules.Reactive)|1.2.33.2
|fasterflect|2.1.3
|fasterflect|2.1.3
|System.Reactive|4.1.5
|[Xpand.XAF.Modules.Reactive](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Xpand.XAF.Modules.Reactive)|1.2.33
|[Xpand.VersionConverter](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/tools/Xpand.VersionConverter)|1.0.29

## Issues-Debugging-Troubleshooting

@@ -29,8 +29,8 @@ The module follows the Nuget [Version Basics](https://docs.microsoft.com/en-us/n
|<!-- -->|<!-- -->
|----|----
|**DevExpress.ExpressApp**|**Any**
|[Xpand.VersionConverter](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/tools/Xpand.VersionConverter)|1.0.28
|System.ValueTuple|4.5.0
|System.ValueTuple|4.5.0
|[Xpand.VersionConverter](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/tools/Xpand.VersionConverter)|1.0.29

## Issues-Debugging-Troubleshooting

@@ -26,11 +26,11 @@ The module follows the Nuget [Version Basics](https://docs.microsoft.com/en-us/n
|<!-- -->|<!-- -->
|----|----
|**DevExpress.ExpressApp**|**Any**
|[Xpand.VersionConverter](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/tools/Xpand.VersionConverter)|1.0.28
|[Xpand.XAF.Modules.Reactive](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Xpand.XAF.Modules.Reactive)|1.2.33.2
|fasterflect|2.1.3
|fasterflect|2.1.3
|System.Reactive|4.1.5
|System.ValueTuple|4.5.0
|[Xpand.XAF.Modules.Reactive](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Xpand.XAF.Modules.Reactive)|1.2.33
|[Xpand.VersionConverter](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/tools/Xpand.VersionConverter)|1.0.29

## Issues-Debugging-Troubleshooting

@@ -27,12 +27,12 @@ The module follows the Nuget [Version Basics](https://docs.microsoft.com/en-us/n
|----|----
|**DevExpress.Data**|**Any**
|**DevExpress.ExpressApp**|**Any**
|[Xpand.VersionConverter](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/tools/Xpand.VersionConverter)|1.0.28
|[Xpand.XAF.Modules.Reactive](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Xpand.XAF.Modules.Reactive)|1.2.33.2
|fasterflect|2.1.3
|fasterflect|2.1.3
|Ryder|0.8.0
|System.Reactive|4.1.5
|System.ValueTuple|4.5.0
|[Xpand.XAF.Modules.Reactive](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Xpand.XAF.Modules.Reactive)|1.2.33
|[Xpand.VersionConverter](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/tools/Xpand.VersionConverter)|1.0.29

## Issues-Debugging-Troubleshooting

@@ -27,12 +27,12 @@ The module follows the Nuget [Version Basics](https://docs.microsoft.com/en-us/n
|----|----
|**DevExpress.Data, Version=18.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL**|**Any**
|**DevExpress.ExpressApp**|**Any**
|[Xpand.VersionConverter](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/tools/Xpand.VersionConverter)|1.0.28
|[Xpand.XAF.Modules.Reactive](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Xpand.XAF.Modules.Reactive)|1.2.33.2
|Enums.NET|2.3.2
|Enums.NET|2.3.2
|fasterflect|2.1.3
|Mono.Cecil|0.10.4
|System.Reactive|4.1.5
|[Xpand.XAF.Modules.Reactive](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Xpand.XAF.Modules.Reactive)|1.2.33
|[Xpand.VersionConverter](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/tools/Xpand.VersionConverter)|1.0.29

## Issues-Debugging-Troubleshooting

@@ -26,9 +26,9 @@ The module follows the Nuget [Version Basics](https://docs.microsoft.com/en-us/n
|<!-- -->|<!-- -->
|----|----
|**DevExpress.ExpressApp**|**Any**
|[Xpand.VersionConverter](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/tools/Xpand.VersionConverter)|1.0.28
|fasterflect|2.1.3
|fasterflect|2.1.3
|System.ValueTuple|4.5.0
|[Xpand.VersionConverter](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/tools/Xpand.VersionConverter)|1.0.29

## Issues-Debugging-Troubleshooting

@@ -26,11 +26,11 @@ The module follows the Nuget [Version Basics](https://docs.microsoft.com/en-us/n
|<!-- -->|<!-- -->
|----|----
|**DevExpress.ExpressApp**|**Any**
|[Xpand.VersionConverter](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/tools/Xpand.VersionConverter)|1.0.28
|[Xpand.XAF.Modules.Reactive](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Xpand.XAF.Modules.Reactive)|1.2.33.2
|fasterflect|2.1.3
|fasterflect|2.1.3
|System.Reactive|4.1.5
|System.ValueTuple|4.5.0
|[Xpand.XAF.Modules.Reactive](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Xpand.XAF.Modules.Reactive)|1.2.33
|[Xpand.VersionConverter](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/tools/Xpand.VersionConverter)|1.0.29

## Issues-Debugging-Troubleshooting

@@ -0,0 +1,36 @@
![](https://img.shields.io/nuget/v/Xpand.XAF.Modules.Reactive.svg?&style=flat) ![](https://img.shields.io/nuget/dt/Xpand.XAF.Modules.Reactive.svg?&style=flat)

[![GitHub issues](https://img.shields.io/github/issues/eXpandFramework/expand/Reactive.svg)](https://github.com/eXpandFramework/eXpand/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3AStandalone_xaf_modules+Reactive) [![GitHub close issues](https://img.shields.io/github/issues-closed/eXpandFramework/eXpand/Reactive.svg)](https://github.com/eXpandFramework/eXpand/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aclosed+sort%3Aupdated-desc+label%3AStandalone_XAF_Modules+Reactive)
# About

The `Reactive` module can be used to create XAF DSL implementations in a Reactive/Functional style.

## Versioning
The module is **not bound** to **DevExpress versioning**, which means you can use the latest version with your old DevExpress projects [Read more](https://github.com/eXpandFramework/XAF/tree/master/tools/Xpand.VersionConverter).

The module follows the Nuget [Version Basics](https://docs.microsoft.com/en-us/nuget/reference/package-versioning#version-basics).
## Dependencies
`.NetFramework: `

|<!-- -->|<!-- -->
|----|----
|**DevExpress.ExpressApp**|**Any**
|fasterflect|2.1.3
|System.Reactive|4.1.5
|[Xpand.VersionConverter](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/tools/Xpand.VersionConverter)|1.0.29

## Issues-Debugging-Troubleshooting

To `Step in the source code` you need to `enable Source Server support` in your Visual Studio/Tools/Options/Debugging/Enable Source Server Support. See also [How to boost your DevExpress Debugging Experience](https://github.com/eXpandFramework/DevExpress.XAF/wiki/How-to-boost-your-DevExpress-Debugging-Experience#1-index-the-symbols-to-your-custom-devexpresss-installation-location).

If the package is installed in a way that you do not have access to uninstall it, then you can `unload` it with the next call when [XafApplication.SetupComplete](https://docs.devexpress.com/eXpressAppFramework/DevExpress.ExpressApp.XafApplication.SetupComplete).
```ps1
((Xpand.XAF.Modules.ReactiveModule) Application.Modules.FindModule(typeof(Xpand.XAF.Modules.ReactiveModule))).Unload();
```
## Details


### Tests
The module is tested on Azure for each build with these [tests](https://github.com/eXpandFramework/Packages/tree/master/src/Tests/Modules/Reactive)

### Examples
@@ -26,11 +26,11 @@ The module follows the Nuget [Version Basics](https://docs.microsoft.com/en-us/n
|<!-- -->|<!-- -->
|----|----
|**DevExpress.ExpressApp**|**Any**
|[Xpand.VersionConverter](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/tools/Xpand.VersionConverter)|1.0.28
|[Xpand.XAF.Modules.Reactive](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Xpand.XAF.Modules.Reactive)|1.2.33.2
|fasterflect|2.1.3
|fasterflect|2.1.3
|System.Reactive|4.1.5
|System.ValueTuple|4.5.0
|[Xpand.XAF.Modules.Reactive](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Xpand.XAF.Modules.Reactive)|1.2.33
|[Xpand.VersionConverter](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/tools/Xpand.VersionConverter)|1.0.29

## Issues-Debugging-Troubleshooting

@@ -33,10 +33,10 @@ The module follows the Nuget [Version Basics](https://docs.microsoft.com/en-us/n
|<!-- -->|<!-- -->
|----|----
|**DevExpress.ExpressApp**|**Any**
|[Xpand.VersionConverter](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/tools/Xpand.VersionConverter)|1.0.28
|[Xpand.XAF.Modules.Reactive](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Xpand.XAF.Modules.Reactive)|1.2.33.2
|fasterflect|2.1.3
|fasterflect|2.1.3
|System.Reactive|4.1.5
|[Xpand.XAF.Modules.Reactive](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/src/Modules/Xpand.XAF.Modules.Reactive)|1.2.33
|[Xpand.VersionConverter](https://github.com/eXpandFramework/DevExpress.XAF/tree/master/tools/Xpand.VersionConverter)|1.0.29

## Issues-Debugging-Troubleshooting

@@ -2,86 +2,79 @@ param(
$root = [System.IO.Path]::GetFullPath("$PSScriptRoot\..\..\"),
[switch]$Release
)
$ErrorActionPreference = "Stop"

$ErrorActionPreference = "Stop"
Import-Module XpandPwsh -Force
Set-Location $root
New-Item -Path "$root\bin\Nupkg" -ItemType Directory -ErrorAction SilentlyContinue -Force |Out-Null
& (Get-NugetPath) spec -Force -verbosity quiet
# & (Get-NugetPath) spec -Force -verbosity quiet


$template = "$root\Package.nuspec"
$versionConverter = [PSCustomObject]@{
id = "Xpand.VersionConverter"
version = ([xml](get-content "$PsScriptRoot\..\Xpand.VersionConverter\Xpand.VersionConverter.nuspec")).package.metadata.version
targetFramework = "net452"
}
if (Test-path $root\src\libs){

$libs=Get-ChildItem $root\src\libs *.dll
}


get-childitem "$root\src\" -Include "*.csproj" -Exclude "*Tests*", "*.Source.*" -Recurse | ForEach-Object {
[xml]$nuspec = Get-Content $template
$metaData = $nuspec.Package.Metadata
$metaData.dependencies.dependency.parentnode.removechild($metaData.dependencies.dependency)|Out-Null
$projectPath = $_.FullName
[xml]$csproj = get-content $projectPath
$metaData.Id = [System.IO.Path]::GetFileNameWithoutExtension($_.Name)
write-host "Creating Nuspec for $($_.baseName)" -f "Blue"
$uArgs=@{
NuspecFilename="$root\tools\nuspec\$($_.baseName).nuspec"
ProjectFileName=$projectPath
ReferenceToPackageFilter="Xpand.XAF*"
PublishedSource=(Get-PackageFeed -Xpand)
Release=$Release
ReadMe=$true
LibrariesFolder="$root\src\libs"
}
if ($Release){
$uArgs.PublishedSource=(Get-PackageFeed -Nuget)
}
Update-Nuspec @uArgs

$nuspecFileName="$root\tools\nuspec\$($_.BaseName).nuspec"
[xml]$nuspec = Get-Content $nuspecFileName
$nuspec.package.metaData.Id =$_.BaseName
$readMePath = "$($_.DirectoryName)\ReadMe.md"
if (Test-Path $readMePath) {
$readMe = Get-Content $readMePath -Raw
if ($readMe -cmatch '# About([^#]*)') {
$metaData.description = "$($matches[1])".Trim()
$nuspec.package.metaData.description = "$($matches[1])".Trim()
}
else {
$metaData.description = $metaData.id
$nuspec.package.metaData.description = $metaData.id
}
}
else {
$metaData.description = $metaData.id
$nuspec.package.metaData.description = $metaData.id
}

write-host "Creating Nuspec for $($metaData.Id)" -f "Blue"

$relativeLocation = $_.DirectoryName.Replace($root, "").Replace("\", "/")
$metaData.projectUrl = "https://github.com/eXpandFramework/DevExpress.XAF/blob/master/$relativeLocation"
$metaData.licenseUrl = "https://github.com/eXpandFramework/XAF/blob/master/LICENSE"
$metaData.iconUrl = "http://sign.expandframework.com"
$metaData.authors = "eXpandFramework"
$metaData.owners = "eXpandFramework"
$metaData.releaseNotes = "https://github.com/eXpandFramework/XAF/releases"
$metaData.copyright = "eXpandFramework.com"
$nameTag = $metaData.id.Replace("Xpand.XAF.Modules.", "").Replace("Xpand.XAF.Extensions.", "")
$metaData.tags = "DevExpress XAF modules, eXpandFramework, XAF, eXpressApp, $nameTag"
$nuspec.package.metaData.projectUrl = "https://github.com/eXpandFramework/DevExpress.XAF/blob/master/$relativeLocation"
$nuspec.package.metaData.licenseUrl = "https://github.com/eXpandFramework/DevExpress.XAF/blob/master/LICENSE"
$nuspec.package.metaData.iconUrl = "http://sign.expandframework.com"
$nuspec.package.metaData.authors = "eXpandFramework"
$nuspec.package.metaData.owners = "eXpandFramework"
$nuspec.package.metaData.releaseNotes = "https://github.com/eXpandFramework/DevExpress.XAF/releases"
$nuspec.package.metaData.copyright = "eXpandFramework.com"
$nameTag = $nuspec.package.metaData.id.Replace("Xpand.XAF.Modules.", "").Replace("Xpand.XAF.Extensions.", "")
$nuspec.package.metaData.tags = "DevExpress XAF modules, eXpandFramework, XAF, eXpressApp, $nameTag"

$ns = New-Object System.Xml.XmlNamespaceManager($nuspec.NameTable)
$ns.AddNamespace("ns", $nuspec.DocumentElement.NamespaceURI)
$AddDependency = {
param($psObj)
$dependency = $nuspec.CreateElement("dependency")
$dependency = $nuspec.CreateElement("dependency", $nuspec.DocumentElement.NamespaceURI)
$dependency.SetAttribute("id", $psObj.id)
$dependency.SetAttribute("version", $psObj.version)
$psObj.id
$nuspec.SelectSingleNode("//group").AppendChild($dependency)|Out-Null
$nuspec.SelectSingleNode("//ns:dependencies", $ns).AppendChild($dependency)|Out-Null
}

$targetFrameworkVersion = "$($csproj.Project.PropertyGroup.TargetFramework)".Substring(3)
$targetFrameworkAttribute=$nuspec.CreateAttribute("targetFramework")
$targetFrameworkAttribute.Value=".NETFramework$targetFrameworkVersion"
$groupElement=$nuspec.CreateElement("group")
$groupElement.Attributes.Append($targetFrameworkAttribute)
$nuspec.SelectSingleNode("//dependencies").AppendChild($groupElement)
if ($metaData.id -like "Xpand.XAF*"){
if ($nuspec.package.metaData.id -like "Xpand.XAF*"){
Invoke-Command $AddDependency -ArgumentList $versionConverter
}

$uArgs=@{
NuspecFilename="$root\bin\nuspec\$($metadata.id).nuspec"
ProjectFileName=$projectPath
ReferenceToPackageFilter="Xpand.XAF*"
PublishedSource=(Get-PackageFeed -Xpand)
Release=$Release
ReadMe=$true

}
$nuspec=Update-Nuspec @uArgs
New-Item -ItemType Directory -Path "$root\bin\nuspec" -Force -ErrorAction SilentlyContinue|Out-Null
$nuspec.Save($NuspecFilename)

$nuspec.Save($nuspecFileName)
}
Remove-Item $template

0 comments on commit 390ba97

Please sign in to comment.
You can’t perform that action at this time.