Skip to content

Commit 517b41c

Browse files
author
Vlad Alexandru Ionescu
committed
merging bug23996 into default
2 parents 4920610 + d373173 commit 517b41c

File tree

3 files changed

+81
-30
lines changed

3 files changed

+81
-30
lines changed

dist-lib.sh

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#! /bin/bash
2+
3+
## This source code is dual-licensed under the Apache License, version
4+
## 2.0, and the Mozilla Public License, version 1.1.
5+
##
6+
## The APL v2.0:
7+
##
8+
##---------------------------------------------------------------------------
9+
## Copyright (C) 2007-2011 VMware, Inc.
10+
##
11+
## Licensed under the Apache License, Version 2.0 (the "License");
12+
## you may not use this file except in compliance with the License.
13+
## You may obtain a copy of the License at
14+
##
15+
## http:##www.apache.org/licenses/LICENSE-2.0
16+
##
17+
## Unless required by applicable law or agreed to in writing, software
18+
## distributed under the License is distributed on an "AS IS" BASIS,
19+
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20+
## See the License for the specific language governing permissions and
21+
## limitations under the License.
22+
##---------------------------------------------------------------------------
23+
##
24+
## The MPL v1.1:
25+
##
26+
##---------------------------------------------------------------------------
27+
## The contents of this file are subject to the Mozilla Public License
28+
## Version 1.1 (the "License"); you may not use this file except in
29+
## compliance with the License. You may obtain a copy of the License
30+
## at http:##www.mozilla.org/MPL/
31+
##
32+
## Software distributed under the License is distributed on an "AS IS"
33+
## basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
34+
## the License for the specific language governing rights and
35+
## limitations under the License.
36+
##
37+
## The Original Code is RabbitMQ.
38+
##
39+
## The Initial Developer of the Original Code is VMware, Inc.
40+
## Copyright (c) 2007-2011 VMware, Inc. All rights reserved.
41+
##---------------------------------------------------------------------------
42+
43+
function assembly-version {
44+
local RELEASE_PATTERN="^[0-9]+(\.[0-9]+){2}$"
45+
local NIGHTLY_PATTERN="^[0-9]+(\.[0-9]+){3}$"
46+
if [[ $1 =~ $RELEASE_PATTERN ]] ; then
47+
ASSEMBLY_VSN=$RABBIT_VSN.0
48+
elif [[ $1 =~ $NIGHTLY_PATTERN ]] ; then
49+
ASSEMBLY_VSN=$RABBIT_VSN
50+
else
51+
echo "Error: invalid version pattern: '$1'" >&2
52+
exit 1
53+
fi
54+
}
55+
56+
function safe-rm-deep-dir {
57+
### Workaround for the path-too-long bug in cygwin
58+
if [ -e "$1" ]; then
59+
mv -f $1 /tmp/del
60+
rm -rf /tmp/del
61+
fi
62+
}
63+

dist-msi.sh

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ set -x
4848
### Disable sharing files by default (it causes things not to work properly)
4949
CYGWIN=nontsec
5050

51+
. dist-lib.sh
52+
5153
### Overrideable vars
5254
test "$RABBIT_VSN" || RABBIT_VSN=0.0.0.0
5355
test "$SKIP_MSIVAL2" || SKIP_MSIVAL2=
@@ -57,6 +59,7 @@ NAME=rabbitmq-dotnet-client
5759
NAME_VSN=$NAME-$RABBIT_VSN
5860
RELEASE_DIR=release
5961

62+
assembly-version $RABBIT_VSN
6063

