Skip to content

Commit f224505

Browse files
committed
bootstrap: create common directory and move tool to build apk in it. start to separate the java part.
1 parent be95db2 commit f224505

Some content is hidden

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

53 files changed

+23
-9
lines changed
File renamed without changes.

bootstrap/legacy/build.py renamed to bootstrap/common/build.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ def render(template, dest, **kwargs):
6868
template = environment.get_template(template)
6969
text = template.render(**kwargs)
7070

71+
dir_dest = dirname(dest)
72+
if dir_dest and not os.path.exists(dir_dest):
73+
os.makedirs(dir_dest)
74+
7175
f = file(dest, 'wb')
7276
f.write(text.encode('utf-8'))
7377
f.close()
@@ -267,7 +271,7 @@ def make_package(args):
267271
sys.exit(-1)
268272

269273
# Get target android API
270-
android_api = int(os.environ.get('ANDROIDAPI', '8'))
274+
android_api = int(os.environ.get('ANDROIDAPI', '14'))
271275

272276
# Render the various templates into control files.
273277
render(

bootstrap/common/src/.empty

Whitespace-only changes.

bootstrap/legacy/templates/build.xml renamed to bootstrap/common/templates/build.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project name="{{ versioned_name }}" default="help">
33

4-
<loadproperties srcFile="local.properties" />
4+
<property file="local.properties" />
55
<property file="ant.properties" />
6+
<property environment="env" />
7+
<condition property="sdk.dir" value="${env.ANDROID_HOME}">
8+
<isset property="env.ANDROID_HOME" />
9+
</condition>
10+
611
<loadproperties srcFile="project.properties" />
712

813
<fail
@@ -15,6 +20,7 @@
1520
</target>
1621
<target name="-post-compile">
1722
</target>
23+
<!-- version-tag: 1.0 -->
1824
<import file="${sdk.dir}/tools/ant/build.xml" />
1925

2026
</project>
File renamed without changes.

bootstrap/minimal/src/.empty

Whitespace-only changes.

distribute.sh

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ SITEPACKAGES_PATH="$BUILD_PATH/python-install/lib/python2.7/site-packages/"
5555
HOSTPYTHON="$BUILD_PATH/python-install/bin/python.host"
5656
CYTHON="cython -t"
5757
BOOTSTRAP_PATH="$ROOT_PATH/bootstrap"
58+
BOOTSTRAP_COMMON_PATH="$BOOTSTRAP_PATH/common"
5859
#SRC_PATH="$ROOT_PATH/src"
5960
#JNI_PATH="$SRC_PATH/jni"
6061

@@ -384,8 +385,8 @@ function run_prepare() {
384385
echo "sdk.dir=$ANDROIDSDK" > $SRC_PATH/local.properties
385386

386387
# copy the initial blacklist in build
387-
try cp -a $SRC_PATH/blacklist.txt $BUILD_PATH
388-
try cp -a $SRC_PATH/whitelist.txt $BUILD_PATH
388+
try cp -a $BOOTSTRAP_COMMON_PATH/blacklist.txt $BUILD_PATH
389+
try cp -a $BOOTSTRAP_COMMON_PATH/whitelist.txt $BUILD_PATH
389390

390391
# check arm env
391392
push_arm
@@ -744,11 +745,12 @@ function run_distribute() {
744745
debug "Copy default files"
745746
try cp -a $SRC_PATH/default.properties .
746747
try cp -a $SRC_PATH/local.properties .
747-
try cp -a $SRC_PATH/build.py .
748-
try cp -a $SRC_PATH/buildlib .
748+
try cp -a $BOOTSTRAP_COMMON_PATH/build.py .
749+
try cp -a $BOOTSTRAP_COMMON_PATH/buildlib .
750+
try cp -a $BOOTSTRAP_COMMON_PATH/src .
751+
try cp -a $BOOTSTRAP_COMMON_PATH/templates .
752+
try cp -a $BOOTSTRAP_COMMON_PATH/res .
749753
try cp -a $SRC_PATH/src .
750-
try cp -a $SRC_PATH/templates .
751-
try cp -a $SRC_PATH/res .
752754
try cp -a $BUILD_PATH/blacklist.txt .
753755
try cp -a $BUILD_PATH/whitelist.txt .
754756

@@ -766,7 +768,9 @@ function run_distribute() {
766768
debug "Fill private directory"
767769
try cp -a python-install/lib private/
768770
try mkdir -p private/include/python2.7
769-
try mv libs/$ARCH/libpymodules.so private/
771+
if [ -f "libs/$ARCH/libpymodules.so" ]; then
772+
try mv libs/$ARCH/libpymodules.so private/
773+
fi
770774
try cp python-install/include/python2.7/pyconfig.h private/include/python2.7/
771775

772776
debug "Reduce private directory from unwanted files"

0 commit comments

Comments
 (0)