Skip to content

Commit 9d57b40

Browse files
cfcf
cf
authored and
cf
committed
Merge with latest internal version
1 parent 0ac9323 commit 9d57b40

File tree

250 files changed

+7163
-4247
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

250 files changed

+7163
-4247
lines changed

ChangeLog

+30-12
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,34 @@
1-
Tue Aug 21 21:09:14 2012 Tencent Inc. <[email protected]>
1+
2012-08-21 Tencent Inc. <[email protected]>
22

3-
* blade: version 1.0
4-
* initialize opensource release
3+
* blade: version 1.0
4+
* initialize opensource release
55

6-
Tue Dec 25 11:21:00 2012 Tencent Inc. <[email protected]>
6+
2012-12-25 Tencent Inc. <[email protected]>
77

8-
* Add is_debug for build_target
9-
* Add prompt message to source bashrc after install blade
10-
* Skip making duplicate prebuit lib symlink and remove useless warning
11-
* Add graphviz output to blade query command.
12-
* Do not exit when symlink existed
13-
* Fixed loop dependency detecting in recursive method
14-
* Updated user manual-config part of blade_user_manual.pdf
15-
* Allow libs in global config files starts with '//'
8+
* Add is_debug for build_target
9+
* Add prompt message to source bashrc after install blade
10+
* Skip making duplicate prebuit lib symlink and remove useless warning
11+
* Add graphviz output to blade query command.
12+
* Do not exit when symlink existed
13+
* Fixed loop dependency detecting in recursive method
14+
* Updated user manual-config part of blade_user_manual.pdf
15+
* Allow libs in global config files starts with '//'
1616

17+
2013-02-21 Tencent Inc. <[email protected]>
18+
19+
* Fix readlink compatible issue, enable run blade on MAC.
20+
* Add cpp_flags, c_flags, cxx_flags to cc_config
21+
* Dump the CC CPP CXX LD at startup
22+
* Add prompt message to source bashrc after install blade
23+
* Refactoring configure
24+
* Add -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
25+
to enable full functional stdint.h and inttypes.h for C++
26+
27+
2013-03-21 Tencent Inc. <[email protected]>
28+
29+
* Make test run easier and python 2.6 compatible.
30+
* Fix problem of no response to ctrl-c when run tests
31+
* Support --gcov for gcc 3.x
32+
* Enlarge the size of stack size warning to 64+8k
33+
34+
Copyright 2012, 2013 Tencent, Inc.

blade

+20-77
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
function _info()
2020
{
2121
if [ -t 1 ]; then
22-
echo -e "\033[1;36mBlade(info): $@\033[m"
22+
echo -e "\033[1;36mBlade(info): $@\033[m" >&2
2323
else
24-
echo -e "Blade(info): $@"
24+
echo -e "Blade(info): $@" >&2
2525
fi
2626
}
2727

@@ -44,7 +44,7 @@ function _error_exit()
4444
exit 1
4545
}
4646

47-
function full_real_path()
47+
function _full_real_path()
4848
{
4949
local o
5050
local f
@@ -69,100 +69,43 @@ function full_real_path()
6969
return 0
7070
}
7171

72-
blade_path=`full_real_path $0`
73-
72+
blade_path=`_full_real_path $0`
7473
blade_dir=$(cd $(dirname $blade_path) && pwd)
75-
7674
blade_file="$blade_dir/blade.zip"
7775

76+
if [[ "$BLADE_AUTO_UPGRADE" != "no" ]]; then
77+
# Auto update blade main program to latest version and run it
78+
if svn_up_info=`svn up --trust-server-cert --non-interactive ${blade_dir} 2>&1`; then
79+
_info "auto upgrade success: $svn_up_info"
80+
else
81+
_warning "Auto upgrade failure: $svn_up_info"
82+
_warning "Please svn up $blade_dir"
83+
fi
84+
fi
85+
7886
# Check the python version at first, exit blade when python
7987
# version is under 2.6
8088
no_python=$(which python 2>&1 | grep 'which: no')
81-
if [[ -n "$no_python" ]]
82-
then
89+
if [[ -n "$no_python" ]]; then
8390
_error_exit "Please install python 2.6 or above in your system"
8491
fi
8592

