Skip to content

Commit 7ef73e7

Browse files
committed
AMQNET-590: NMS AMQP Add package script
1 parent 2d565c7 commit 7ef73e7

File tree

4 files changed

+136
-47
lines changed

4 files changed

+136
-47
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,3 +260,4 @@ ModelManifest.xml
260260
# FAKE - F# Make
261261
.fake/
262262
.idea/
263+
package/
File renamed without changes.

package.ps1

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
$pkgname = "Apache.NMS.AMQP"
17+
$pkgver = "1.8.0"
18+
$frameworks = "netstandard2.0"
19+
20+
write-progress "Creating package directory." "Initializing..."
21+
if (!(test-path package)) {
22+
mkdir package
23+
}
24+
else {
25+
# Clean package content if exists
26+
Remove-Item package\* -Recurse
27+
}
28+
29+
if (test-path build) {
30+
Push-Location build
31+
32+
$pkgdir = "..\package"
33+
34+
write-progress "Packaging Application files." "Scanning..."
35+
$zipfile = "$pkgdir\$pkgname-$pkgver-bin.zip"
36+
37+
Compress-Archive -Path ..\LICENSE.txt, ..\NOTICE.txt -Update -DestinationPath $zipfile
38+
39+
# clean up temp
40+
Remove-Item temp -Recurse -ErrorAction Ignore
41+
42+
foreach ($framework in $frameworks) {
43+
Copy-Item $framework -Destination temp\$framework -Recurse
44+
Compress-Archive -Path "temp\$framework" -Update -DestinationPath $zipfile
45+
}
46+
47+
$nupkg = "$pkgname.$pkgver.nupkg"
48+
$nupkgdestination = "$pkgdir\$nupkg"
49+
Copy-Item -Path $nupkg -Destination $nupkgdestination
50+
51+
# clean up temp
52+
Remove-Item temp -Recurse -ErrorAction Inquire
53+
54+
Pop-Location
55+
}
56+
57+
write-progress "Packaging Source code files." "Scanning..."
58+
$pkgdir = "package"
59+
$zipfile = "$pkgdir\$pkgname-$pkgver-src.zip"
60+
61+
# clean temp dir if exists
62+
Remove-Item temp -Recurse -ErrorAction Ignore
63+
64+
# copy files to temp dir
65+
Copy-Item src -Destination temp\src -Recurse
66+
Copy-Item test -Destination temp\test -Recurse
67+
68+
# clean up debug artifacts if there are any
69+
Get-ChildItem temp -Include bin, obj -Recurse | Remove-Item -Recurse
70+
71+
Compress-Archive -Path temp\*, LICENSE.txt, NOTICE.txt, README.md, apache-nms-amqp.sln, package.ps1 -Update -DestinationPath $zipfile
72+
73+
write-progress "Removing temp files"
74+
Remove-Item temp -Recurse
75+
76+
write-progress -Completed "Packaging" "Complete."

src/NMS.AMQP/Apache-NMS-AMQP.csproj

Lines changed: 59 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -16,54 +16,66 @@ with the License. You may obtain a copy of the License at
1616
under the License.
1717
-->
1818
<Project Sdk="Microsoft.NET.Sdk">
19-
<PropertyGroup>
20-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
21-
<OutputType>Library</OutputType>
22-
<TargetFrameworks>netstandard2.0</TargetFrameworks>
23-
<RootNamespace>Apache.NMS.AMQP</RootNamespace>
24-
<AssemblyName>Apache.NMS.AMQP</AssemblyName>
25-
<LangVersion>7.3</LangVersion>
26-
</PropertyGroup>
19+
<PropertyGroup>
20+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
21+
<OutputType>Library</OutputType>
22+
<TargetFrameworks>netstandard2.0</TargetFrameworks>
23+
<RootNamespace>Apache.NMS.AMQP</RootNamespace>
24+
<AssemblyName>Apache.NMS.AMQP</AssemblyName>
25+
<LangVersion>7.3</LangVersion>
26+
</PropertyGroup>
2727

28-
<PropertyGroup>
29-
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
30-
<PackageId>Apache.NMS.AMQP</PackageId>
31-
<Version>1.0.0</Version>
32-
<Authors>Apache ActiveMQ</Authors>
33-
<Company>Apache Software Foundation</Company>
34-
<Product>Apache ActiveMQ NMS AMQP Client</Product>
35-
<Description>Apache ActiveMQ NMS.AMQP provides a NMS based client that uses the AMQP v1.0 protocol.</Description>
36-
<Copyright>Copyright (C) 2005-2019 Apache Software Foundation</Copyright>
37-
<PackageProjectUrl>https://activemq.apache.org/components/nms/</PackageProjectUrl>
38-
<PackageLicense>https://github.com/apache/activemq-nms-amqp/blob/master/NOTICE.txt</PackageLicense>
39-
<PackageIconUrl>https://activemq.apache.org/assets/img/activemq_logo_icon.png</PackageIconUrl>
40-
<RepositoryUrl>https://github.com/apache/activemq-nms-amqp</RepositoryUrl>
41-
<RepositoryType>git</RepositoryType>
42-
<PackageTags>apache;activemq;nms;amqp;net;messaging</PackageTags>
43-
</PropertyGroup>
28+
<PropertyGroup Condition="'$(Configuration)'=='Release'">
29+
<OutputPath>..\..\build\</OutputPath>
30+
<AppendTargetFrameworkToOutputPath>true</AppendTargetFrameworkToOutputPath>
31+
</PropertyGroup>
4432

