Skip to content

Commit

Permalink
1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mazzy-ax committed May 3, 2018
1 parent c48b388 commit 9d13513
Show file tree
Hide file tree
Showing 10 changed files with 86 additions and 68 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All notable changes to the project [https://github.com/mazzy-ax/xpoTools](https://github.com/mazzy-ax/xpoTools) will be documented in this file. See also [https://github.com/mazzy-ax/xpoTools/releases](https://github.com/mazzy-ax/xpoTools/releases).

## [1.1.0](https://github.com/mazzy-ax/xpoTools/compare/1.0.1...1.1.0) - 2018-05-03

* To increase a general performance:
* moved: the generation of xpp-files is moved from `xpo-import` to `split-xpo` cmdlet
* removed: the `xpptext` property from class [xpoItem] is unused and have removed

* Small updated for README and tests of the project meta.

## [1.0.1](https://github.com/mazzy-ax/xpoTools/compare/1.0.0...1.0.1) - 2018-04-23

* Added object types for ax2012 in `Get-XpoType.ps1`. #1 closed.
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# xpoTools

![version](https://img.shields.io/badge/version-1.0.1-green.svg) ![license](https://img.shields.io/badge/license-MIT-blue.svg)
![version](https://img.shields.io/badge/version-1.1.0-green.svg) ![license](https://img.shields.io/badge/license-MIT-blue.svg)

[xpoTools](https://github.com/mazzy-ax/xpoTools) is a Powershell module contains cmdlets that splits one XPO file into separate XPO files and combines a set of set of interdependent XPO files into a single XPO file.

Expand All @@ -15,7 +15,6 @@ XPO file is a text file contains Microsoft Dynamics AX (Axapta) objects. See [te
* include and exclude files based on a file name. For example, to exclude `DEL_` objects
* filter AOT objects based on a text within XPO elements
* uses Encoding parameter
* It have designed for parallel processing. See [examples/parallel-split.ps1](examples/parallel-split.ps1) folder.

## Thanks

Expand Down
43 changes: 0 additions & 43 deletions tests/ModuleManifest.Tests.ps1

This file was deleted.

51 changes: 50 additions & 1 deletion tests/nuspec.Tests.ps1 → tests/manifests.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ $moduleRoot = Split-Path (Resolve-Path $projectRoot\*\*.psd1)
$moduleName = Split-Path $moduleRoot -Leaf

$changelog = 'CHANGELOG.md'
$readme = 'README.md'

$script:manifest = $null

Describe 'Module Manifest Tests' -Tag 'Meta' {

It 'Passes Test-ModuleManifest' {
It 'has a valid module manifest file' {
$script:manifest = Test-ModuleManifest -Path $moduleRoot\$moduleName.psd1
$? | Should -Be $true
}
Expand Down Expand Up @@ -55,4 +58,50 @@ Describe 'Module Manifest Tests' -Tag 'Meta' {
$manifest.Version -as [Version] | Should be ( $ChangelogVersion -as [Version] )
}

}

Describe 'Nuget specification Tests' -Tag 'Meta' {

It 'has a valid nuspec file' {
$file = Resolve-Path $projectRoot\$moduleName.nuspec
[xml]$script:nuspec = Get-Content $file
$nuspec | Should Not BeNullOrEmpty
}

It 'has a valid id' {
$nuspec.package.metadata.id | Should Be ($moduleName)
}

It 'nuspec and manifest descriptions are same' {
$nuspec.package.metadata.Description | Should Be ($manifest.Description)
}

It 'nuspec and manifest release notes are same' {
$nuspecReleaseNotes = $nuspec.package.metadata.ReleaseNotes -replace '\s'
$manifestReleaseNotes = $manifest.PrivateData.PSData.ReleaseNotes -replace '\s'

$nuspecReleaseNotes | Should Be $manifestReleaseNotes
}

It 'nuspec and manifest projectUrl are same' {
$nuspec.package.metadata.projectUrl | Should Be ($manifest.PrivateData.PSData.ProjectUri)
}

It 'nuspec and manifest licenseUrl notes are same' {
$nuspec.package.metadata.licenseUrl | Should Be ($manifest.PrivateData.PSData.LicenseUri)
}

}

Describe 'README.md Tests' -Tag 'Meta' {

It "has a valid shields.io/badge/version in the $readme file" {
Get-Content -Path $projectRoot\README.md |
Where-Object { $_ -match '\!\[version\]\(https://img\.shields\.io/badge/version-(?<Version>(\d+\.){1,3}\d+)-green\.svg\)' } |
Select-Object -First 1 | Should Not BeNullOrEmpty

$ReadmeVersion = $matches.Version
$ReadmeVersion | Should Be $manifest.Version
}

}
File renamed without changes.
13 changes: 10 additions & 3 deletions xpoTools.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,24 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>xpoTools</id>
<version>1.0.1</version>
<version>1.1.0</version>
<authors>Sergey Mazurkin</authors>
<licenseUrl>https://github.com/mazzy-ax/xpoTools/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/mazzy-ax/xpoTools</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Powershell cmdlets to split and to merge XPO files contains AOT objects of Microsoft Dynamics AX (Axapta) 3.0, 4.0, 2009, 2012</description>
<releaseNotes>
## 1.1.0

To increase a general performance:

* moved: the generation of xpp-files is moved from xpo-import to split-xpo cmdlet
* removed: the xpptext property from class [xpoItem] is unused and have removed

## 1.0.1

* Added object types for ax2012 in `Get-XpoType.ps1`. See #1
* Fixed couple bugs and type in `Select-FileName.ps1`, `parallel-split.ps1` and `Import-Xpo.ps1`
* Added object types for ax2012 in Get-XpoType.ps1. See #1
* Fixed couple bugs and type in Select-FileName.ps1, parallel-split.ps1 and Import-Xpo.ps1
* Fixed readme.md
</releaseNotes>
<tags>xpo split merge Axapta Microsoft Dynamics AX</tags>
Expand Down
1 change: 0 additions & 1 deletion xpoTools/classes/classes.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ class xpoItem {
}

[xpoNode[]]$Node
[string[]]$xppText
[xpoNode[]]$Group
[xpoNode[]]$GroupNode

Expand Down
14 changes: 1 addition & 13 deletions xpoTools/functions/Import-Xpo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function Import-Xpo {

$Texts = Get-Content $xpoFile.FullName -Delimiter '***Element: ' -Encoding $Encoding

if ( $Texts.Length -gt 2 -and $Texts[-1] -match 'END\s+$' ) {
if ( $Texts -and $Texts.Length -gt 2 -and $Texts[-1] -match 'END\s+$' ) {
$FileHeader = $Texts[0]

$Items = $Texts |
Expand All @@ -48,18 +48,6 @@ function Import-Xpo {

Write-Progress -Activity $funcName -Completed

# TODO [performance]: is it need parallel threads for next sentense?

$Items | Where-Object { $_ -and $_.Type.Tag -EQ 'CLS' } | ForEach-Object {
Write-Verbose "$funcName converts xpo to xpp $_"
$_.xppText = $_.Text | Select-Source | Select-xppClass
}

$Items | Where-Object { $_ -and $_.Type.Tag -EQ 'JOB' } | ForEach-Object {
Write-Verbose "$funcName converts xpo to xpp $_"
$_.xppText = $_.Text | Select-Source | Select-Object -First 1 -ExpandProperty Text | Select-TextLine
}

$Nodes = $Items | Where-Object { $_ -and $_.Type.Tag -EQ 'PRN' } | ForEach-Object {
Write-Verbose "$funcName collects nodes for the project $_"
$_.GroupNode = $_ | select-ProjectGroup | select-ProjectNode
Expand Down
8 changes: 6 additions & 2 deletions xpoTools/functions/Split-Xpo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,13 @@ function Split-Xpo {

$Item = $_

if ( $xpp -and $Item.xppText ) {
if ( $xpp -and $Item.Type.Tag -eq 'CLS' ) {
$Ext = '.xpp'
$s = $Item.xppText
$s = $Item.Text | Select-Source | Select-xppClass
}
elseif( $xpp -and $Item.Type.Tag -eq 'JOB' ) {
$Ext = '.xpp'
$s = $Item.Text | Select-Source | Select-Object -First 1 -ExpandProperty Text | Select-TextLine
}
else {
$Ext = '.xpo'
Expand Down
13 changes: 10 additions & 3 deletions xpoTools/xpoTools.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
RootModule = 'xpoTools.psm1'

# Version number of this module.
ModuleVersion = '1.0.1'
ModuleVersion = '1.1.0'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down Expand Up @@ -103,10 +103,17 @@ PrivateData = @{

# ReleaseNotes of this module
ReleaseNotes = @'
## 1.1.0
To increase a general performance:
* moved: the generation of xpp-files is moved from xpo-import to split-xpo cmdlet
* removed: the xpptext property from class [xpoItem] is unused and have removed
## 1.0.1
* Added object types for ax2012 in `Get-XpoType.ps1`. See #1
* Fixed couple bugs and type in `Select-FileName.ps1`, `parallel-split.ps1` and `Import-Xpo.ps1`
* Added object types for ax2012 in Get-XpoType.ps1. See #1
* Fixed couple bugs and type in Select-FileName.ps1, parallel-split.ps1 and Import-Xpo.ps1
* Fixed readme.md
'@

Expand Down

0 comments on commit 9d13513

Please sign in to comment.