Skip to content

Commit

Permalink
merging bug23996 into default
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlad Alexandru Ionescu committed Mar 29, 2011
2 parents 4920610 + d373173 commit 517b41c
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 30 deletions.
63 changes: 63 additions & 0 deletions dist-lib.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#! /bin/bash

## This source code is dual-licensed under the Apache License, version
## 2.0, and the Mozilla Public License, version 1.1.
##
## The APL v2.0:
##
##---------------------------------------------------------------------------
## Copyright (C) 2007-2011 VMware, Inc.
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http:##www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
##---------------------------------------------------------------------------
##
## The MPL v1.1:
##
##---------------------------------------------------------------------------
## The contents of this file are subject to the Mozilla Public License
## Version 1.1 (the "License"); you may not use this file except in
## compliance with the License. You may obtain a copy of the License
## at http:##www.mozilla.org/MPL/
##
## Software distributed under the License is distributed on an "AS IS"
## basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
## the License for the specific language governing rights and
## limitations under the License.
##
## The Original Code is RabbitMQ.
##
## The Initial Developer of the Original Code is VMware, Inc.
## Copyright (c) 2007-2011 VMware, Inc. All rights reserved.
##---------------------------------------------------------------------------

function assembly-version {
local RELEASE_PATTERN="^[0-9]+(\.[0-9]+){2}$"
local NIGHTLY_PATTERN="^[0-9]+(\.[0-9]+){3}$"
if [[ $1 =~ $RELEASE_PATTERN ]] ; then
ASSEMBLY_VSN=$RABBIT_VSN.0
elif [[ $1 =~ $NIGHTLY_PATTERN ]] ; then
ASSEMBLY_VSN=$RABBIT_VSN
else
echo "Error: invalid version pattern: '$1'" >&2
exit 1
fi
}

function safe-rm-deep-dir {
### Workaround for the path-too-long bug in cygwin
if [ -e "$1" ]; then
mv -f $1 /tmp/del
rm -rf /tmp/del
fi
}

16 changes: 5 additions & 11 deletions dist-msi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ set -x
### Disable sharing files by default (it causes things not to work properly)
CYGWIN=nontsec

. dist-lib.sh

### Overrideable vars
test "$RABBIT_VSN" || RABBIT_VSN=0.0.0.0
test "$SKIP_MSIVAL2" || SKIP_MSIVAL2=
Expand All @@ -57,6 +59,7 @@ NAME=rabbitmq-dotnet-client
NAME_VSN=$NAME-$RABBIT_VSN
RELEASE_DIR=release

assembly-version $RABBIT_VSN