45-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
46-
<DebugSymbols>true</DebugSymbols>
47-
<DebugType>full</DebugType>
48-
<Optimize>false</Optimize>
49-
<!-- To debug Message dispatch MultiThreading -->
50-
<!-- <DefineConstants>DEBUG;TRACE;TRACELOCKS</DefineConstants> -->
51-
<DefineConstants>DEBUG;TRACE</DefineConstants>
52-
<ErrorReport>prompt</ErrorReport>
53-
<WarningLevel>4</WarningLevel>
54-
</PropertyGroup>
55-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
56-
<DebugType>pdbonly</DebugType>
57-
<Optimize>true</Optimize>
58-
<DefineConstants>TRACE</DefineConstants>
59-
<ErrorReport>prompt</ErrorReport>
60-
<WarningLevel>4</WarningLevel>
61-
</PropertyGroup>
33+
<PropertyGroup>
34+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
35+
<PackageId>Apache.NMS.AMQP</PackageId>
36+
<Version>1.8.0</Version>
37+
<Authors>Apache ActiveMQ</Authors>
38+
<Company>Apache Software Foundation</Company>
39+
<Product>Apache ActiveMQ NMS AMQP Client</Product>
40+
<Description>Apache ActiveMQ NMS.AMQP provides a NMS based client that uses the AMQP v1.0 protocol.</Description>
41+
<Copyright>Copyright (C) 2005-2019 Apache Software Foundation</Copyright>
42+
<PackageProjectUrl>https://activemq.apache.org/components/nms/</PackageProjectUrl>
43+
<PackageLicense>https://github.com/apache/activemq-nms-amqp/blob/master/NOTICE.txt</PackageLicense>
44+
<PackageIconUrl>https://activemq.apache.org/assets/img/activemq_logo_icon.png</PackageIconUrl>
45+
<RepositoryUrl>https://github.com/apache/activemq-nms-amqp</RepositoryUrl>
46+
<RepositoryType>git</RepositoryType>
47+
<PackageTags>apache;activemq;nms;amqp;net;messaging</PackageTags>
48+
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
49+
</PropertyGroup>
6250

63-
<ItemGroup>
64-
<!-- AMQPNetLite.Core is .NET Standard 1.3 package -->
65-
<PackageReference Include="AMQPNetLite.Core" Version="2.1.7" />
66-
<PackageReference Include="Apache.NMS" Version="1.8.0" />
67-
<PackageReference Include="System.Threading.Tasks.Dataflow" Version="4.9.0" />
68-
</ItemGroup>
51+
<ItemGroup>
52+
<None Include="..\..\LICENSE.txt" Pack="true" PackagePath="LICENSE.txt"/>
53+
<None Include="..\..\NOTICE.txt" Pack="true" PackagePath="NOTICE.txt"/>
54+
</ItemGroup>
55+
56+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
57+
<DebugSymbols>true</DebugSymbols>
58+
<DebugType>full</DebugType>
59+
<Optimize>false</Optimize>
60+
<!-- To debug Message dispatch MultiThreading -->
61+
<!-- <DefineConstants>DEBUG;TRACE;TRACELOCKS</DefineConstants> -->
62+
<DefineConstants>DEBUG;TRACE</DefineConstants>
63+
<ErrorReport>prompt</ErrorReport>
64+
<WarningLevel>4</WarningLevel>
65+
</PropertyGroup>
66+
67+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
68+
<DebugType>pdbonly</DebugType>
69+
<Optimize>true</Optimize>
70+
<DefineConstants>TRACE</DefineConstants>
71+
<ErrorReport>prompt</ErrorReport>
72+
<WarningLevel>4</WarningLevel>
73+
</PropertyGroup>
74+
75+
<ItemGroup>
76+
<!-- AMQPNetLite.Core is .NET Standard 1.3 package -->
77+
<PackageReference Include="AMQPNetLite.Core" Version="2.1.7"/>
78+
<PackageReference Include="Apache.NMS" Version="1.8.0"/>
79+
<PackageReference Include="System.Threading.Tasks.Dataflow" Version="4.9.0"/>
80+
</ItemGroup>
6981
</Project>

0 commit comments

Comments
 (0)