Skip to content

Commit

Permalink
Merge pull request #22 from dmitry-merzlyakov/next-dev
Browse files Browse the repository at this point in the history
Releasing 0.8.4
  • Loading branch information
dmitry-merzlyakov authored Nov 29, 2021
2 parents 965e6a7 + b85942f commit 624cb67
Show file tree
Hide file tree
Showing 151 changed files with 19,575 additions and 950 deletions.
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ PublishScripts/
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
!/Contrib/Python/Packages/*
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignorable files
Expand Down Expand Up @@ -286,3 +287,13 @@ __pycache__/
*.btm.cs
*.odx.cs
*.xsd.cs

/Contrib/python/NLedgerPackage/build/
/Contrib/python/NLedgerPackage/dist/
/Contrib/python/NLedgerPackage/src/ledger.egg-info/
/Contrib/Python/drewr3.dat
/Contrib/Python/ledger-*.whl
/Contrib/Python/ledger_tests.py
/Source/NLedger.Extensibility.Python.Module/build
/Source/NLedger.Extensibility.Python.Module/dist
/Source/NLedger.Extensibility.Python.Module/src/ledger.egg-info
52 changes: 38 additions & 14 deletions Build/NLedgerBuild.proj
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<!-- Path to ProductInfo file -->
<ProductInfoPath>$(SourceRoot)ProductInfo.xml</ProductInfoPath>
<!-- Paths to test project assemblies separated by spaces -->
<TestAssembliesFramework>$(SourceRoot)NLedger.Tests\bin\Release\net452\NLedger.Tests.dll $(SourceRoot)NLedger.IntegrationTests\bin\Release\net452\NLedger.IntegrationTests.dll</TestAssembliesFramework>
<TestAssembliesCore>$(SourceRoot)NLedger.Tests\bin\Release\netcoreapp3.1\NLedger.Tests.dll $(SourceRoot)NLedger.IntegrationTests\bin\Release\netcoreapp3.1\NLedger.IntegrationTests.dll</TestAssembliesCore>
<TestAssembliesFramework>$(SourceRoot)NLedger.Tests\bin\Release\net452\NLedger.Tests.dll $(SourceRoot)NLedger.IntegrationTests\bin\Release\net472\NLedger.IntegrationTests.dll $(SourceRoot)NLedger.Extensibility.Python.Tests\bin\Release\net472\NLedger.Extensibility.Python.Tests.dll</TestAssembliesFramework>
<TestAssembliesCore>$(SourceRoot)NLedger.Tests\bin\Release\netcoreapp3.1\NLedger.Tests.dll $(SourceRoot)NLedger.IntegrationTests\bin\Release\netcoreapp3.1\NLedger.IntegrationTests.dll $(SourceRoot)NLedger.Extensibility.Python.Tests\bin\Release\netcoreapp3.1\NLedger.Extensibility.Python.Tests.dll</TestAssembliesCore>

<!-- Output file structure -->

Expand Down Expand Up @@ -58,10 +58,10 @@
<MSBuild Projects="$(SourceRoot)NLedger.sln" Properties="Configuration=Release;VersionPrefix=$(VersionPrefix).$(BuildNumber);SourceRevisionId=$(SourceRevisionId)" />
</Target>

<Target Name="CodeTests" DependsOnTargets="Build;CheckOutputDir">
<Target Name="CodeTests" DependsOnTargets="Build;CheckOutputDir;GetPythonConnection">
<Message Text="Target : CodeTests (executing all unit tests defined in code)"/>
<Exec Command="&quot;$(VsTestConsolePath)&quot; $(TestAssembliesFramework) /Logger:trx" />
<Exec Command="&quot;$(VsTestConsolePath)&quot; $(TestAssembliesCore) /Logger:trx" />
<Exec Command="&quot;$(VsTestConsolePath)&quot; $(TestAssembliesFramework) /Logger:trx /Platform:x64" />
<Exec Command="&quot;$(VsTestConsolePath)&quot; $(TestAssembliesCore) /Logger:trx /Platform:x64" />
<!-- Copy trx files (s) to output folder -->
<CreateItem Include="$(TestResultsDir)**\*.*">
<Output TaskParameter="Include" ItemName="TestResultsFiles" />
Expand All @@ -71,26 +71,40 @@
<RemoveDir Directories="$(TestResultsDir)"/>
</Target>

<Target Name="Release" DependsOnTargets="Build">
<Target Name="PythonBuild" DependsOnTargets="Build;GetPythonConnection">
<Message Text="Target : Build Python Module"/>
<!-- Install PythonNet since it is needed for Python unit tests -->
<Exec Command="&quot;$(PowerShellExe)&quot; -NonInteractive -executionpolicy Unrestricted -File &quot;$(BuildDir)..\Contrib\Python\GetPythonEnvironment.ps1&quot; -command install-wheel -noAnsiColor" />
<Exec Command="&quot;$(PowerShellExe)&quot; -NonInteractive -executionpolicy Unrestricted -File &quot;$(BuildDir)..\Contrib\Python\GetPythonEnvironment.ps1&quot; -command install-pythonnet -noAnsiColor" />
<Exec Command="&quot;$(PowerShellExe)&quot; -NonInteractive -executionpolicy Unrestricted -File &quot;$(SourceRoot)NLedger.Extensibility.Python.Module\build.ps1&quot; -test -build" />
<Copy SourceFiles="$(ProjectRoot)Contrib\Python\ledger-$(VersionPrefix)-py3-none-any.whl" DestinationFiles="$(OutputDir)ledger-$(VersionPrefix)-py3-none-any.whl" />
</Target>

<Target Name="Release" DependsOnTargets="Build;PythonBuild">
<Message Text="Target : Release (composing a package folder with release binaries)"/>
<!-- Prepare a folder for package binaries -->
<RemoveDir Directories="$(PackageDir)"/>
<MakeDir Directories="$(PackageDir)"/>
<!-- Add binaries (.Net Framework) -->
<Copy SourceFiles="$(SourceRoot)NLedger\bin\Release\net45\NLedger.dll" DestinationFiles="$(PackageDir)bin\net45\NLedger.dll" />
<Copy SourceFiles="$(SourceRoot)NLedger.CLI\bin\Release\net45\NLedger-cli.exe" DestinationFiles="$(PackageDir)bin\net45\NLedger-cli.exe" />
<Copy SourceFiles="$(SourceRoot)NLedger.CLI\bin\Release\net45\NLedger-cli.exe.config" DestinationFiles="$(PackageDir)bin\net45\NLedger-cli.exe.config" />
<Copy SourceFiles="$(ProjectRoot)Contrib\ledger.1.html" DestinationFiles="$(PackageDir)bin\net45\ledger.1.html" />
<Copy SourceFiles="$(SourceRoot)NLedger\bin\Release\net45\NLedger.dll" DestinationFiles="$(PackageDir)bin\net472\NLedger.dll" />
<Copy SourceFiles="$(SourceRoot)NLedger.CLI\bin\Release\net472\NLedger-cli.exe" DestinationFiles="$(PackageDir)bin\net472\NLedger-cli.exe" />
<Copy SourceFiles="$(SourceRoot)NLedger.CLI\bin\Release\net472\NLedger-cli.exe.config" DestinationFiles="$(PackageDir)bin\net472\NLedger-cli.exe.config" />
<Copy SourceFiles="$(SourceRoot)NLedger.CLI\bin\Release\net472\NLedger.Extensibility.Python.dll" DestinationFiles="$(PackageDir)bin\net472\NLedger.Extensibility.Python.dll" />
<Copy SourceFiles="$(SourceRoot)NLedger.CLI\bin\Release\net472\Python.Runtime.dll" DestinationFiles="$(PackageDir)bin\net472\Python.Runtime.dll" />
<Copy SourceFiles="$(ProjectRoot)Contrib\ledger.1.html" DestinationFiles="$(PackageDir)bin\net472\ledger.1.html" />
<!-- Add binaries (.Net Core) -->
<Copy SourceFiles="$(SourceRoot)NLedger\bin\Release\netstandard2.0\NLedger.dll" DestinationFiles="$(PackageDir)bin\netcoreapp3.1\NLedger.dll" />
<Copy SourceFiles="$(SourceRoot)NLedger.CLI\bin\Release\netcoreapp3.1\NLedger-cli.exe" DestinationFiles="$(PackageDir)bin\netcoreapp3.1\NLedger-cli.exe" />
<Copy SourceFiles="$(SourceRoot)NLedger.CLI\bin\Release\netcoreapp3.1\NLedger-cli.dll" DestinationFiles="$(PackageDir)bin\netcoreapp3.1\NLedger-cli.dll" />
<Copy SourceFiles="$(SourceRoot)NLedger.CLI\bin\Release\netcoreapp3.1\NLedger-cli.dll.config" DestinationFiles="$(PackageDir)bin\netcoreapp3.1\NLedger-cli.dll.config" />
<Copy SourceFiles="$(SourceRoot)NLedger.CLI\bin\Release\netcoreapp3.1\NLedger-cli.deps.json" DestinationFiles="$(PackageDir)bin\netcoreapp3.1\NLedger-cli.deps.json" />
<Copy SourceFiles="$(SourceRoot)NLedger.CLI\bin\Release\netcoreapp3.1\NLedger-cli.runtimeconfig.json" DestinationFiles="$(PackageDir)bin\netcoreapp3.1\NLedger-cli.runtimeconfig.json" />
<Copy SourceFiles="$(SourceRoot)NLedger.CLI\bin\Release\netcoreapp3.1\NLedger.Extensibility.Python.dll" DestinationFiles="$(PackageDir)bin\netcoreapp3.1\NLedger.Extensibility.Python.dll" />
<Copy SourceFiles="$(SourceRoot)NLedger.CLI\bin\Release\netcoreapp3.1\Python.Runtime.dll" DestinationFiles="$(PackageDir)bin\netcoreapp3.1\Python.Runtime.dll" />
<Copy SourceFiles="$(SourceRoot)NLedger.CLI\bin\Release\netcoreapp3.1\System.Security.Permissions.dll" DestinationFiles="$(PackageDir)bin\netcoreapp3.1\System.Security.Permissions.dll" />
<Copy SourceFiles="$(ProjectRoot)Contrib\ledger.1.html" DestinationFiles="$(PackageDir)bin\netcoreapp3.1\ledger.1.html" />
<!-- Add Contrib files -->
<CreateItem Include="$(ProjectRoot)Contrib\**\*.*">
<CreateItem Include="$(ProjectRoot)Contrib\**\*.*" >
<Output TaskParameter="Include" ItemName="ContribFiles" />
</CreateItem>
<Copy SourceFiles="@(ContribFiles)" DestinationFiles="@(ContribFiles->'$(PackageDir)\%(RecursiveDir)%(Filename)%(Extension)')" />
Expand All @@ -107,12 +121,14 @@
<Target Name="IntegrationTests" DependsOnTargets="Release">
<Message Text="Target : IntegrationTests (executing all Ledger tests in NLTest Toolkit)"/>
<!-- Call NGEN to create a native image to speed up the tests. Requires elevated permissions -->
<Exec Condition=" '$(Elevated)'=='True' " Command="&quot;$(PowerShellExe)&quot; -NonInteractive -executionpolicy Unrestricted -Command &quot;Import-Module $(PackageDir)Install\SysNGen.psm1 ; Add-NGenImage $(PackageDir)bin\net45\NLedger-cli.exe&quot;" />
<Exec Condition=" '$(Elevated)'=='True' " Command="&quot;$(PowerShellExe)&quot; -NonInteractive -executionpolicy Unrestricted -Command &quot;Import-Module $(PackageDir)Install\SysNGen.psm1 ; Add-NGenImage $(PackageDir)bin\net472\NLedger-cli.exe&quot;" />
<!-- Run all integration tests -->
<Exec Command="&quot;$(PowerShellExe)&quot; -NonInteractive -executionpolicy Unrestricted -File &quot;$(PackageDir)NLTestToolkit\NLTest.ps1&quot; -nledgerExePath $(PackageDir)bin\net45\NLedger-cli.exe -htmlReport -reportFileName &quot;$(OutputDir)NLTest.NetFramework.LastTestResults&quot;" />
<Exec Command="&quot;$(PowerShellExe)&quot; -NonInteractive -executionpolicy Unrestricted -File &quot;$(PackageDir)NLTestToolkit\NLTest.ps1&quot; -nledgerExePath $(PackageDir)bin\net472\NLedger-cli.exe -htmlReport -reportFileName &quot;$(OutputDir)NLTest.NetFramework.LastTestResults&quot;" />
<Exec Command="&quot;$(PowerShellExe)&quot; -NonInteractive -executionpolicy Unrestricted -File &quot;$(PackageDir)NLTestToolkit\NLTest.ps1&quot; -nledgerExePath $(PackageDir)bin\netcoreapp3.1\NLedger-cli.exe -htmlReport -reportFileName &quot;$(OutputDir)NLTest.NetCore.LastTestResults&quot;" />
<!-- Remove the native image from the cache -->
<Exec Condition=" '$(Elevated)'=='True' " Command="&quot;$(PowerShellExe)&quot; -NonInteractive -executionpolicy Unrestricted -Command &quot;Import-Module $(PackageDir)Install\SysNGen.psm1 ; Remove-NGenImage $(PackageDir)bin\net45\NLedger-cli.exe&quot;" />
<Exec Condition=" '$(Elevated)'=='True' " Command="&quot;$(PowerShellExe)&quot; -NonInteractive -executionpolicy Unrestricted -Command &quot;Import-Module $(PackageDir)Install\SysNGen.psm1 ; Remove-NGenImage $(PackageDir)bin\net472\NLedger-cli.exe&quot;" />
<!-- Remove PyCache files created after running tests -->
<Exec Command="&quot;$(PowerShellExe)&quot; -NonInteractive -executionpolicy Unrestricted -Command &quot;get-childitem -LiteralPath $(PackageDir)test -Directory -Recurse | Where-Object {$_.Name -eq '__pycache__'} | Remove-Item -Force -Recurse&quot;" />
</Target>

<Target Name="Package" DependsOnTargets="Release">
Expand All @@ -133,6 +149,7 @@
<Message Text="Target : Create NuGet package"/>
<Exec Command="dotnet pack --configuration Release --no-build" WorkingDirectory="$(SourceRoot)" />
<Copy SourceFiles="$(SourceRoot)NLedger\bin\Release\NLedger.$(VersionPrefix)-$(VersionSuffix).nupkg" DestinationFiles="$(OutputDir)NLedger.$(VersionPrefix)-$(VersionSuffix).nupkg" />
<Copy SourceFiles="$(SourceRoot)NLedger.Extensibility.Python\bin\Release\NLedger.Extensibility.Python.$(VersionPrefix)-$(VersionSuffix).nupkg" DestinationFiles="$(OutputDir)NLedger.Extensibility.Python.$(VersionPrefix)-$(VersionSuffix).nupkg" />
</Target>

<!-- Technical task - check output folder -->
Expand All @@ -148,6 +165,13 @@
<Exec Command="&quot;$(PowerShellExe)&quot; -NonInteractive -executionpolicy Unrestricted -Command &quot;Import-Module $(BuildDir)ProductInfo.psm1 ; Test-VersionInfoAndLicenseNotes&quot;" />
</Target>

<!-- Technical task - configure Python connection -->
<Target Name="GetPythonConnection">
<Message Text="Configuring Python connection file" />
<Message Text="NOTE: if this task fails, configure Python connection manually (command 'connect' in 'GetPythonEnvironment.ps1')." />
<Exec Command="&quot;$(PowerShellExe)&quot; -NonInteractive -executionpolicy Unrestricted -File &quot;$(BuildDir)..\Contrib\Python\GetPythonEnvironment.ps1&quot; -command connect -noAnsiColor" />
</Target>

<!-- Technical task - checking the content of Wix configuration files -->
<Target Name="CheckWix">
<Message Text="Checking the content of Wix configuration files" />
Expand Down
27 changes: 23 additions & 4 deletions Build/NLedgerWix/Components.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,20 @@
<Directory Id="NLTestToolkitFolder" Name="NLTestToolkit">
<Component Id="NLTestToolkit" Guid="874FBA65-1862-4E0E-B1E6-078A45ACF084" >
<File Id="File_NLTest_cmd" Name="NLTest.cmd" Source="$(var.PackageFolder)NLedger\NLTestToolkit\NLTest.cmd"/>
<File Id="File_NLTest_IgnoreList_xml" Name="NLTest.IgnoreList.xml" Source="$(var.PackageFolder)NLedger\NLTestToolkit\NLTest.IgnoreList.xml"/>
<File Id="File_NLTest_Launcher_ps1" Name="NLTest.Launcher.ps1" Source="$(var.PackageFolder)NLedger\NLTestToolkit\NLTest.Launcher.ps1"/>
<File Id="File_NLTest_ps1" Name="NLTest.ps1" Source="$(var.PackageFolder)NLedger\NLTestToolkit\NLTest.ps1"/>
<File Id="File_NLTest_xslt" Name="NLTest.xslt" Source="$(var.PackageFolder)NLedger\NLTestToolkit\NLTest.xslt"/>
<File Id="File_NLTest_Meta_xml" Name="NLTest.Meta.xml" Source="$(var.PackageFolder)NLedger\NLTestToolkit\NLTest.Meta.xml"/>
</Component>
</Directory>
<Directory Id="PythonFolder" Name="Python">
<Component Id="PythonContrib" Guid="30468F59-AAF0-4308-BAAB-B689BEB2CE22" >
<File Id="File_GetPythonEnvironment_ps1" Name="GetPythonEnvironment.ps1" Source="$(var.PackageFolder)NLedger\Python\GetPythonEnvironment.ps1"/>
<File Id="File_GetPythonEnvironment_Console_cmd" Name="GetPythonEnvironment.Console.cmd" Source="$(var.PackageFolder)NLedger\Python\GetPythonEnvironment.Console.cmd"/>
<File Id="File_ledger_tests_py" Name="ledger_tests.py" Source="$(var.PackageFolder)NLedger\Python\ledger_tests.py"/>
<File Id="File_PyManagement_psm1" Name="PyManagement.psm1" Source="$(var.PackageFolder)NLedger\Python\PyManagement.psm1"/>
<File Id="File_Python_drewr3_dat" Name="drewr3.dat" Source="$(var.PackageFolder)NLedger\Python\drewr3.dat"/>
<File Id="File_ledger_0_8_4_py3_none_any_whl" Name="ledger-0.8.4-py3-none-any.whl" Source="$(var.PackageFolder)NLedger\Python\ledger-0.8.4-py3-none-any.whl"/>
</Component>
</Directory>
<Directory Id="testFolder" Name="test">
Expand Down Expand Up @@ -462,6 +472,10 @@
<File Id="File_nl_issues_1_test" Name="nl-issues-1.test" Source="$(var.PackageFolder)NLedger\test\nledger\nl-issues-1.test"/>
<File Id="File_nl_issues_1_dat" Name="nl-issues-1.dat" Source="$(var.PackageFolder)NLedger\test\nledger\nl-issues-1.dat"/>
<File Id="File_pricedb_dat" Name="pricedb.dat" Source="$(var.PackageFolder)NLedger\test\nledger\pricedb.dat"/>
<File Id="File_nl_baseline_net_1.test" Name="nl-baseline-net-1.test" Source="$(var.PackageFolder)NLedger\test\nledger\nl-baseline-net-1.test"/>
<File Id="File_nl_baseline_net_2.test" Name="nl-baseline-net-2.test" Source="$(var.PackageFolder)NLedger\test\nledger\nl-baseline-net-2.test"/>
<File Id="File_nl_baseline_net_3.test" Name="nl-baseline-net-3.test" Source="$(var.PackageFolder)NLedger\test\nledger\nl-baseline-net-3.test"/>
<File Id="File_nl_baseline_net_4.test" Name="nl-baseline-net-4.test" Source="$(var.PackageFolder)NLedger\test\nledger\nl-baseline-net-4.test"/>
</Component>
</Directory>
<Directory Id="regressFolder" Name="regress">
Expand Down Expand Up @@ -692,19 +706,24 @@
<File Id="File_NLedger_Core_cli_deps_json" Name="NLedger-cli.deps.json" Source="$(var.PackageFolder)NLedger\bin\netcoreapp3.1\NLedger-cli.deps.json"/>
<File Id="File_NLedger_Core_cli_dll_config" Name="NLedger-cli.dll.config" Source="$(var.PackageFolder)NLedger\bin\netcoreapp3.1\NLedger-cli.dll.config"/>
<File Id="File_NLedger_Core_cli_runtimeconfig_json" Name="NLedger-cli.runtimeconfig.json" Source="$(var.PackageFolder)NLedger\bin\netcoreapp3.1\NLedger-cli.runtimeconfig.json"/>
<File Id="File_NLedger_Core_System_Security_Permissions_dll" Name="System.Security.Permissions.dll" Source="$(var.PackageFolder)NLedger\bin\netcoreapp3.1\System.Security.Permissions.dll"/>
<File Id="File_NLedger_Core_Extensibility_Python_dll" Name="NLedger.Extensibility.Python.dll" Source="$(var.PackageFolder)NLedger\bin\netcoreapp3.1\NLedger.Extensibility.Python.dll"/>
<File Id="File_Core_Python_Runtime_dll" Name="Python.Runtime.dll" Source="$(var.PackageFolder)NLedger\bin\netcoreapp3.1\Python.Runtime.dll"/>
</Component>
<Component Id="LedgerCoreManFiles" Guid="C4C85651-C61F-4B2B-AE5F-C4A3BFAE8930" >
<File Id="File_Core_ledger_1_html" Name="ledger.1.html" Source="$(var.PackageFolder)NLedger\ledger.1.html"/>
</Component>
</Directory>
</Directory>
<Component Id="AppBinFiles" Guid="59E7E5B2-E13F-4FBC-B05C-B5E1DFC1F06A" >
<File Id="File_NLedger_dll" Name="NLedger.dll" Source="$(var.PackageFolder)NLedger\bin\net45\NLedger.dll"/>
<File Id="File_NLedger_cli_exe" Name="NLedger-cli.exe" Source="$(var.PackageFolder)NLedger\\bin\net45\NLedger-cli.exe">
<File Id="File_NLedger_dll" Name="NLedger.dll" Source="$(var.PackageFolder)NLedger\bin\net472\NLedger.dll"/>
<File Id="File_NLedger_cli_exe" Name="NLedger-cli.exe" Source="$(var.PackageFolder)NLedger\bin\net472\NLedger-cli.exe">
<!-- Call NGen -->
<netfx:NativeImage Id="File_NLedger_cli_exe" Platform="all" Priority="0" />
</File>
<File Id="File_NLedger_cli_exe_config" Name="NLedger-cli.exe.config" Source="$(var.PackageFolder)NLedger\\bin\net45\NLedger-cli.exe.config"/>
<File Id="File_NLedger_cli_exe_config" Name="NLedger-cli.exe.config" Source="$(var.PackageFolder)NLedger\bin\net472\NLedger-cli.exe.config"/>
<File Id="File_NLedger_Extensibility_Python_dll" Name="NLedger.Extensibility.Python.dll" Source="$(var.PackageFolder)NLedger\bin\net472\NLedger.Extensibility.Python.dll"/>
<File Id="File_Python_Runtime_dll" Name="Python.Runtime.dll" Source="$(var.PackageFolder)NLedger\bin\net472\Python.Runtime.dll"/>
</Component>
<Component Id="LicenseFiles" Guid="9D31EDB8-04BC-4EF7-856C-3F29655E78CF" >
<File Id="File_LICENSE" Name="LICENSE" Source="$(var.PackageFolder)NLedger\LICENSE"/>
Expand Down
Loading

0 comments on commit 624cb67

Please sign in to comment.