forked from rhq-project/rhq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_deps.sh
executable file
·63 lines (56 loc) · 1.54 KB
/
build_deps.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
56
57
58
59
60
61
62
63
#!/bin/bash
#
#==============================================================================
# Usage:
# ./build_deps.sh
#
# Description:
# There are several libraries on which this branch depends that currently have
# to be built from source. This script performs a clean build from each of the
# upstream libraries and installs them into the local Maven repo.
#
# TODO:
# - verify that we are in the correct branch for each library being built.
#==============================================================================
# include utility library
source `dirname $0`/rhq_bash.lib
build_snappy_java()
{
echo "Building Snappy for Java..."
clone_repo git://github.com/jsanda/snappy-java.git
pushd snappy-java
git checkout -b 1.0.5-M3 origin/1.0.5-M3
run_mvn compile
make
run_mvn install -DskipTests
}
build_datastax_driver()
{
echo "Building DataStax Java driver..."
#clone_repo "git://github.com/datastax/java-driver.git"
clone_repo git://github.com/jsanda/java-driver.git
pushd java-driver
git checkout -b rhq-1.0.0 origin/rhq-1.0.0
run_mvn install -DskipTests
popd
}
clone_repo()
{
git clone $1
[ $? -ne 0 ] && abort "Failed to clone git repository $1"
}
run_mvn()
{
cmd_line=$@
project_dir=$(basename `pwd`)
mvn $@
[ $? -ne 0 ] && abort "Maven build failed for $project_dir"
}
######### MAIN SCRIPT ##########
BUILD_DIR=$HOME/.rhq/cassandra-deps
echo "build directory set to $BUILD_DIR"
rm -rf $BUILD_DIR
mkdir -p $BUILD_DIR
pushd $BUILD_DIR
build_snappy_java
build_datastax_driver