forked from tony19/logback-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease.sh
executable file
·55 lines (48 loc) · 1.63 KB
/
release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/sh
##############################################################################
# Logback: the reliable, generic, fast and flexible logging framework.
# Copyright (C) 2011-2012, Anthony Trinh. All rights reserved.
# Copyright (C) 1999-2011, QOS.ch. All rights reserved.
#
# This program and the accompanying materials are dual-licensed under
# either the terms of the Eclipse Public License v1.0 as published by
# the Eclipse Foundation
#
# or (per the licensee's choosing)
#
# under the terms of the GNU Lesser General Public License version 2.1
# as published by the Free Software Foundation.
##############################################################################
if [ ! $1 ]; then
echo "Usage: $0 {version}"
exit 1
fi
readme=../../README.md
cd build/ant || exit 1
#
# Release version "x.x.x-N"
#
# where
# x.x.x is the version of Logback on which Logback-Android is based
# and
# N is the integral release number of Logback-Android.
#
version=$1
outf=logback-android-${version}.jar
echo "Starting release process for Logback-Android ${version}..."
# prompt for keystore password (hide input)
echo "Enter keystore password to sign JAR: "
stty -echo
read password
stty echo
#
# Build the JAR and print its MD5. The last line uses GNU sed (gsed)
# to update the README with the current release version.
#
ant clean release -Dkey.store.password=${password} -Dversion=${version} && \
md5 bin/${outf} && \
echo "Updating README.md" && \
gsed -i -e "s/logback-android-[^j]*\.jar/${outf}/" \
-e "s/\*\*[0-9\.\-]*\*\*/\*\*${version}\*\*/" \
-e "s/\(logback-android.*MD5\:\).*/\1 \`$(md5 bin/${outf} | awk '{print $4}')\`)/" ${readme}
echo Done