[DEV] update android build
This commit is contained in:
parent
7d48e91b9b
commit
f0fe760836
12
README.rst
12
README.rst
@ -34,11 +34,19 @@ Installation
|
|||||||
|
|
||||||
Requirements: ``Python >= 2.7`` and ``pip``
|
Requirements: ``Python >= 2.7`` and ``pip``
|
||||||
|
|
||||||
Just run::
|
Just run:
|
||||||
|
|
||||||
pip install lutin
|
pip install lutin
|
||||||
|
|
||||||
On mac-os you may install pip before:
|
Install pip on debian/ubuntu:
|
||||||
|
|
||||||
|
sudo apt-get install pip
|
||||||
|
|
||||||
|
Install pip on ARCH-linux:
|
||||||
|
|
||||||
|
sudo pacman -S pip
|
||||||
|
|
||||||
|
Install pip on MacOs:
|
||||||
|
|
||||||
sudo easy_install pip
|
sudo easy_install pip
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ myArgs.add(arguments.ArgDefine("h", "help", desc="display this help"))
|
|||||||
myArgs.add_section("option", "Can be set one time in all case")
|
myArgs.add_section("option", "Can be set one time in all case")
|
||||||
myArgs.add(arguments.ArgDefine("v", "verbose", list=[["0","None"],["1","error"],["2","warning"],["3","info"],["4","debug"],["5","verbose"],["6","extreme_verbose"]], desc="display makefile debug level (verbose) default =2"))
|
myArgs.add(arguments.ArgDefine("v", "verbose", list=[["0","None"],["1","error"],["2","warning"],["3","info"],["4","debug"],["5","verbose"],["6","extreme_verbose"]], desc="display makefile debug level (verbose) default =2"))
|
||||||
myArgs.add(arguments.ArgDefine("C", "color", desc="display makefile output in color"))
|
myArgs.add(arguments.ArgDefine("C", "color", desc="display makefile output in color"))
|
||||||
myArgs.add(arguments.ArgDefine("f", "force", desc="Force the rebuild without checking the dependency"))
|
myArgs.add(arguments.ArgDefine("B", "force-build", desc="Force the rebuild without checking the dependency"))
|
||||||
myArgs.add(arguments.ArgDefine("P", "pretty", desc="print the debug has pretty display"))
|
myArgs.add(arguments.ArgDefine("P", "pretty", desc="print the debug has pretty display"))
|
||||||
myArgs.add(arguments.ArgDefine("j", "jobs", haveParam=True, desc="Specifies the number of jobs (commands) to run simultaneously"))
|
myArgs.add(arguments.ArgDefine("j", "jobs", haveParam=True, desc="Specifies the number of jobs (commands) to run simultaneously"))
|
||||||
myArgs.add(arguments.ArgDefine("s", "force-strip", desc="Force the stripping of the compile elements"))
|
myArgs.add(arguments.ArgDefine("s", "force-strip", desc="Force the stripping of the compile elements"))
|
||||||
@ -52,7 +52,7 @@ def usage():
|
|||||||
color = debug.get_color_set()
|
color = debug.get_color_set()
|
||||||
# generic argument displayed :
|
# generic argument displayed :
|
||||||
myArgs.display()
|
myArgs.display()
|
||||||
print(" All target can finish with '?clean' '?dump' '?gcov' ... ?action")
|
print(" All target can finish with '?clean' '?dump' '?gcov' ... ?action (@ can replace ?)" )
|
||||||
print(" " + color['green'] + "all" + color['default'])
|
print(" " + color['green'] + "all" + color['default'])
|
||||||
print(" build all (only for the current selected board) (bynary and packages)")
|
print(" build all (only for the current selected board) (bynary and packages)")
|
||||||
print(" " + color['green'] + "clean" + color['default'])
|
print(" " + color['green'] + "clean" + color['default'])
|
||||||
|
59
doc/010_basic_concept.bb
Normal file
59
doc/010_basic_concept.bb
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
=?= [center]Basic concept[/center] =?=
|
||||||
|
___________________________________________
|
||||||
|
|
||||||
|
Lutin is a compleate builder system. It is designed to answers all the application problems.
|
||||||
|
The library and the distribution problem are partially manage (no real use-case)
|
||||||
|
|
||||||
|
==Technologie==
|
||||||
|
|
||||||
|
Lutin is designed in Python 2.X or 3.X to answers at the multiplatform problesm. On Linux or MacOs, it is really easy to compile with Makefile, cmake, but on Windows it is an other problem.
|
||||||
|
The first version of Lutin has been designed in Makefile, but we need to wait 20 minutes before the first build. In Pytho it is fast as Linux.
|
||||||
|
|
||||||
|
Lutin is not based over an other builder, but request compilation itself.
|
||||||
|
|
||||||
|
==Features==
|
||||||
|
|
||||||
|
Lutin is designed to:
|
||||||
|
:** support many hardware platform (X86/X64/ARM...);
|
||||||
|
:** support many operation system (windows, Ios, Android ...);
|
||||||
|
:** support complex worktree and depedency;
|
||||||
|
:** build only when needed;
|
||||||
|
:** create platform specific packages (application bundle);
|
||||||
|
:**
|
||||||
|
|
||||||
|
|
||||||
|
==global overview==
|
||||||
|
|
||||||
|
Every build system is based on multiple concept depending of their own designed.
|
||||||
|
|
||||||
|
For lutin we can différentiate 4 basics concepts:
|
||||||
|
:** Mudule: Interface to create a part of an application, that contain binary, scipt, datas ...
|
||||||
|
:** Target: methode to creata an application or a library (may be internal: medium level)
|
||||||
|
:** Builder: Methode to transform element in other, for example: compile a cpp in object file, or object files in binary.
|
||||||
|
:** System: Many OS manage basic element contain in the OS, This part permit to find generic module availlable in the system.
|
||||||
|
|
||||||
|
===Module===
|
||||||
|
|
||||||
|
When you use lutin, you migth first create a module, This is the basis of the framework. It permit to describe your "module", all it contain, and the deendency.
|
||||||
|
|
||||||
|
We can separate a module in some part:
|
||||||
|
:** Binary:
|
||||||
|
:: A binary is an end point element.
|
||||||
|
:: It can be transform in a complete standalone bundle, or in an part instalable.
|
||||||
|
:** Library:
|
||||||
|
:: This represent an element that is used by other application
|
||||||
|
:** Package:
|
||||||
|
:: To Be Define.
|
||||||
|
|
||||||
|
|
||||||
|
===Target===
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
===Builder===
|
||||||
|
|
||||||
|
|
||||||
|
===System===
|
||||||
|
|
||||||
|
|
||||||
|
|
153
doc/020_Compile_a_module.bb
Normal file
153
doc/020_Compile_a_module.bb
Normal file
@ -0,0 +1,153 @@
|
|||||||
|
=?= [center]Basic concept[/center] =?=
|
||||||
|
___________________________________________
|
||||||
|
|
||||||
|
Lutin permit simply to compile applications and library.
|
||||||
|
|
||||||
|
To simply understand the use, we will use a simple library:
|
||||||
|
|
||||||
|
[code style=bash]
|
||||||
|
git clone http://github.con/atria-soft/etk.git
|
||||||
|
[/code]
|
||||||
|
|
||||||
|
etk is a basic library that have drive the lutin project.
|
||||||
|
|
||||||
|
|
||||||
|
== compile a module ==
|
||||||
|
|
||||||
|
It is really simple:
|
||||||
|
|
||||||
|
[code style=bash]
|
||||||
|
lutin yourModuleName
|
||||||
|
#example:
|
||||||
|
lutin etk
|
||||||
|
[/code]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
== Option working ==
|
||||||
|
|
||||||
|
Lutin have a complex option methodologie. We can consider 3 part of the option:
|
||||||
|
:** Global option
|
||||||
|
:** target option
|
||||||
|
:** modules
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
== Generic options ==
|
||||||
|
|
||||||
|
=== Display help ===
|
||||||
|
|
||||||
|
Availlable everywhere ...
|
||||||
|
|
||||||
|
[code style=bash]
|
||||||
|
lutin -h
|
||||||
|
lutin --help
|
||||||
|
[/code]
|
||||||
|
|
||||||
|
You can see in this help that it take a litle time to react.
|
||||||
|
The first time you run lutin, it parse all the file in your sub-directory.
|
||||||
|
But the system keep the data in cash, then the next time it is faster.
|
||||||
|
|
||||||
|
At the end of the help you an see an help about the etk librery with the associated help.
|
||||||
|
|
||||||
|
=== Build in color ===
|
||||||
|
|
||||||
|
[code style=bash]
|
||||||
|
lutin -C
|
||||||
|
lutin --color
|
||||||
|
[/code]
|
||||||
|
|
||||||
|
=== Display build line in pretty print mode ===
|
||||||
|
|
||||||
|
when an error apear, the gcc or clang compile line can be really unreadable:
|
||||||
|
[code]
|
||||||
|
g++ -o /home/heero/dev/plop/out/Linux_x86_64/release/build/gcc/etk/obj/etk/Color.cpp.o -I/home/heero/dev/plop/etk -std=c++11 -D__CPP_VERSION__=2011 -D__TARGET_OS__Linux -D__TARGET_ARCH__x86 -D__TARGET_ADDR__64BITS -D_REENTRANT -DNDEBUG -O3 -fpic -D__STDCPP_GNU__ -Wall -Wsign-compare -Wreturn-type -Wno-write-strings -Woverloaded-virtual -Wnon-virtual-dtor -Wno-unused-variable -DMODE_RELEASE -c -MMD -MP /home/heero/dev/plop/etk/etk/Color.cpp
|
||||||
|
[/code]
|
||||||
|
|
||||||
|
whith this option you can transform this not obvious line in a readable line:
|
||||||
|
|
||||||
|
[code style=bash]
|
||||||
|
lutin -P
|
||||||
|
lutin --pretty
|
||||||
|
[/code]
|
||||||
|
|
||||||
|
result:
|
||||||
|
[code]
|
||||||
|
g++ \
|
||||||
|
-o /home/XXX/dev/out/Linux_x86_64/release/build/gcc/etk/obj/etk/Color.cpp.o \
|
||||||
|
-I/home/XXX/dev/etk \
|
||||||
|
-std=c++11 \
|
||||||
|
-D__CPP_VERSION__=2011 \
|
||||||
|
-D__TARGET_OS__Linux \
|
||||||
|
-D__TARGET_ARCH__x86 \
|
||||||
|
-D__TARGET_ADDR__64BITS \
|
||||||
|
-D_REENTRANT \
|
||||||
|
-DNDEBUG \
|
||||||
|
-O3 \
|
||||||
|
-fpic \
|
||||||
|
-D__STDCPP_GNU__ \
|
||||||
|
-Wall \
|
||||||
|
-Wsign-compare \
|
||||||
|
-Wreturn-type \
|
||||||
|
-Wno-write-strings \
|
||||||
|
-Woverloaded-virtual \
|
||||||
|
-Wnon-virtual-dtor \
|
||||||
|
-Wno-unused-variable \
|
||||||
|
-DMODE_RELEASE \
|
||||||
|
-c \
|
||||||
|
-MMD \
|
||||||
|
-MP \
|
||||||
|
/home/XXX/dev/etk/etk/Color.cpp
|
||||||
|
[/code]
|
||||||
|
|
||||||
|
=== lutin log ===
|
||||||
|
|
||||||
|
Lutin have an internal log system. To enable or disable it just select your debug level with the option:
|
||||||
|
|
||||||
|
[code style=bash]
|
||||||
|
lutin -v4
|
||||||
|
lutin --verbose 4
|
||||||
|
[/code]
|
||||||
|
|
||||||
|
The level availlables are:
|
||||||
|
:** 0: None
|
||||||
|
:** 1: error
|
||||||
|
:** 2: warning (default)
|
||||||
|
:** 3: info
|
||||||
|
:** 4: debug
|
||||||
|
:** 5: verbose
|
||||||
|
:** 6: extreme_verbose
|
||||||
|
|
||||||
|
=== select the number of CPU core used ===
|
||||||
|
|
||||||
|
By default lutin manage only 1 CPU core (faster to debug) but for speed requirement you can use use multiple core:
|
||||||
|
|
||||||
|
[code style=bash]
|
||||||
|
#for 5 core
|
||||||
|
lutin -j5
|
||||||
|
lutin --jobs 5
|
||||||
|
[/code]
|
||||||
|
|
||||||
|
=== Force rebuild all ===
|
||||||
|
|
||||||
|
Sometime it is needed to rebuild all the program, just do :
|
||||||
|
|
||||||
|
[code style=bash]
|
||||||
|
lutin -B
|
||||||
|
lutin --force-build
|
||||||
|
[/code]
|
||||||
|
|
||||||
|
=== Force rebuild all ===
|
||||||
|
|
||||||
|
Force strip of output binary (remove symboles)
|
||||||
|
|
||||||
|
[code style=bash]
|
||||||
|
lutin -s
|
||||||
|
lutin --force-strip
|
||||||
|
[/code]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-w / --warning
|
||||||
|
Store warning in a file build file
|
0
doc/030_Create_a_new_module.bb
Normal file
0
doc/030_Create_a_new_module.bb
Normal file
100
doc/index.bb
Normal file
100
doc/index.bb
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
=?= [center]Lutin Build system[/center] =?=
|
||||||
|
___________________________________________
|
||||||
|
|
||||||
|
===What is Lutin, and how can I use it?===
|
||||||
|
|
||||||
|
Lutin is an application/library builder, it is designed to concurence CMake, Makefile, Ant, graddle ...
|
||||||
|
|
||||||
|
Lutin is deveopped in Python 2.x and 3.x to permit many user to play with it.
|
||||||
|
|
||||||
|
Python permit to Lutin to be used in many environement in a fast way.
|
||||||
|
|
||||||
|
Lutin support can compile every thing you want, just add a builder that you need (not in the common way). Basicly Lutin support languages:
|
||||||
|
:** C (ainsi/89/99) ==> .o;
|
||||||
|
:** C++ (98/99/03/11/14/...) ==> .o;
|
||||||
|
:** .S (assembleur) ==> .o;
|
||||||
|
:** .java ==> .class;
|
||||||
|
:** .class ==> jar;
|
||||||
|
:** .o ==> .a;
|
||||||
|
:** .o ==> .so;
|
||||||
|
:** .o/.a ==> binary.
|
||||||
|
|
||||||
|
Some packege can be generate for some platform:
|
||||||
|
:** debian package;
|
||||||
|
:** windows application zip;
|
||||||
|
:** MacOs application .app;
|
||||||
|
:** iOs package;
|
||||||
|
:** Android Package .apk.
|
||||||
|
|
||||||
|
Compilation is availlable for:
|
||||||
|
:** gcc/g++;
|
||||||
|
:** clang/clang++.
|
||||||
|
|
||||||
|
Manage [b]workspace build[/b] (in oposition of CMake/make/...)
|
||||||
|
|
||||||
|
|
||||||
|
=== Install: ===
|
||||||
|
|
||||||
|
Requirements: ``Python >= 2.7`` and ``pip``
|
||||||
|
|
||||||
|
==== Install lutin: ===
|
||||||
|
Just run:
|
||||||
|
[code style=bash]
|
||||||
|
pip install lutin
|
||||||
|
[/code]
|
||||||
|
|
||||||
|
==== Install pip ====
|
||||||
|
Install pip on debian/ubuntu:
|
||||||
|
[code style=bash]
|
||||||
|
sudo apt-get install pip
|
||||||
|
[/code]
|
||||||
|
|
||||||
|
Install pip on ARCH-linux:
|
||||||
|
[code style=bash]
|
||||||
|
sudo pacman -S pip
|
||||||
|
[/code]
|
||||||
|
|
||||||
|
Install pip on MacOs:
|
||||||
|
[code style=bash]
|
||||||
|
sudo easy_install pip
|
||||||
|
[/code]
|
||||||
|
|
||||||
|
==== Install from sources ====
|
||||||
|
|
||||||
|
[code style=bash]
|
||||||
|
git clone http://github.com/HeeroYui/lutin.git
|
||||||
|
cd lutin
|
||||||
|
sudo ./setup.py install
|
||||||
|
[/code]
|
||||||
|
|
||||||
|
=== License (APACHE v2.0) ===
|
||||||
|
|
||||||
|
Copyright lutin Edouard DUPIN
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
|
||||||
|
=== History: ===
|
||||||
|
|
||||||
|
I work with some builder, Every one have theire own adventages, and their problems.
|
||||||
|
The main point I see, is that the polimorphisme of the worktree is really hard.
|
||||||
|
The second point is the generation on different platforms is hard too.
|
||||||
|
|
||||||
|
Some other problem example:
|
||||||
|
:** Makefile is too slow on windows mingw;
|
||||||
|
:** Cmake does not create end point package;
|
||||||
|
:** none is really simple to write.
|
||||||
|
|
||||||
|
Then I create a simple interface that manage all I need. and written in python to permit to be faster on every platform.
|
||||||
|
|
||||||
|
[tutorial[000_Build | Tutorials]]
|
@ -440,7 +440,8 @@ class Target:
|
|||||||
mod.clean(self)
|
mod.clean(self)
|
||||||
else:
|
else:
|
||||||
# get the action an the module ....
|
# get the action an the module ....
|
||||||
gettedElement = name.split("?")
|
name2 = name.replace("@", "?")
|
||||||
|
gettedElement = name2.split("?")
|
||||||
module_name = gettedElement[0]
|
module_name = gettedElement[0]
|
||||||
if len(gettedElement)>=3:
|
if len(gettedElement)>=3:
|
||||||
sub_action_name = gettedElement[2]
|
sub_action_name = gettedElement[2]
|
||||||
|
@ -302,7 +302,7 @@ class Target(target.Target):
|
|||||||
if self.config["mode"] == "debug":
|
if self.config["mode"] == "debug":
|
||||||
pkg_name_application_name += "debug"
|
pkg_name_application_name += "debug"
|
||||||
# FINAL_path_JAVA_PROJECT
|
# FINAL_path_JAVA_PROJECT
|
||||||
self.path_java_project = os.path.join(self.get_staging_path(pkg_name),
|
self.path_java_project = os.path.join(target_outpath,
|
||||||
"src",
|
"src",
|
||||||
pkg_properties["COMPAGNY_TYPE"],
|
pkg_properties["COMPAGNY_TYPE"],
|
||||||
pkg_properties["COMPAGNY_NAME2"],
|
pkg_properties["COMPAGNY_NAME2"],
|
||||||
@ -323,20 +323,20 @@ class Target(target.Target):
|
|||||||
# Create file :
|
# Create file :
|
||||||
# java ==> done by ewol wrapper ... (and compiled in the normal compilation system ==> must be find in the dependency list of jar ...
|
# java ==> done by ewol wrapper ... (and compiled in the normal compilation system ==> must be find in the dependency list of jar ...
|
||||||
|
|
||||||
tools.create_directory_of_file(self.get_staging_path(pkg_name) + "/res/drawable/icon.png");
|
tools.create_directory_of_file(target_outpath + "/res/drawable/icon.png");
|
||||||
if "ICON" in pkg_properties.keys() \
|
if "ICON" in pkg_properties.keys() \
|
||||||
and pkg_properties["ICON"] != "":
|
and pkg_properties["ICON"] != "":
|
||||||
image.resize(pkg_properties["ICON"], self.get_staging_path(pkg_name) + "/res/drawable/icon.png", 256, 256)
|
image.resize(pkg_properties["ICON"], target_outpath + "/res/drawable/icon.png", 256, 256)
|
||||||
else:
|
else:
|
||||||
# to be sure that we have all time a resource ...
|
# to be sure that we have all time a resource ...
|
||||||
tmpFile = open(self.get_staging_path(pkg_name) + "/res/drawable/plop.txt", 'w')
|
tmpFile = open(target_outpath + "/res/drawable/plop.txt", 'w')
|
||||||
tmpFile.write('plop\n')
|
tmpFile.write('plop\n')
|
||||||
tmpFile.flush()
|
tmpFile.flush()
|
||||||
tmpFile.close()
|
tmpFile.close()
|
||||||
|
|
||||||
if pkg_properties["ANDROID_MANIFEST"]!="":
|
if pkg_properties["ANDROID_MANIFEST"]!="":
|
||||||
debug.print_element("pkg", "AndroidManifest.xml", "<==", pkg_properties["ANDROID_MANIFEST"])
|
debug.print_element("pkg", "AndroidManifest.xml", "<==", pkg_properties["ANDROID_MANIFEST"])
|
||||||
tools.copy_file(pkg_properties["ANDROID_MANIFEST"], self.get_staging_path(pkg_name) + "/AndroidManifest.xml", force=True)
|
tools.copy_file(pkg_properties["ANDROID_MANIFEST"], target_outpath + "/AndroidManifest.xml", force=True)
|
||||||
else:
|
else:
|
||||||
debug.error("missing parameter 'ANDROID_MANIFEST' in the properties ... ")
|
debug.error("missing parameter 'ANDROID_MANIFEST' in the properties ... ")
|
||||||
|
|
||||||
@ -349,13 +349,13 @@ class Target(target.Target):
|
|||||||
for res_source, res_dest in pkg_properties["ANDROID_RESOURCES"]:
|
for res_source, res_dest in pkg_properties["ANDROID_RESOURCES"]:
|
||||||
if res_source == "":
|
if res_source == "":
|
||||||
continue
|
continue
|
||||||
tools.copy_file(res_source , self.get_staging_path(pkg_name) + "/res/" + res_dest + "/" + os.path.basename(res_source), force=True)
|
tools.copy_file(res_source , target_outpath + "/res/" + res_dest + "/" + os.path.basename(res_source), force=True)
|
||||||
|
|
||||||
|
|
||||||
# Doc :
|
# Doc :
|
||||||
# http://asantoso.wordpress.com/2009/09/15/how-to-build-android-application-package-apk-from-the-command-line-using-the-sdk-tools-continuously-integrated-using-cruisecontrol/
|
# http://asantoso.wordpress.com/2009/09/15/how-to-build-android-application-package-apk-from-the-command-line-using-the-sdk-tools-continuously-integrated-using-cruisecontrol/
|
||||||
debug.print_element("pkg", "R.java", "<==", "Resources files")
|
debug.print_element("pkg", "R.java", "<==", "Resources files")
|
||||||
tools.create_directory_of_file(self.get_staging_path(pkg_name) + "/src/noFile")
|
tools.create_directory_of_file(target_outpath + "/src/noFile")
|
||||||
androidToolPath = self.path_sdk + "/build-tools/"
|
androidToolPath = self.path_sdk + "/build-tools/"
|
||||||
# find android tool version
|
# find android tool version
|
||||||
dirnames = tools.get_list_sub_path(androidToolPath)
|
dirnames = tools.get_list_sub_path(androidToolPath)
|
||||||
@ -368,15 +368,15 @@ class Target(target.Target):
|
|||||||
if "ADMOD_ID" in pkg_properties:
|
if "ADMOD_ID" in pkg_properties:
|
||||||
adModResoucepath = " -S " + self.path_sdk + "/extras/google/google_play_services/libproject/google-play-services_lib/res/ "
|
adModResoucepath = " -S " + self.path_sdk + "/extras/google/google_play_services/libproject/google-play-services_lib/res/ "
|
||||||
cmdLine = androidToolPath + "aapt p -f " \
|
cmdLine = androidToolPath + "aapt p -f " \
|
||||||
+ "-M " + self.get_staging_path(pkg_name) + "/AndroidManifest.xml " \
|
+ "-M " + target_outpath + "/AndroidManifest.xml " \
|
||||||
+ "-F " + self.get_staging_path(pkg_name) + "/resources.res " \
|
+ "-F " + target_outpath + "/resources.res " \
|
||||||
+ "-I " + self.path_sdk + "/platforms/android-" + str(self.boardId) + "/android.jar "\
|
+ "-I " + self.path_sdk + "/platforms/android-" + str(self.boardId) + "/android.jar "\
|
||||||
+ "-S " + self.get_staging_path(pkg_name) + "/res/ " \
|
+ "-S " + target_outpath + "/res/ " \
|
||||||
+ adModResoucepath \
|
+ adModResoucepath \
|
||||||
+ "-J " + self.get_staging_path(pkg_name) + "/src/ "
|
+ "-J " + target_outpath + "/src/ "
|
||||||
multiprocess.run_command(cmdLine)
|
multiprocess.run_command(cmdLine)
|
||||||
|
|
||||||
tools.create_directory_of_file(self.get_staging_path(pkg_name) + "/build/classes/noFile")
|
tools.create_directory_of_file(target_outpath + "/build/classes/noFile")
|
||||||
debug.print_element("pkg", "*.class", "<==", "*.java")
|
debug.print_element("pkg", "*.class", "<==", "*.java")
|
||||||
#generate android java files:
|
#generate android java files:
|
||||||
filesString=""
|
filesString=""
|
||||||
@ -414,16 +414,16 @@ class Target(target.Target):
|
|||||||
class_extern += elem
|
class_extern += elem
|
||||||
# create enpoint element :
|
# create enpoint element :
|
||||||
cmdLine = "javac " \
|
cmdLine = "javac " \
|
||||||
+ "-d " + self.get_staging_path(pkg_name) + "/build/classes " \
|
+ "-d " + target_outpath + "/build/classes " \
|
||||||
+ "-classpath " + class_extern + " " \
|
+ "-classpath " + class_extern + " " \
|
||||||
+ self.get_staging_path(pkg_name) + "/src/R.java "
|
+ target_outpath + "/src/R.java "
|
||||||
multiprocess.run_command(cmdLine)
|
multiprocess.run_command(cmdLine)
|
||||||
|
|
||||||
debug.print_element("pkg", ".dex", "<==", "*.class")
|
debug.print_element("pkg", ".dex", "<==", "*.class")
|
||||||
cmdLine = androidToolPath + "dx " \
|
cmdLine = androidToolPath + "dx " \
|
||||||
+ "--dex --no-strict " \
|
+ "--dex --no-strict " \
|
||||||
+ "--output=" + self.get_staging_path(pkg_name) + "/build/" + pkg_name_application_name + ".dex " \
|
+ "--output=" + target_outpath + "/build/" + pkg_name_application_name + ".dex " \
|
||||||
+ self.get_staging_path(pkg_name) + "/build/classes/ "
|
+ target_outpath + "/build/classes/ "
|
||||||
|
|
||||||
if "ADMOD_ID" in pkg_properties:
|
if "ADMOD_ID" in pkg_properties:
|
||||||
cmdLine += self.path_sdk + "/extras/google/google_play_services/libproject/google-play-services_lib/libs/google-play-services.jar "
|
cmdLine += self.path_sdk + "/extras/google/google_play_services/libproject/google-play-services_lib/libs/google-play-services.jar "
|
||||||
@ -444,11 +444,11 @@ class Target(target.Target):
|
|||||||
+ " -classpath " + self.path_sdk + "/tools/lib/sdklib.jar " \
|
+ " -classpath " + self.path_sdk + "/tools/lib/sdklib.jar " \
|
||||||
+ builderDebug \
|
+ builderDebug \
|
||||||
+ " com.android.sdklib.build.ApkBuilderMain " \
|
+ " com.android.sdklib.build.ApkBuilderMain " \
|
||||||
+ self.get_staging_path(pkg_name) + "/build/" + pkg_name_application_name + "-unalligned.apk " \
|
+ target_outpath + "/build/" + pkg_name_application_name + "-unalligned.apk " \
|
||||||
+ " -u " \
|
+ " -u " \
|
||||||
+ " -z " + self.get_staging_path(pkg_name) + "/resources.res " \
|
+ " -z " + target_outpath + "/resources.res " \
|
||||||
+ " -f " + self.get_staging_path(pkg_name) + "/build/" + pkg_name_application_name + ".dex " \
|
+ " -f " + target_outpath + "/build/" + pkg_name_application_name + ".dex " \
|
||||||
+ " -rf " + self.get_staging_path(pkg_name) + "/data "
|
+ " -rf " + target_outpath + "/data "
|
||||||
multiprocess.run_command(cmdLine)
|
multiprocess.run_command(cmdLine)
|
||||||
|
|
||||||
# doc :
|
# doc :
|
||||||
@ -466,7 +466,7 @@ class Target(target.Target):
|
|||||||
+ " -sigalg SHA1withRSA -digestalg SHA1 " \
|
+ " -sigalg SHA1withRSA -digestalg SHA1 " \
|
||||||
+ " -storepass Pass__AndroidDebugKey " \
|
+ " -storepass Pass__AndroidDebugKey " \
|
||||||
+ " -keypass PassKey__AndroidDebugKey " \
|
+ " -keypass PassKey__AndroidDebugKey " \
|
||||||
+ self.get_staging_path(pkg_name) + "/build/" + pkg_name_application_name + "-unalligned.apk " \
|
+ target_outpath + "/build/" + pkg_name_application_name + "-unalligned.apk " \
|
||||||
+ " alias__AndroidDebugKey"
|
+ " alias__AndroidDebugKey"
|
||||||
multiprocess.run_command(cmdLine)
|
multiprocess.run_command(cmdLine)
|
||||||
tmpFile = open("tmpPass.boo", 'w')
|
tmpFile = open("tmpPass.boo", 'w')
|
||||||
@ -479,25 +479,25 @@ class Target(target.Target):
|
|||||||
cmdLine = "jarsigner " \
|
cmdLine = "jarsigner " \
|
||||||
+ " -keystore " + base_pkg_path + "/AndroidKey.jks " \
|
+ " -keystore " + base_pkg_path + "/AndroidKey.jks " \
|
||||||
+ " -sigalg SHA1withRSA -digestalg SHA1 " \
|
+ " -sigalg SHA1withRSA -digestalg SHA1 " \
|
||||||
+ self.get_staging_path(pkg_name) + "/build/" + pkg_name_application_name + "-unalligned.apk " \
|
+ target_outpath + "/build/" + pkg_name_application_name + "-unalligned.apk " \
|
||||||
+ " " + pkg_name_application_name
|
+ " " + pkg_name_application_name
|
||||||
multiprocess.run_command(cmdLine)
|
multiprocess.run_command(cmdLine)
|
||||||
cmdLine = "jarsigner " \
|
cmdLine = "jarsigner " \
|
||||||
+ " -verify -verbose -certs " \
|
+ " -verify -verbose -certs " \
|
||||||
+ " -sigalg SHA1withRSA -digestalg SHA1 " \
|
+ " -sigalg SHA1withRSA -digestalg SHA1 " \
|
||||||
+ self.get_staging_path(pkg_name) + "/build/" + pkg_name_application_name + "-unalligned.apk "
|
+ target_outpath + "/build/" + pkg_name_application_name + "-unalligned.apk "
|
||||||
multiprocess.run_command(cmdLine)
|
multiprocess.run_command(cmdLine)
|
||||||
|
|
||||||
debug.print_element("pkg", ".apk(aligned)", "<==", ".apk (not aligned)")
|
debug.print_element("pkg", ".apk(aligned)", "<==", ".apk (not aligned)")
|
||||||
tools.remove_file(self.get_staging_path(pkg_name) + "/" + pkg_name_application_name + ".apk")
|
tools.remove_file(target_outpath + "/" + pkg_name_application_name + ".apk")
|
||||||
# verbose mode : -v
|
# verbose mode : -v
|
||||||
cmdLine = androidToolPath + "zipalign 4 " \
|
cmdLine = androidToolPath + "zipalign 4 " \
|
||||||
+ self.get_staging_path(pkg_name) + "/build/" + pkg_name_application_name + "-unalligned.apk " \
|
+ target_outpath + "/build/" + pkg_name_application_name + "-unalligned.apk " \
|
||||||
+ self.get_staging_path(pkg_name) + "/" + pkg_name_application_name + ".apk "
|
+ target_outpath + "/" + pkg_name_application_name + ".apk "
|
||||||
multiprocess.run_command(cmdLine)
|
multiprocess.run_command(cmdLine)
|
||||||
|
|
||||||
# copy file in the final stage :
|
# copy file in the final stage :
|
||||||
tools.copy_file(self.get_staging_path(pkg_name) + "/" + pkg_name_application_name + ".apk",
|
tools.copy_file(target_outpath + "/" + pkg_name_application_name + ".apk",
|
||||||
self.get_final_path() + "/" + pkg_name_application_name + ".apk",
|
self.get_final_path() + "/" + pkg_name_application_name + ".apk",
|
||||||
force=True)
|
force=True)
|
||||||
|
|
||||||
|
@ -148,14 +148,20 @@ class Target(target.Target):
|
|||||||
tools.clean_directory(target_shared_path, copy_list)
|
tools.clean_directory(target_shared_path, copy_list)
|
||||||
|
|
||||||
## copy binary files:
|
## copy binary files:
|
||||||
|
copy_list={}
|
||||||
target_outpath_bin = os.path.join(target_outpath, self.pkg_path_bin)
|
target_outpath_bin = os.path.join(target_outpath, self.pkg_path_bin)
|
||||||
tools.create_directory_of_file(target_outpath_bin)
|
tools.create_directory_of_file(target_outpath_bin)
|
||||||
path_src = self.get_build_file_bin(pkg_name)
|
path_src = self.get_build_file_bin(pkg_name)
|
||||||
path_dst = os.path.join(target_outpath_bin, pkg_name + self.suffix_binary)
|
path_dst = os.path.join(target_outpath_bin, pkg_name + self.suffix_binary)
|
||||||
debug.verbose("path_dst: " + str(path_dst))
|
debug.verbose("path_dst: " + str(path_dst))
|
||||||
tools.copy_file(path_src, path_dst)
|
tools.copy_file(path_src,
|
||||||
|
path_dst,
|
||||||
|
in_list=copy_list)
|
||||||
|
#real copy files
|
||||||
|
tools.copy_list(copy_list)
|
||||||
|
|
||||||
## Create libraries:
|
## Create libraries:
|
||||||
|
copy_list={}
|
||||||
if static == False:
|
if static == False:
|
||||||
#copy all shred libs...
|
#copy all shred libs...
|
||||||
target_outpath_lib = os.path.join(target_outpath, self.pkg_path_lib)
|
target_outpath_lib = os.path.join(target_outpath, self.pkg_path_lib)
|
||||||
@ -169,7 +175,11 @@ class Target(target.Target):
|
|||||||
debug.debug(" need copy: " + file_src + " to " + target_outpath_lib)
|
debug.debug(" need copy: " + file_src + " to " + target_outpath_lib)
|
||||||
#copy all data:
|
#copy all data:
|
||||||
# TODO : We can have a problem when writing over library files ...
|
# TODO : We can have a problem when writing over library files ...
|
||||||
tools.copy_file(file_src, os.path.join(target_outpath_lib, os.path.basename(file_src)) )
|
tools.copy_file(file_src,
|
||||||
|
os.path.join(target_outpath_lib, os.path.basename(file_src)),
|
||||||
|
in_list=copy_list)
|
||||||
|
#real copy files
|
||||||
|
tools.copy_list(copy_list)
|
||||||
|
|
||||||
## Create version file:
|
## Create version file:
|
||||||
tmpFile = open(target_outpath + "/version.txt", 'w')
|
tmpFile = open(target_outpath + "/version.txt", 'w')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user