6164
function main {
6265
get-sources
@@ -80,7 +83,7 @@ function build-msm-msi {
8083
candle -out ../tmp/wix/rabbitmq-dotnet-client-msm.wixobj dotnet-client-merge-module.wxs
8184
light -out ../tmp/wix/rabbitmq-dotnet-client.msm ../tmp/wix/rabbitmq-dotnet-client-msm.wixobj
8285
test "$SKIP_MSIVAL2" || MsiVal2.exe ../tmp/wix/rabbitmq-dotnet-client.msm ../lib/wix/mergemod.cub -f
83-
86+
8487
gen-wxs dotnet-client-product.wxs
8588
candle -out ../tmp/wix/rabbitmq-dotnet-client-msi.wixobj dotnet-client-product.wxs
8689
light -out ../tmp/wix/rabbitmq-dotnet-client.msi \
@@ -112,7 +115,7 @@ function gen-wxs {
112115
set +x
113116
f=$1
114117
local IFS=''
115-
sed -e "s:@VERSION@:$RABBIT_VSN:g" <${f}.in | while read -r l ; do
118+
sed -e "s:@VERSION@:$ASSEMBLY_VSN:g" <${f}.in | while read -r l ; do
116119
if [ -z "$l" -o -n "${l##@FILES *}" ] ; then
117120
echo "$l"
118121
else
@@ -185,13 +188,4 @@ function gen-license-rtf {
185188
}
186189

187190

188-
function safe-rm-deep-dir {
189-
### Workaround for the path-too-long bug in cygwin
190-
if [ -e "$1" ]; then
191-
mv -f $1 /tmp/del
192-
rm -rf /tmp/del
193-
fi
194-
}
195-
196-
197191
main $@

dist.sh

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ set -x
4848
### Disable sharing files by default (it causes things not to work properly)
4949
CYGWIN=nontsec
5050

51+
. dist-lib.sh
52+
5153
### Overrideable vars
5254
test "$KEYFILE" || KEYFILE=rabbit-mock.snk
5355
test "$RABBIT_VSN" || RABBIT_VSN=0.0.0.0
@@ -69,6 +71,7 @@ else
6971
DOTNET_PROGRAM_PREPEND=
7072
fi
7173

74+
assembly-version $RABBIT_VSN
7275

7376
function main {
7477
### Remove everything in the release dir and create the dir again
@@ -147,15 +150,6 @@ function cp-license-to {
147150
}
148151

149152

150-
function safe-rm-deep-dir {
151-
### Workaround for the path-too-long bug in cygwin
152-
if [ -e "$1" ]; then
153-
mv -f $1 /tmp/del
154-
rm -rf /tmp/del
155-
fi
156-
}
157-
158-
159153
function src-dist {
160154
### Copy files to be zipped to tmp/srcdist/
161155
mkdir -p tmp/srcdist/docs/specs tmp/srcdist/lib
@@ -177,7 +171,7 @@ function src-dist {
177171
cd tmp/srcdist
178172
zip -r ../../$RELEASE_DIR/$NAME_VSN.zip . -x \*.snk \*.resharper \*.csproj.user
179173
cd ../..
180-
174+
181175
### Remove tmp/srcdist
182176
rm -rf tmp/srcdist
183177
}
@@ -211,7 +205,7 @@ function dist-target-framework {
211205

212206
### Build
213207
$MSBUILD RabbitMQDotNetClient.sln /t:Build /property:Configuration="Release"
214-
208+
215209
### Copy bin files to be zipped to tmp/dist/
216210
cp projects/client/RabbitMQ.Client/build/bin/RabbitMQ.Client.xml tmp/dist/bin/
217211
cp projects/client/RabbitMQ.Client/build/bin/RabbitMQ.Client.dll tmp/dist/bin/
@@ -220,15 +214,15 @@ function dist-target-framework {
220214
done
221215
test "$BUILD_WCF" && cp projects/wcf/RabbitMQ.ServiceModel/build/bin/RabbitMQ.ServiceModel.dll tmp/dist/bin/
222216
cp-license-to tmp/dist/
223-
217+
224218
### Zip tmp/dist
225219
cd tmp/dist
226220
zip -r ../../$RELEASE_DIR/$NAME_VSN-$TARGET_FRAMEWORK.zip .
227221
cd ../..
228222

229223
### Remove tmp/dist
230224
rm -rf tmp/dist
231-
225+
232226
### Restore Local.props
233227
rm -f ./Local.props
234228
test "$LOCAL_PROPS_EXISTS" && mv ./Local.props.user ./Local.props || true
@@ -240,7 +234,7 @@ function gen-props {
240234
else
241235
USING_MONO="false"
242236
fi
243-
sed -e "s:@VERSION@:$RABBIT_VSN:g" \
237+
sed -e "s:@VERSION@:$ASSEMBLY_VSN:g" \
244238
-e "s:@KEYFILE@:$KEYFILE:g" \
245239
-e "s:@USINGMONO@:$USING_MONO:g" \
246240
< $1 > $2
@@ -262,14 +256,14 @@ function gendoc-dist {
262256

263257
cd $PROJECT_DIR
264258

265-
### Generate XMLs with ndocproc
259+
### Generate XMLs with ndocproc
266260
$DOTNET_PROGRAM_PREPEND $RELATIVE_DIR/lib/ndocproc-bin/bin/ndocproc.exe \
267261
/nosubtypes \
268262
$EXTRA_NDOCPROC_ARGS \
269263
$RELATIVE_DIR/tmp/gendoc/xml \
270264
$XML_SOURCE_FILE \
271265
$RELATIVE_DIR/docs/namespaces.xml
272-
266+
273267
cd $RELATIVE_DIR
274268

275269
### Zip ndocproc's output
@@ -278,17 +272,17 @@ function gendoc-dist {
278272
zip -r ../../../$RELEASE_DIR/$ZIP_TMP_XML_DOC_FILENAME .
279273
cd ../../..
280274
fi
281-
275+
282276
### Transform to html, using xsltproc
283277
genhtml index index
284278
genhtml namespace- namespace
285279
genhtml type- type
286-
280+
287281
### Remove generated XMLs and copy remaining files to be added to the .zip
288282
rm -rf tmp/gendoc/xml
289283
cp lib/ndocproc-bin/xsl/style.css tmp/gendoc/html/
290284
cp-license-to tmp/gendoc/
291-
285+
292286
### Zip tmp/gendoc
293287
cd tmp/gendoc
294288
zip -r ../../$RELEASE_DIR/$ZIP_DESTINATION_FILENAME .

0 commit comments

Comments
 (0)