Merge pull request #8 from HavretGC/add_license_to_nuget
AMQNET-588 Solution clean up
diff --git a/package.ps1 b/package.ps1
index 07b47b8..49db3d0 100644
--- a/package.ps1
+++ b/package.ps1
@@ -20,6 +20,9 @@
write-progress "Creating package directory." "Initializing..."
if (!(test-path package)) {
mkdir package
+} else {
+ # Clean package content if exists
+ Remove-Item package\* -Recurse
}
if (test-path build) {
@@ -43,11 +46,25 @@
$pkgdir = "package"
$zipfile = "$pkgdir\$pkgname-$pkgver-src.zip"
-Compress-Archive -Path LICENSE.txt, NOTICE.txt, keyfile, nms.sln, package.ps1 -Update -DestinationPath $zipfile
+# clean temp dir if exists
+Remove-Item temp -Recurse -ErrorAction Ignore
+
+# copy files to temp dir
+Copy-Item src\* -Destination temp\src -Recurse
+Copy-Item test\* -Destination temp\test -Recurse
# clean up debug artifacts if there are any
-Get-ChildItem src, test -Include bin, obj -Recurse | Remove-Item -Recurse
+Get-ChildItem temp -Include bin, obj -Recurse | Remove-Item -Recurse
-Compress-Archive -Path src, test -Update -DestinationPath $zipfile
+Compress-Archive -Path temp\*, LICENSE.txt, NOTICE.txt, keyfile, nms.sln, package.ps1 -Update -DestinationPath $zipfile
+
+write-progress "Removing temp files"
+Remove-Item temp -Recurse
+
+write-progress "Packaging Docs" "Scanning..."
+$pkgdir = "package"
+$zipfile = "$pkgdir\$pkgname-$pkgver-docs.zip"
+
+Compress-Archive -Path "docs\_site\*", "LICENSE.txt", "NOTICE.txt" -Update -DestinationPath $zipfile
write-progress -Completed "Packaging" "Complete."
\ No newline at end of file
diff --git a/src/nms-api/nms-api.csproj b/src/nms-api/nms-api.csproj
index 50c26d3..a5e210f 100644
--- a/src/nms-api/nms-api.csproj
+++ b/src/nms-api/nms-api.csproj
@@ -44,8 +44,14 @@
<RepositoryUrl>https://github.com/apache/activemq-nms-api</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>apache;activemq;nms;api;net;messaging</PackageTags>
+ <PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
</PropertyGroup>
+ <ItemGroup>
+ <None Include="..\..\LICENSE.txt" Pack="true" PackagePath="LICENSE.txt"/>
+ <None Include="..\..\NOTICE.txt" Pack="true" PackagePath="NOTICE.txt"/>
+ </ItemGroup>
+
<ItemGroup Condition=" '$(TargetFramework)' == 'net35' ">
<Reference Include="System.Transactions" />
<Reference Include="System.Web" />
diff --git a/test/nms-api-test/nms-api-test.csproj b/test/nms-api-test/nms-api-test.csproj
index 9747c6b..ec7cd2c 100644
--- a/test/nms-api-test/nms-api-test.csproj
+++ b/test/nms-api-test/nms-api-test.csproj
@@ -44,8 +44,14 @@
<RepositoryUrl>https://github.com/apache/activemq-nms-api</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>apache;activemq;nms;api;net;test;messaging</PackageTags>
+ <PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
</PropertyGroup>
+ <ItemGroup>
+ <None Include="..\..\LICENSE.txt" Pack="true" PackagePath="LICENSE.txt"/>
+ <None Include="..\..\NOTICE.txt" Pack="true" PackagePath="NOTICE.txt"/>
+ </ItemGroup>
+
<PropertyGroup>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\keyfile\NMSKey.snk</AssemblyOriginatorKeyFile>
@@ -53,6 +59,8 @@
<ItemGroup>
<PackageReference Include="NUnit" Version="3.12.0" />
+ <PackageReference Include="NUnit.Console" Version="3.10.0" />
+ <PackageReference Include="NUnit3TestAdapter" Version="3.13.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net35'">