function main {
get-sources
Expand All @@ -80,7 +83,7 @@ function build-msm-msi {
candle -out ../tmp/wix/rabbitmq-dotnet-client-msm.wixobj dotnet-client-merge-module.wxs
light -out ../tmp/wix/rabbitmq-dotnet-client.msm ../tmp/wix/rabbitmq-dotnet-client-msm.wixobj
test "$SKIP_MSIVAL2" || MsiVal2.exe ../tmp/wix/rabbitmq-dotnet-client.msm ../lib/wix/mergemod.cub -f

gen-wxs dotnet-client-product.wxs
candle -out ../tmp/wix/rabbitmq-dotnet-client-msi.wixobj dotnet-client-product.wxs
light -out ../tmp/wix/rabbitmq-dotnet-client.msi \
Expand Down Expand Up @@ -112,7 +115,7 @@ function gen-wxs {
set +x
f=$1
local IFS=''
sed -e "s:@VERSION@:$RABBIT_VSN:g" <${f}.in | while read -r l ; do
sed -e "s:@VERSION@:$ASSEMBLY_VSN:g" <${f}.in | while read -r l ; do
if [ -z "$l" -o -n "${l##@FILES *}" ] ; then
echo "$l"
else
Expand Down Expand Up @@ -185,13 +188,4 @@ function gen-license-rtf {
}


function safe-rm-deep-dir {
### Workaround for the path-too-long bug in cygwin
if [ -e "$1" ]; then
mv -f $1 /tmp/del
rm -rf /tmp/del
fi
}


main $@
32 changes: 13 additions & 19 deletions dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ set -x
### Disable sharing files by default (it causes things not to work properly)
CYGWIN=nontsec

. dist-lib.sh

### Overrideable vars
test "$KEYFILE" || KEYFILE=rabbit-mock.snk
test "$RABBIT_VSN" || RABBIT_VSN=0.0.0.0
Expand All @@ -69,6 +71,7 @@ else
DOTNET_PROGRAM_PREPEND=
fi

assembly-version $RABBIT_VSN

function main {
### Remove everything in the release dir and create the dir again
Expand Down Expand Up @@ -147,15 +150,6 @@ function cp-license-to {
}


function safe-rm-deep-dir {
### Workaround for the path-too-long bug in cygwin
if [ -e "$1" ]; then
mv -f $1 /tmp/del
rm -rf /tmp/del
fi
}


function src-dist {
### Copy files to be zipped to tmp/srcdist/
mkdir -p tmp/srcdist/docs/specs tmp/srcdist/lib
Expand All @@ -177,7 +171,7 @@ function src-dist {
cd tmp/srcdist
zip -r ../../$RELEASE_DIR/$NAME_VSN.zip . -x \*.snk \*.resharper \*.csproj.user
cd ../..

### Remove tmp/srcdist
rm -rf tmp/srcdist
}
Expand Down Expand Up @@ -211,7 +205,7 @@ function dist-target-framework {

### Build
$MSBUILD RabbitMQDotNetClient.sln /t:Build /property:Configuration="Release"

### Copy bin files to be zipped to tmp/dist/
cp projects/client/RabbitMQ.Client/build/bin/RabbitMQ.Client.xml tmp/dist/bin/
cp projects/client/RabbitMQ.Client/build/bin/RabbitMQ.Client.dll tmp/dist/bin/
Expand All @@ -220,15 +214,15 @@ function dist-target-framework {
done
test "$BUILD_WCF" && cp projects/wcf/RabbitMQ.ServiceModel/build/bin/RabbitMQ.ServiceModel.dll tmp/dist/bin/
cp-license-to tmp/dist/

### Zip tmp/dist
cd tmp/dist
zip -r ../../$RELEASE_DIR/$NAME_VSN-$TARGET_FRAMEWORK.zip .
cd ../..

### Remove tmp/dist
rm -rf tmp/dist

### Restore Local.props
rm -f ./Local.props
test "$LOCAL_PROPS_EXISTS" && mv ./Local.props.user ./Local.props || true
Expand All @@ -240,7 +234,7 @@ function gen-props {
else
USING_MONO="false"
fi
sed -e "s:@VERSION@:$RABBIT_VSN:g" \
sed -e "s:@VERSION@:$ASSEMBLY_VSN:g" \
-e "s:@KEYFILE@:$KEYFILE:g" \
-e "s:@USINGMONO@:$USING_MONO:g" \
< $1 > $2
Expand All @@ -262,14 +256,14 @@ function gendoc-dist {

cd $PROJECT_DIR

### Generate XMLs with ndocproc
### Generate XMLs with ndocproc
$DOTNET_PROGRAM_PREPEND $RELATIVE_DIR/lib/ndocproc-bin/bin/ndocproc.exe \
/nosubtypes \
$EXTRA_NDOCPROC_ARGS \
$RELATIVE_DIR/tmp/gendoc/xml \
$XML_SOURCE_FILE \
$RELATIVE_DIR/docs/namespaces.xml

cd $RELATIVE_DIR

### Zip ndocproc's output
Expand All @@ -278,17 +272,17 @@ function gendoc-dist {
zip -r ../../../$RELEASE_DIR/$ZIP_TMP_XML_DOC_FILENAME .
cd ../../..
fi

### Transform to html, using xsltproc
genhtml index index
genhtml namespace- namespace
genhtml type- type

### Remove generated XMLs and copy remaining files to be added to the .zip
rm -rf tmp/gendoc/xml
cp lib/ndocproc-bin/xsl/style.css tmp/gendoc/html/
cp-license-to tmp/gendoc/

### Zip tmp/gendoc
cd tmp/gendoc
zip -r ../../$RELEASE_DIR/$ZIP_DESTINATION_FILENAME .
Expand Down

0 comments on commit 517b41c

Please sign in to comment.