8693
python_ver=$(python -V 2>&1 | sed 's/Python //g')
8794

88-
if [[ "$python_ver" < "2.6" ]]
89-
then
95+
if [[ "$python_ver" < "2.6" ]]; then
9096
_info "Python version in your machine: $python_ver"
9197
_error_exit "Please upgrade your python version to 2.6 or above"
9298
fi
9399

94100
# Check scons environment
95101
no_scons=$(which scons 2>&1 | grep 'which: no scons in')
96-
if [[ -n "$no_scons" ]]
97-
then
102+
if [[ -n "$no_scons" ]]; then
98103
_error_exit "Please install scons v2.0 or above on your machine"
99104
fi
100105

101-
# blade now
102-
if [[ ! -f "$blade_file" ]]
103-
then
106+
# Check blade.zip
107+
if [[ ! -f "$blade_file" ]]; then
104108
_error_exit "Cannot find the core file $blade_file"
105109
fi
106110

107-
# for _find_project_root
108-
source $blade_dir/bladefunctions
109-
110-
if blade_root=`_find_project_root`; then
111-
# in old version of blade, there is no blade.py but blade only
112-
blade_path=$blade_root/common/builder/blade
113-
114-
# auto update blade main program to latest version and run it
115-
if svn_up_info=`svn up --trust-server-cert --non-interactive ${blade_path} 2>&1`; then
116-
_info "$svn_up_info"
117-
else
118-
_warning "Auto upgrade failure: $svn_up_info"
119-
_warning "Please svn up $blade_path"
120-
fi
121-
122-
blade=$blade_path/blade
123-
blade_py=${blade}.py
124-
blade2=${blade}.zip
125-
126-
build_by_blade2=1
127-
actions="^(build|run|test|query|clean|--help)$"
128-
129-
if [ "$#" -ge 1 ]; then
130-
if [[ ! "$1" =~ $actions ]]; then
131-
build_by_blade2=0
132-
fi
133-
fi
134-
135-
136-
if [ $build_by_blade2 -eq 1 ]
137-
then
138-
_info 'Welcome to blade2'
139-
if [ -e "$blade_file" ]; then
140-
python $blade_file "$@"
141-
else
142-
_error_exit "Cannot find the core file $blade_file"
143-
exit 1
144-
fi
145-
else
146-
case "$1" in
147-
-t)
148-
action="test"
149-
;;
150-
-c)
151-
action="clean"
152-
;;
153-
*)
154-
action="build"
155-
;;
156-
esac
157-
_error_exit "Command should be 'blade $action'"
158-
if [ -e "$blade_py" ]; then
159-
blade_python=$blade_py
160-
else
161-
blade_python=$blade
162-
fi
163-
$blade_python "$@"
164-
fi
165-
166-
else
167-
_error_exit "Can't find BLADE_ROOT, are you in a correct source dir tree?"
168-
fi
111+
python $blade_file "$@"

blade.conf

+10-1
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,20 @@ proto_library_config(
2020
protoc='thirdparty/protobuf/bin/protoc',
2121
protobuf_libs=['thirdparty/protobuf:protobuf'],
2222
protobuf_path='thirdparty',
23-
protobuf_include_path = 'thirdparty',
23+
protobuf_incs = 'thirdparty',
2424
protobuf_php_path='thirdparty/Protobuf-PHP/library',
2525
protoc_php_plugin='thirdparty/Protobuf-PHP/protoc-gen-php.php'
2626
)
2727

28+
thrift_library_config(
29+
# The path to thrift compiler.
30+
thrift='/usr/local/bin/thrift',
31+
# The libraries depended by thrift.
32+
thrift_libs=['#thrift', '#pthread'],
33+
# The extra include paths to be passed to thrift compiler.
34+
thrift_incs=[],
35+
)
36+
2837
cc_config(
2938
extra_incs='thirdparty'
3039
)

0 commit comments

Comments
 (0)