[DEV] register on pip ...

This commit is contained in:
Edouard DUPIN 2015-05-08 15:23:56 +02:00
parent 801e2e8209
commit ee6c01f278
43 changed files with 376 additions and 337 deletions

8
.gitignore vendored
View File

@ -1 +1,9 @@
# Compiled python modules.
*.pyc *.pyc
# Setuptools distribution folder.
/dist/
/build/
# Python egg metadata, regenerated from source files by setuptools.
/*.egg-info

1
MANIFEST.in Normal file
View File

@ -0,0 +1 @@
include README.rst

View File

@ -1,29 +1,43 @@
build Lutin
===== =====
`lutin` is a generic package maker is a FREE software tool. `lutin` is a generic builder and package maker is a FREE software tool.
Instructions Instructions
============ ------------
This is a tool to generate the binary, shared library, static library and package independently of the OS This is a tool to generate the binary, shared library, static library and package independently of the OS
This software builds C, C++, m, m++, to object file and generate associated libraries (.so & .a) end create final Executable file
This tool can generate package for Linux, MacOs, Android This tool can generate package for Linux, MacOs, Android
Create a lutin module Lutin is under a FREE license that can be found in the COPYING file.
===================== Any contribution is more than welcome ;)
Set the lutin module maker with the name : git repository
lutin_xxxxx.py --------------
xxx : represent the name of the module/binary/package and must be lower case and no special characters
http://github.com/HeeroYui/lutin/
Documentation
-------------
http://github.io/HeeroYui/lutin/
Installation
------------
Requirements: ``Python >= 2.7`` and ``pip``
Just run::
pip install lutin
you can see exemple for some type in :
ewol : library
edn : package
glew : prebuild
License (APACHE v2.0) License (APACHE v2.0)
===================== ---------------------
Copyright lutin Edouard DUPIN Copyright lutin Edouard DUPIN

View File

@ -1,9 +1,14 @@
#!/usr/bin/python #!/usr/bin/python
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license APACHE v2.0 (see license file)
##
import os import os
import sys import sys
# Local import
# now import other standard module (must be done here and not before ...
from . import target from . import target
from . import builder from . import builder
from . import system from . import system
@ -15,11 +20,12 @@ from . import module
is_init = False is_init = False
if is_init == False: if is_init == False:
"""
When the user use with make.py we initialise ourself
"""
debug.verbose("Use Make as a make stadard") debug.verbose("Use Make as a make stadard")
sys.path.append(tools.get_run_folder()) sys.path.append(tools.get_run_folder())
builder.import_path(tools.get_current_path(__file__))
module.import_path(tools.get_current_path(__file__))
system.import_path(tools.get_current_path(__file__))
target.import_path(tools.get_current_path(__file__))
debug.debug("missing file lutinBase.py ==> loading subPath..."); debug.debug("missing file lutinBase.py ==> loading subPath...");
# Import all sub path without out and archive # Import all sub path without out and archive

View File

@ -6,8 +6,8 @@
## ##
## @license APACHE v2.0 (see license file) ## @license APACHE v2.0 (see license file)
## ##
import sys import sys
# Local import
from . import debug from . import debug
class ArgElement: class ArgElement:

View File

@ -6,19 +6,14 @@
## ##
## @license APACHE v2.0 (see license file) ## @license APACHE v2.0 (see license file)
## ##
import sys import sys
import os import os
import inspect import inspect
import fnmatch import fnmatch
import datetime
# Local import
from . import debug from . import debug
from . import heritage from . import heritage
import datetime
from . import tools as lutinTools
from . import module as lutinModule
from . import system as lutinSystem
from . import image as lutinImage
from . import host as lutinHost
## ##
## constitution of dictionnary: ## constitution of dictionnary:

View File

@ -1,11 +1,11 @@
## ##
## Executable/binary builder ## Executable/binary builder
## ##
import lutinMultiprocess from lutin import multiprocess
import lutinTools from lutin import tools
import lutinDebug as debug from lutin import debug
import lutinDepend as dependency from lutin import depend
import lutinEnv from lutin import env
import os import os
## ##
@ -82,27 +82,27 @@ def link(file, binary, target, depancy, name, basic_folder):
cmd.append(target.global_flags_ld) cmd.append(target.global_flags_ld)
except: except:
pass pass
cmdLine=lutinTools.list_to_str(cmd) cmdLine=tools.list_to_str(cmd)
# check the dependency for this file : # check the dependency for this file :
if dependency.need_re_package(file_dst, file_src, True, file_cmd, cmdLine) == False \ if depend.need_re_package(file_dst, file_src, True, file_cmd, cmdLine) == False \
and dependency.need_re_package(file_dst, depancy.src, False, file_cmd, cmdLine) == False: and depend.need_re_package(file_dst, depancy.src, False, file_cmd, cmdLine) == False:
return file_dst return file_dst
lutinTools.create_directory_of_file(file_dst) tools.create_directory_of_file(file_dst)
debug.print_element("Executable", name, "==>", file_dst) debug.print_element("Executable", name, "==>", file_dst)
lutinMultiprocess.run_command(cmdLine) multiprocess.run_command(cmdLine)
if target.config["mode"] == "release"\ if target.config["mode"] == "release"\
or lutinEnv.get_force_strip_mode() == True: or env.get_force_strip_mode() == True:
# get the file size of the non strip file # get the file size of the non strip file
originSize = lutinTools.file_size(file_dst); originSize = tools.file_size(file_dst);
debug.print_element("Executable(strip)", name, "", "") debug.print_element("Executable(strip)", name, "", "")
cmdLineStrip=lutinTools.list_to_str([ cmdLineStrip=tools.list_to_str([
target.strip, target.strip,
file_dst]) file_dst])
lutinMultiprocess.run_command(cmdLineStrip) multiprocess.run_command(cmdLineStrip)
# get the stip size of the binary # get the stip size of the binary
stripSize = lutinTools.file_size(file_dst) stripSize = tools.file_size(file_dst)
debug.debug("file reduce size : " + str(originSize/1024) + "ko ==> " + str(stripSize/1024) + "ko") debug.debug("file reduce size : " + str(originSize/1024) + "ko ==> " + str(stripSize/1024) + "ko")
# write cmd line only after to prevent errors ... # write cmd line only after to prevent errors ...
lutinMultiprocess.store_command(cmdLine, file_cmd) multiprocess.store_command(cmdLine, file_cmd)

View File

@ -1,10 +1,10 @@
## ##
## C builder ## C builder
## ##
import lutinMultiprocess from lutin import multiprocess
import lutinTools from lutin import tools
import lutinDebug as debug from lutin import debug
import lutinDepend as dependency from lutin import depend
# C version: # C version:
default_version = 1989 default_version = 1989
@ -51,15 +51,15 @@ def compile(file, binary, target, depancy, flags, path, name, basic_folder):
target.sysroot, target.sysroot,
target.global_include_cc] target.global_include_cc]
try: try:
cmd.append(lutinTools.add_prefix("-I", path["export"])) cmd.append(tools.add_prefix("-I", path["export"]))
except: except:
pass pass
try: try:
cmd.append(lutinTools.add_prefix("-I", path["local"])) cmd.append(tools.add_prefix("-I", path["local"]))
except: except:
pass pass
try: try:
cmd.append(lutinTools.add_prefix("-I", depancy.path)) cmd.append(tools.add_prefix("-I", depancy.path))
except: except:
pass pass
try: try:
@ -87,14 +87,14 @@ def compile(file, binary, target, depancy, flags, path, name, basic_folder):
cmd.append("-MP") cmd.append("-MP")
cmd.append(file_src) cmd.append(file_src)
# Create cmd line # Create cmd line
cmdLine=lutinTools.list_to_str(cmd) cmdLine=tools.list_to_str(cmd)
# check the dependency for this file : # check the dependency for this file :
if dependency.need_re_build(file_dst, file_src, file_depend, file_cmd, cmdLine) == False: if depend.need_re_build(file_dst, file_src, file_depend, file_cmd, cmdLine) == False:
return file_dst return file_dst
lutinTools.create_directory_of_file(file_dst) tools.create_directory_of_file(file_dst)
comment = ["c", name, "<==", file] comment = ["c", name, "<==", file]
# process element # process element
lutinMultiprocess.run_in_pool(cmdLine, comment, file_cmd) multiprocess.run_in_pool(cmdLine, comment, file_cmd)
return file_dst return file_dst

View File

@ -1,10 +1,10 @@
## ##
## C++ builder ## C++ builder
## ##
import lutinMultiprocess from lutin import multiprocess
import lutinTools from lutin import tools
import lutinDebug as debug from lutin import debug
import lutinDepend as dependency from lutin import depend
# C++ default version: # C++ default version:
default_version = 1999 default_version = 1999
default_version_gnu = False default_version_gnu = False
@ -51,15 +51,15 @@ def compile(file, binary, target, depancy, flags, path, name, basic_folder):
target.global_include_cc target.global_include_cc
] ]
try: try:
cmd.append(lutinTools.add_prefix("-I",path["export"])) cmd.append(tools.add_prefix("-I",path["export"]))
except: except:
pass pass
try: try:
cmd.append(lutinTools.add_prefix("-I",path["local"])) cmd.append(tools.add_prefix("-I",path["local"]))
except: except:
pass pass
try: try:
cmd.append(lutinTools.add_prefix("-I",depancy.path)) cmd.append(tools.add_prefix("-I",depancy.path))
except: except:
pass pass
try: try:
@ -101,15 +101,15 @@ def compile(file, binary, target, depancy, flags, path, name, basic_folder):
cmd.append(["-c", "-MMD", "-MP"]) cmd.append(["-c", "-MMD", "-MP"])
cmd.append(file_src) cmd.append(file_src)
# Create cmd line # Create cmd line
cmdLine=lutinTools.list_to_str(cmd) cmdLine=tools.list_to_str(cmd)
# check the dependency for this file : # check the dependency for this file :
if dependency.need_re_build(file_dst, file_src, file_depend, file_cmd, cmdLine) == False: if depend.need_re_build(file_dst, file_src, file_depend, file_cmd, cmdLine) == False:
return file_dst return file_dst
lutinTools.create_directory_of_file(file_dst) tools.create_directory_of_file(file_dst)
comment = ["c++", name, "<==", file] comment = ["c++", name, "<==", file]
#process element #process element
lutinMultiprocess.run_in_pool(cmdLine, comment, file_cmd) multiprocess.run_in_pool(cmdLine, comment, file_cmd)
return file_dst return file_dst
def get_version_compilation_flags(flags, dependency_flags): def get_version_compilation_flags(flags, dependency_flags):

View File

@ -1,10 +1,10 @@
## ##
## Java builder ## Java builder
## ##
import lutinMultiprocess from lutin import multiprocess
import lutinTools from lutin import tools
import lutinDebug as debug from lutin import debug
import lutinDepend as dependency from lutin import depend
## ##
## Initialize the builder, if needed ... to get dependency between builder (for example) ## Initialize the builder, if needed ... to get dependency between builder (for example)

View File

@ -1,10 +1,11 @@
## ##
## Dynamic library builder ## Dynamic library builder
## ##
import lutinMultiprocess from lutin import multiprocess
import lutinTools from lutin import tools
import lutinDebug as debug from lutin import debug
import lutinDepend as dependency from lutin import depend
from lutin import env
import os import os
## ##
@ -73,27 +74,27 @@ def link(file, binary, target, depancy, name, basic_folder):
cmd.append(target.global_flags_ld) cmd.append(target.global_flags_ld)
except: except:
pass pass
cmdLine=lutinTools.list_to_str(cmd) cmdLine=tools.list_to_str(cmd)
# check the dependency for this file : # check the dependency for this file :
if dependency.need_re_package(file_dst, file_src, True, file_cmd, cmdLine) == False \ if depend.need_re_package(file_dst, file_src, True, file_cmd, cmdLine) == False \
and dependency.need_re_package(file_dst, depancy.src, False, file_cmd, cmdLine) == False: and depend.need_re_package(file_dst, depancy.src, False, file_cmd, cmdLine) == False:
return tmpList[1] return tmpList[1]
lutinTools.create_directory_of_file(file_dst) tools.create_directory_of_file(file_dst)
debug.print_element("SharedLib", name, "==>", file_dst) debug.print_element("SharedLib", name, "==>", file_dst)
lutinMultiprocess.run_command(cmdLine) multiprocess.run_command(cmdLine)
# strip the output file: # strip the output file:
if target.config["mode"] == "release" \ if target.config["mode"] == "release" \
or lutinEnv.get_force_strip_mode() == True: or env.get_force_strip_mode() == True:
# get the file size of the non strip file # get the file size of the non strip file
originSize = lutinTools.file_size(file_dst); originSize = tools.file_size(file_dst);
debug.print_element("SharedLib(strip)", name, "", "") debug.print_element("SharedLib(strip)", name, "", "")
cmdLineStrip=lutinTools.list_to_str([ cmdLineStrip=tools.list_to_str([
target.strip, target.strip,
file_dst]) file_dst])
lutinMultiprocess.run_command(cmdLineStrip) multiprocess.run_command(cmdLineStrip)
# get the stip size of the binary # get the stip size of the binary
stripSize = lutinTools.file_size(file_dst) stripSize = tools.file_size(file_dst)
debug.debug("file reduce size : " + str(originSize/1024) + "ko ==> " + str(stripSize/1024) + "ko") debug.debug("file reduce size : " + str(originSize/1024) + "ko ==> " + str(stripSize/1024) + "ko")
# write cmd line only after to prevent errors ... # write cmd line only after to prevent errors ...
lutinMultiprocess.store_command(cmdLine, file_cmd) multiprocess.store_command(cmdLine, file_cmd)
#debug.print_element("SharedLib", self.name, "==>", tmpList[1]) #debug.print_element("SharedLib", self.name, "==>", tmpList[1])

View File

@ -1,10 +1,11 @@
## ##
## Static library builder ## Static library builder
## ##
import lutinMultiprocess from lutin import multiprocess
import lutinTools from lutin import tools
import lutinDebug as debug from lutin import debug
import lutinDepend as dependency from lutin import depend
from lutin import env
import os import os
## ##
@ -59,23 +60,23 @@ def link(file, binary, target, depancy, name, basic_folder):
cmd.append(file_src) cmd.append(file_src)
except: except:
pass pass
cmdLine=lutinTools.list_to_str(cmd) cmdLine=tools.list_to_str(cmd)
# check the dependency for this file : # check the dependency for this file :
if dependency.need_re_package(file_dst, file_src, True, file_cmd, cmdLine) == False \ if depend.need_re_package(file_dst, file_src, True, file_cmd, cmdLine) == False \
and dependency.need_re_package(file_dst, depancy.src, False, file_cmd, cmdLine) == False: and depend.need_re_package(file_dst, depancy.src, False, file_cmd, cmdLine) == False:
return file_dst return file_dst
lutinTools.create_directory_of_file(file_dst) tools.create_directory_of_file(file_dst)
debug.print_element("StaticLib", name, "==>", file_dst) debug.print_element("StaticLib", name, "==>", file_dst)
# explicitly remove the destination to prevent error ... # explicitly remove the destination to prevent error ...
if os.path.exists(file_dst) and os.path.isfile(file_dst): if os.path.exists(file_dst) and os.path.isfile(file_dst):
os.remove(file_dst) os.remove(file_dst)
lutinMultiprocess.run_command(cmdLine) multiprocess.run_command(cmdLine)
#$(Q)$(TARGET_RANLIB) $@ #$(Q)$(TARGET_RANLIB) $@
if target.ranlib != "": if target.ranlib != "":
cmdLineRanLib=lutinTools.list_to_str([ cmdLineRanLib=tools.list_to_str([
target.ranlib, target.ranlib,
file_dst ]) file_dst ])
lutinMultiprocess.run_command(cmdLineRanLib) multiprocess.run_command(cmdLineRanLib)
# write cmd line only after to prevent errors ... # write cmd line only after to prevent errors ...
lutinMultiprocess.store_command(cmdLine, file_cmd) multiprocess.store_command(cmdLine, file_cmd)
return file_dst return file_dst

View File

@ -1,11 +1,11 @@
## ##
## Objective-C builder ## Objective-C builder
## ##
import lutinMultiprocess from lutin import multiprocess
import lutinTools from lutin import tools
import lutinBuilder from lutin import builder
import lutinDebug as debug from lutin import debug
import lutinDepend as dependency from lutin import depend
local_ref_on_builder_c = None local_ref_on_builder_c = None
@ -15,7 +15,7 @@ local_ref_on_builder_c = None
def init(): def init():
global local_ref_on_builder_c global local_ref_on_builder_c
debug.debug("m builder get dependency on the C builder") debug.debug("m builder get dependency on the C builder")
local_ref_on_builder_c = lutinBuilder.get_builder("c") local_ref_on_builder_c = builder.get_builder("c")
## ##
## Get the current builder type. ## Get the current builder type.
@ -51,15 +51,15 @@ def compile(file, binary, target, depancy, flags, path, name, basic_folder):
target.sysroot, target.sysroot,
target.global_include_cc] target.global_include_cc]
try: try:
cmd.append(lutinTools.add_prefix("-I",path["export"])) cmd.append(tools.add_prefix("-I",path["export"]))
except: except:
pass pass
try: try:
cmd.append(lutinTools.add_prefix("-I",path["local"])) cmd.append(tools.add_prefix("-I",path["local"]))
except: except:
pass pass
try: try:
cmd.append(lutinTools.add_prefix("-I",depancy.path)) cmd.append(tools.add_prefix("-I",depancy.path))
except: except:
pass pass
try: try:
@ -102,13 +102,13 @@ def compile(file, binary, target, depancy, flags, path, name, basic_folder):
cmd.append("-x objective-c") cmd.append("-x objective-c")
cmd.append(file_src) cmd.append(file_src)
# Create cmd line # Create cmd line
cmdLine=lutinTools.list_to_str(cmd) cmdLine=tools.list_to_str(cmd)
# check the dependency for this file : # check the dependency for this file :
if False==dependency.need_re_build(file_dst, file_src, file_depend, file_cmd, cmdLine): if False==depend.need_re_build(file_dst, file_src, file_depend, file_cmd, cmdLine):
return file_dst return file_dst
lutinTools.create_directory_of_file(file_dst) tools.create_directory_of_file(file_dst)
comment = ["m", name, "<==", file] comment = ["m", name, "<==", file]
#process element #process element
lutinMultiprocess.run_in_pool(cmdLine, comment, file_cmd) multiprocess.run_in_pool(cmdLine, comment, file_cmd)
return file_dst return file_dst

View File

@ -1,11 +1,11 @@
## ##
## Objective C++ builder ## Objective C++ builder
## ##
import lutinMultiprocess from lutin import multiprocess
import lutinTools from lutin import tools
import lutinBuilder from lutin import builder
import lutinDebug as debug from lutin import debug
import lutinDepend as dependency from lutin import depend
local_ref_on_builder_cpp = None local_ref_on_builder_cpp = None
@ -15,7 +15,7 @@ local_ref_on_builder_cpp = None
def init(): def init():
global local_ref_on_builder_cpp global local_ref_on_builder_cpp
debug.debug("mm builder get dependency on the CPP builder") debug.debug("mm builder get dependency on the CPP builder")
local_ref_on_builder_cpp = lutinBuilder.get_builder("cpp") local_ref_on_builder_cpp = builder.get_builder("cpp")
## ##
## Get the current builder type. ## Get the current builder type.
@ -51,15 +51,15 @@ def compile(file, binary, target, depancy, flags, path, name, basic_folder):
target.sysroot, target.sysroot,
target.global_include_cc] target.global_include_cc]
try: try:
cmd.append(lutinTools.add_prefix("-I",path["export"])) cmd.append(tools.add_prefix("-I",path["export"]))
except: except:
pass pass
try: try:
cmd.append(lutinTools.add_prefix("-I",path["local"])) cmd.append(tools.add_prefix("-I",path["local"]))
except: except:
pass pass
try: try:
cmd.append(lutinTools.add_prefix("-I",depancy.path)) cmd.append(tools.add_prefix("-I",depancy.path))
except: except:
pass pass
try: try:
@ -114,12 +114,12 @@ def compile(file, binary, target, depancy, flags, path, name, basic_folder):
cmd.append("-x objective-c++") cmd.append("-x objective-c++")
cmd.append(file_src) cmd.append(file_src)
# Create cmd line # Create cmd line
cmdLine=lutinTools.list_to_str(cmd) cmdLine=tools.list_to_str(cmd)
# check the dependency for this file : # check the dependency for this file :
if False==dependency.need_re_build(file_dst, file_src, file_depend, file_cmd, cmdLine): if False==depend.need_re_build(file_dst, file_src, file_depend, file_cmd, cmdLine):
return file_dst return file_dst
lutinTools.create_directory_of_file(file_dst) tools.create_directory_of_file(file_dst)
comment = ["m++", name, "<==", file] comment = ["m++", name, "<==", file]
#process element #process element
lutinMultiprocess.run_in_pool(cmdLine, comment, file_cmd) multiprocess.run_in_pool(cmdLine, comment, file_cmd)
return file_dst return file_dst

View File

@ -1,9 +1,9 @@
## ##
## ASM builder ## ASM builder
## ##
import lutinMultiprocess from lutin import multiprocess
import lutinTools from lutin import tools
import lutinDepend as dependency from lutin import depend
## ##
## Initialize the builder, if needed ... to get dependency between builder (for example) ## Initialize the builder, if needed ... to get dependency between builder (for example)

View File

@ -8,7 +8,6 @@
## ##
import os import os
from . import multiprocess as lutinMultiprocess
import threading import threading
import re import re
@ -107,7 +106,8 @@ def error(input, threadID=-1, force=False, crash=True):
print(color_red + "[ERROR] " + input + color_default) print(color_red + "[ERROR] " + input + color_default)
debugLock.release() debugLock.release()
if crash==True: if crash==True:
lutinMultiprocess.error_occured() from . import multiprocess
multiprocess.error_occured()
if threadID != -1: if threadID != -1:
threading.interrupt_main() threading.interrupt_main()
exit(-1) exit(-1)

View File

@ -6,11 +6,10 @@
## ##
## @license APACHE v2.0 (see license file) ## @license APACHE v2.0 (see license file)
## ##
import os import os
# Local import
from . import debug from . import debug
from . import env as environement from . import env
def need_re_build(dst, src, dependFile=None, file_cmd="", cmdLine=""): def need_re_build(dst, src, dependFile=None, file_cmd="", cmdLine=""):
debug.extreme_verbose("Resuest check of dependency of :") debug.extreme_verbose("Resuest check of dependency of :")
@ -19,7 +18,7 @@ def need_re_build(dst, src, dependFile=None, file_cmd="", cmdLine=""):
debug.extreme_verbose(" dept='" + str(dependFile) + "'") debug.extreme_verbose(" dept='" + str(dependFile) + "'")
debug.extreme_verbose(" cmd='" + str(file_cmd) + "'") debug.extreme_verbose(" cmd='" + str(file_cmd) + "'")
# if force mode selected ==> just force rebuild ... # if force mode selected ==> just force rebuild ...
if environement.get_force_mode(): if env.get_force_mode():
debug.extreme_verbose(" ==> must rebuild (force mode)") debug.extreme_verbose(" ==> must rebuild (force mode)")
return True return True
@ -118,7 +117,7 @@ def need_re_package(dst, srcList, mustHaveSrc, file_cmd="", cmdLine=""):
return False return False
# if force mode selected ==> just force rebuild ... # if force mode selected ==> just force rebuild ...
if environement.get_force_mode(): if env.get_force_mode():
debug.extreme_verbose(" ==> must re-package (force mode)") debug.extreme_verbose(" ==> must re-package (force mode)")
return True return True

View File

@ -7,6 +7,7 @@
## @license APACHE v2.0 (see license file) ## @license APACHE v2.0 (see license file)
## ##
# Local import
from . import debug from . import debug

View File

@ -6,9 +6,9 @@
## ##
## @license APACHE v2.0 (see license file) ## @license APACHE v2.0 (see license file)
## ##
import sys import sys
import copy import copy
# Local import
from . import debug from . import debug

View File

@ -6,9 +6,9 @@
## ##
## @license APACHE v2.0 (see license file) ## @license APACHE v2.0 (see license file)
## ##
import platform import platform
import sys import sys
# Local import
from . import debug from . import debug
# print os.name # ==> 'posix' # print os.name # ==> 'posix'

View File

@ -6,13 +6,13 @@
## ##
## @license APACHE v2.0 (see license file) ## @license APACHE v2.0 (see license file)
## ##
from . import debug
from . import tools
import platform import platform
import os import os
from . import multiprocess as lutinMultiprocess # Local import
from . import depend as dependency from . import debug
from . import tools
from . import multiprocess
from . import depend
enableResizeImage = True enableResizeImage = True
try: try:
@ -40,7 +40,7 @@ def resize(srcFile, destFile, x, y, cmd_file=None):
if os.path.exists(srcFile) == False: if os.path.exists(srcFile) == False:
debug.error("Request a resize an image that does not existed : '" + srcFile + "'") debug.error("Request a resize an image that does not existed : '" + srcFile + "'")
cmd_line = "resize Image : " + srcFile + " ==> " + destFile + " newSize=(" + str(x) + "x" + str(y) + ")" cmd_line = "resize Image : " + srcFile + " ==> " + destFile + " newSize=(" + str(x) + "x" + str(y) + ")"
if False==dependency.need_re_build(destFile, srcFile, file_cmd=cmd_file , cmdLine=cmd_line): if False==depend.need_re_build(destFile, srcFile, file_cmd=cmd_file , cmdLine=cmd_line):
return return
# add cmdLine ... # add cmdLine ...
x = get_pow_2_multiple(x) x = get_pow_2_multiple(x)
@ -90,4 +90,4 @@ def resize(srcFile, destFile, x, y, cmd_file=None):
tmpImage = im1.resize((x, y), Image.ANTIALIAS) tmpImage = im1.resize((x, y), Image.ANTIALIAS)
tools.create_directory_of_file(destFile) tools.create_directory_of_file(destFile)
tmpImage.save(destFile) tmpImage.save(destFile)
lutinMultiprocess.store_command(cmd_line, cmd_file) multiprocess.store_command(cmd_line, cmd_file)

View File

@ -11,15 +11,13 @@ import sys
import os import os
import inspect import inspect
import fnmatch import fnmatch
from . import module # Local import
from . import host from . import host
from . import tools as lutinTools from . import tools
from . import debug from . import debug
from . import heritage from . import heritage
from . import depend as dependency
from . import builder from . import builder
from . import multiprocess as lutinMultiprocess from . import multiprocess
from . import env as lutinEnv
class Module: class Module:
@ -89,7 +87,7 @@ class Module:
debug.error(' ==> error : "%s" ' %moduleType) debug.error(' ==> error : "%s" ' %moduleType)
raise 'Input value error' raise 'Input value error'
self.origin_file = file; self.origin_file = file;
self.origin_folder = lutinTools.get_current_path(self.origin_file) self.origin_folder = tools.get_current_path(self.origin_file)
self.local_heritage = heritage.heritage(self) self.local_heritage = heritage.heritage(self)
self.package_prop = { "COMPAGNY_TYPE" : set(""), self.package_prop = { "COMPAGNY_TYPE" : set(""),
@ -185,7 +183,7 @@ class Module:
def folders_to_staging(self, binary_name, target): def folders_to_staging(self, binary_name, target):
for source, destination in self.folders: for source, destination in self.folders:
debug.debug("Might copy folder : " + source + "==>" + destination) debug.debug("Might copy folder : " + source + "==>" + destination)
lutinTools.copy_anything_target(target, self.origin_folder + "/" + source, destination) tools.copy_anything_target(target, self.origin_folder + "/" + source, destination)
# call here to build the module # call here to build the module
def build(self, target, package_name): def build(self, target, package_name):
@ -246,7 +244,7 @@ class Module:
debug.warning(" UN-SUPPORTED file format: '" + self.origin_folder + "/" + file + "'") debug.warning(" UN-SUPPORTED file format: '" + self.origin_folder + "/" + file + "'")
# when multiprocess availlable, we need to synchronize here ... # when multiprocess availlable, we need to synchronize here ...
lutinMultiprocess.pool_synchrosize() multiprocess.pool_synchrosize()
# generate end point: # generate end point:
if self.type=='PREBUILD': if self.type=='PREBUILD':
@ -340,16 +338,16 @@ class Module:
# remove folder of the lib ... for this targer # remove folder of the lib ... for this targer
folderbuild = target.get_build_folder(self.name) folderbuild = target.get_build_folder(self.name)
debug.info("remove folder : '" + folderbuild + "'") debug.info("remove folder : '" + folderbuild + "'")
lutinTools.remove_folder_and_sub_folder(folderbuild) tools.remove_folder_and_sub_folder(folderbuild)
elif self.type=='BINARY' \ elif self.type=='BINARY' \
or self.type=='PACKAGE': or self.type=='PACKAGE':
# remove folder of the lib ... for this targer # remove folder of the lib ... for this targer
folderbuild = target.get_build_folder(self.name) folderbuild = target.get_build_folder(self.name)
debug.info("remove folder : '" + folderbuild + "'") debug.info("remove folder : '" + folderbuild + "'")
lutinTools.remove_folder_and_sub_folder(folderbuild) tools.remove_folder_and_sub_folder(folderbuild)
folderStaging = target.get_staging_folder(self.name) folderStaging = target.get_staging_folder(self.name)
debug.info("remove folder : '" + folderStaging + "'") debug.info("remove folder : '" + folderStaging + "'")
lutinTools.remove_folder_and_sub_folder(folderStaging) tools.remove_folder_and_sub_folder(folderStaging)
else: else:
debug.error("Dit not know the element type ... (impossible case) type=" + self.type) debug.error("Dit not know the element type ... (impossible case) type=" + self.type)

View File

@ -18,9 +18,10 @@ else:
import os import os
import subprocess import subprocess
import shlex import shlex
# Local import
from . import debug from . import debug
from . import tools as lutinTools import tools
from . import env as lutinEnv from . import env
queueLock = threading.Lock() queueLock = threading.Lock()
workQueue = queue.Queue() workQueue = queue.Queue()
@ -46,7 +47,7 @@ def store_command(cmdLine, file):
if file != "" \ if file != "" \
and file != None: and file != None:
# Create directory: # Create directory:
lutinTools.create_directory_of_file(file) tools.create_directory_of_file(file)
# Store the command Line: # Store the command Line:
file2 = open(file, "w") file2 = open(file, "w")
file2.write(cmdLine) file2.write(cmdLine)
@ -98,7 +99,7 @@ def run_command(cmdLine, storeCmdLine="", buildId=-1, file=""):
err = err.decode("utf-8") err = err.decode("utf-8")
# Check error : # Check error :
if p.returncode == 0: if p.returncode == 0:
debug.debug(lutinEnv.print_pretty(cmdLine)) debug.debug(env.print_pretty(cmdLine))
queueLock.acquire() queueLock.acquire()
# TODO : Print the output all the time .... ==> to show warnings ... # TODO : Print the output all the time .... ==> to show warnings ...
if buildId >= 0 and (output != "" or err != ""): if buildId >= 0 and (output != "" or err != ""):
@ -113,7 +114,7 @@ def run_command(cmdLine, storeCmdLine="", buildId=-1, file=""):
exitFlag = True exitFlag = True
# if No ID : Not in a multiprocess mode ==> just stop here # if No ID : Not in a multiprocess mode ==> just stop here
if buildId < 0: if buildId < 0:
debug.debug(lutinEnv.print_pretty(cmdLine), force=True) debug.debug(env.print_pretty(cmdLine), force=True)
debug.print_compilator(output) debug.print_compilator(output)
debug.print_compilator(err) debug.print_compilator(err)
if p.returncode == 2: if p.returncode == 2:
@ -266,7 +267,7 @@ def pool_synchrosize():
debug.error("Pool error occured ... (No return information on Pool)") debug.error("Pool error occured ... (No return information on Pool)")
return return
debug.error("Error in an pool element : [" + str(errorExecution["id"]) + "]", crash=False) debug.error("Error in an pool element : [" + str(errorExecution["id"]) + "]", crash=False)
debug.debug(lutinEnv.print_pretty(errorExecution["cmd"]), force=True) debug.debug(env.print_pretty(errorExecution["cmd"]), force=True)
debug.print_compilator(str(errorExecution["out"][0])) debug.print_compilator(str(errorExecution["out"][0]))
debug.print_compilator(str(errorExecution["err"][0])) debug.print_compilator(str(errorExecution["err"][0]))
if errorExecution["return"] == 2: if errorExecution["return"] == 2:

View File

@ -11,12 +11,10 @@ import sys
import os import os
import inspect import inspect
import fnmatch import fnmatch
from . import debug
import datetime import datetime
from . import tools as lutinTools # Local import
from . import debug
from . import module from . import module
from . import image as lutinImage
from . import host as lutinHost
class System: class System:
def __init__(self): def __init__(self):

View File

@ -7,14 +7,14 @@
## @license APACHE v2.0 (see license file) ## @license APACHE v2.0 (see license file)
## ##
import lutinDebug as debug from lutin import debug
import lutinSystem from lutin import system
import lutinTools as tools from lutin import tools
import os import os
class System(lutinSystem.System): class System(system.System):
def __init__(self): def __init__(self):
lutinSystem.System.__init__(self) system.System.__init__(self)
# create some HELP: # create some HELP:
self.help="CoreAudio : Ios interface for audio (all time present, just system interface)" self.help="CoreAudio : Ios interface for audio (all time present, just system interface)"
self.valid = True self.valid = True

View File

@ -7,14 +7,14 @@
## @license APACHE v2.0 (see license file) ## @license APACHE v2.0 (see license file)
## ##
import lutinDebug as debug from lutin import debug
import lutinSystem from lutin import system
import lutinTools as tools from lutin import tools
import os import os
class System(lutinSystem.System): class System(system.System):
def __init__(self): def __init__(self):
lutinSystem.System.__init__(self) system.System.__init__(self)
# create some HELP: # create some HELP:
self.help="ALSA : Advanced Linux Sound Architecture\n Can be install with the package:\n - libasound2-dev" self.help="ALSA : Advanced Linux Sound Architecture\n Can be install with the package:\n - libasound2-dev"
# check if the library exist: # check if the library exist:

View File

@ -7,14 +7,14 @@
## @license APACHE v2.0 (see license file) ## @license APACHE v2.0 (see license file)
## ##
import lutinDebug as debug from lutin import debug
import lutinSystem from lutin import system
import lutinTools as tools from lutin import tools
import os import os
class System(lutinSystem.System): class System(system.System):
def __init__(self): def __init__(self):
lutinSystem.System.__init__(self) system.System.__init__(self)
# create some HELP: # create some HELP:
self.help="BOOST : Boost interface (need when we have not all c++ feature\n Can be install with the package:\n - libboost-all-dev" self.help="BOOST : Boost interface (need when we have not all c++ feature\n Can be install with the package:\n - libboost-all-dev"
# check if the library exist: # check if the library exist:

View File

@ -7,14 +7,14 @@
## @license APACHE v2.0 (see license file) ## @license APACHE v2.0 (see license file)
## ##
import lutinDebug as debug from lutin import debug
import lutinSystem from lutin import system
import lutinTools as tools from lutin import tools
import os import os
class System(lutinSystem.System): class System(system.System):
def __init__(self): def __init__(self):
lutinSystem.System.__init__(self) system.System.__init__(self)
# create some HELP: # create some HELP:
self.help="JACK : Jack Low-Latency Audio Server\n Can be install with the package:\n - libjack-jackd2-dev (new)\n - libjack-dev (old)" self.help="JACK : Jack Low-Latency Audio Server\n Can be install with the package:\n - libjack-jackd2-dev (new)\n - libjack-dev (old)"
# check if the library exist: # check if the library exist:

View File

@ -7,14 +7,14 @@
## @license APACHE v2.0 (see license file) ## @license APACHE v2.0 (see license file)
## ##
import lutinDebug as debug from lutin import debug
import lutinSystem from lutin import system
import lutinTools as tools from lutin import tools
import os import os
class System(lutinSystem.System): class System(system.System):
def __init__(self): def __init__(self):
lutinSystem.System.__init__(self) system.System.__init__(self)
# create some HELP: # create some HELP:
self.help="OSS : Linux Open Sound System\n Can be install with the package:\n - ... TODO ..." self.help="OSS : Linux Open Sound System\n Can be install with the package:\n - ... TODO ..."
# check if the library exist: # check if the library exist:

View File

@ -7,14 +7,14 @@
## @license APACHE v2.0 (see license file) ## @license APACHE v2.0 (see license file)
## ##
import lutinDebug as debug from lutin import debug
import lutinSystem from lutin import system
import lutinTools as tools from lutin import tools
import os import os
class System(lutinSystem.System): class System(system.System):
def __init__(self): def __init__(self):
lutinSystem.System.__init__(self) system.System.__init__(self)
# create some HELP: # create some HELP:
self.help="PULSE : The Linux PulseAudio\n Can be install with the package:\n - libpulse-dev" self.help="PULSE : The Linux PulseAudio\n Can be install with the package:\n - libpulse-dev"
# check if the library exist: # check if the library exist:

View File

@ -7,14 +7,14 @@
## @license APACHE v2.0 (see license file) ## @license APACHE v2.0 (see license file)
## ##
import lutinDebug as debug from lutin import debug
import lutinSystem from lutin import system
import lutinTools as tools from lutin import tools
import os import os
class System(lutinSystem.System): class System(system.System):
def __init__(self): def __init__(self):
lutinSystem.System.__init__(self) system.System.__init__(self)
# create some HELP: # create some HELP:
self.help="Z : z library \n Can be install with the package:\n - zlib1g-dev" self.help="Z : z library \n Can be install with the package:\n - zlib1g-dev"
# check if the library exist: # check if the library exist:

View File

@ -7,14 +7,14 @@
## @license APACHE v2.0 (see license file) ## @license APACHE v2.0 (see license file)
## ##
import lutinDebug as debug from lutin import debug
import lutinSystem from lutin import system
import lutinTools as tools from lutin import tools
import os import os
class System(lutinSystem.System): class System(system.System):
def __init__(self): def __init__(self):
lutinSystem.System.__init__(self) system.System.__init__(self)
# create some HELP: # create some HELP:
self.help="CoreAudio : MacOs interface for audio (all time present, just system interface)" self.help="CoreAudio : MacOs interface for audio (all time present, just system interface)"
self.valid = True self.valid = True

View File

@ -7,14 +7,14 @@
## @license APACHE v2.0 (see license file) ## @license APACHE v2.0 (see license file)
## ##
import lutinDebug as debug from lutin import debug
import lutinSystem from lutin import system
import lutinTools as tools from lutin import tools
import os import os
class System(lutinSystem.System): class System(system.System):
def __init__(self): def __init__(self):
lutinSystem.System.__init__(self) system.System.__init__(self)
# create some HELP: # create some HELP:
self.help="DirectSound : Direct sound API for windows audio interface" self.help="DirectSound : Direct sound API for windows audio interface"
# check if the library exist: # check if the library exist:

View File

@ -11,14 +11,14 @@ import sys
import os import os
import inspect import inspect
import fnmatch import fnmatch
import datetime
# Local import
from . import debug from . import debug
from . import heritage from . import heritage
import datetime from . import tools
from . import tools as lutinTools from . import module
from . import module as lutinModule from . import system
from . import system as lutinSystem from . import image
from . import image as lutinImage
from . import host as lutinHost
from . import multiprocess from . import multiprocess
class Target: class Target:
@ -190,10 +190,10 @@ class Target:
debug.verbose("cmd file " + cmdFile) debug.verbose("cmd file " + cmdFile)
if x == -1: if x == -1:
debug.verbose("must copy file : '" + source + "' ==> '" + dst + "'"); debug.verbose("must copy file : '" + source + "' ==> '" + dst + "'");
lutinTools.copy_file(source, baseFolder+"/"+dst, cmdFile) tools.copy_file(source, baseFolder+"/"+dst, cmdFile)
else: else:
debug.verbose("resize image : '" + source + "' ==> '" + dst + "' size=(" + str(x) + "," + str(y) + ")"); debug.verbose("resize image : '" + source + "' ==> '" + dst + "' size=(" + str(x) + "," + str(y) + ")");
lutinImage.resize(source, baseFolder+"/"+dst, x, y, cmdFile) image.resize(source, baseFolder+"/"+dst, x, y, cmdFile)
def clean_module_tree(self): def clean_module_tree(self):
@ -243,32 +243,32 @@ class Target:
return list return list
def get_final_folder(self): def get_final_folder(self):
return lutinTools.get_run_folder() + self.folder_out + self.folder_final return tools.get_run_folder() + self.folder_out + self.folder_final
def get_staging_folder(self, binaryName): def get_staging_folder(self, binaryName):
return lutinTools.get_run_folder() + self.folder_out + self.folder_staging + "/" + binaryName return tools.get_run_folder() + self.folder_out + self.folder_staging + "/" + binaryName
def get_staging_folder_data(self, binaryName): def get_staging_folder_data(self, binaryName):
return self.get_staging_folder(binaryName) + self.folder_data + "/" + binaryName return self.get_staging_folder(binaryName) + self.folder_data + "/" + binaryName
def get_build_folder(self, moduleName): def get_build_folder(self, moduleName):
return lutinTools.get_run_folder() + self.folder_out + self.folder_build + "/" + moduleName return tools.get_run_folder() + self.folder_out + self.folder_build + "/" + moduleName
def get_doc_folder(self, moduleName): def get_doc_folder(self, moduleName):
return lutinTools.get_run_folder() + self.folder_out + self.folder_doc + "/" + moduleName return tools.get_run_folder() + self.folder_out + self.folder_doc + "/" + moduleName
def is_module_build(self, module): def is_module_build(self, my_module):
for mod in self.buildDone: for mod in self.buildDone:
if mod == module: if mod == my_module:
return True return True
self.buildDone.append(module) self.buildDone.append(my_module)
return False return False
def is_module_buildTree(self, module): def is_module_buildTree(self, my_module):
for mod in self.buildTreeDone: for mod in self.buildTreeDone:
if mod == module: if mod == my_module:
return True return True
self.buildTreeDone.append(module) self.buildTreeDone.append(my_module)
return False return False
def add_module(self, newModule): def add_module(self, newModule):
@ -286,16 +286,16 @@ class Target:
""" """
def build_tree(self, name, packagesName): def build_tree(self, name, packagesName):
for module in self.moduleList: for mod in self.moduleList:
if module.name == name: if mod.name == name:
module.build_tree(self, packagesName) mod.build_tree(self, packagesName)
return return
debug.error("request to build tree on un-existant module name : '" + name + "'") debug.error("request to build tree on un-existant module name : '" + name + "'")
def clean(self, name): def clean(self, name):
for module in self.moduleList: for mod in self.moduleList:
if module.name == name: if mod.name == name:
module.clean(self) mod.clean(self)
return return
debug.error("request to clean an un-existant module name : '" + name + "'") debug.error("request to clean an un-existant module name : '" + name + "'")
@ -304,32 +304,32 @@ class Target:
if elem.name == name: if elem.name == name:
return True return True
if optionnal == False: if optionnal == False:
lutinModule.load_module(self, name) module.load_module(self, name)
return True return True
else: else:
# TODO : Check internal module and system module ... # TODO : Check internal module and system module ...
# need to import the module (or the system module ...) # need to import the module (or the system module ...)
exist = lutinSystem.exist(name, self.name) exist = system.exist(name, self.name)
if exist == True: if exist == True:
lutinSystem.load(self, name, self.name) system.load(self, name, self.name)
return True; return True;
# try to find in the local Modules: # try to find in the local Modules:
exist = lutinModule.exist(self, name) exist = module.exist(self, name)
if exist == True: if exist == True:
lutinModule.load_module(self, name) module.load_module(self, name)
return True; return True;
else: else:
return False; return False;
def load_all(self): def load_all(self):
listOfAllTheModule = lutinModule.list_all_module() listOfAllTheModule = module.list_all_module()
for modName in listOfAllTheModule: for modName in listOfAllTheModule:
self.load_if_needed(modName) self.load_if_needed(modName)
def project_add_module(self, name, projectMng, addedModule): def project_add_module(self, name, projectMng, addedModule):
for module in self.moduleList: for mod in self.moduleList:
if module.name == name: if mod.name == name:
module.ext_project_add_module(self, projectMng, addedModule) mod.ext_project_add_module(self, projectMng, addedModule)
return return
def build_optionnal(self, moduleName, packagesName=None): def build_optionnal(self, moduleName, packagesName=None):

View File

@ -8,17 +8,16 @@
## ##
import lutinDebug as debug from lutin import debug
import lutinTarget from lutin import target
import lutinTools as tools from lutin import tools
import lutinHost from lutin import image
import lutinImage from lutin import multiprocess
import lutinMultiprocess from lutin import host
import lutinHost
import os import os
import sys import sys
class Target(lutinTarget.Target): class Target(target.Target):
def __init__(self, config): def __init__(self, config):
#processor type selection (auto/arm/ppc/x86) #processor type selection (auto/arm/ppc/x86)
if config["arch"] == "auto": if config["arch"] == "auto":
@ -28,7 +27,7 @@ class Target(lutinTarget.Target):
config["bus-size"] = "32" config["bus-size"] = "32"
arch = ""#"ARMv7" arch = ""#"ARMv7"
lutinTarget.Target.__init__(self, "Android", config, arch) target.Target.__init__(self, "Android", config, arch)
self.folder_ndk = os.getenv('PROJECT_NDK', "AUTO") self.folder_ndk = os.getenv('PROJECT_NDK', "AUTO")
self.folder_sdk = os.getenv('PROJECT_SDK', "AUTO") self.folder_sdk = os.getenv('PROJECT_SDK', "AUTO")
@ -57,7 +56,7 @@ class Target(lutinTarget.Target):
tmpOsVal = "64" tmpOsVal = "64"
gccVersion = "4.9" gccVersion = "4.9"
if lutinHost.BUS_SIZE==64: if host.BUS_SIZE==64:
tmpOsVal = "_64" tmpOsVal = "_64"
if self.config["compilator"] == "clang": if self.config["compilator"] == "clang":
self.set_cross_base(self.folder_ndk + "/toolchains/llvm-3.3/prebuilt/linux-x86_64/bin/") self.set_cross_base(self.folder_ndk + "/toolchains/llvm-3.3/prebuilt/linux-x86_64/bin/")
@ -334,7 +333,7 @@ class Target(lutinTarget.Target):
tools.create_directory_of_file(self.get_staging_folder(pkgName) + "/res/drawable/icon.png"); tools.create_directory_of_file(self.get_staging_folder(pkgName) + "/res/drawable/icon.png");
if "ICON" in pkgProperties.keys() \ if "ICON" in pkgProperties.keys() \
and pkgProperties["ICON"] != "": and pkgProperties["ICON"] != "":
lutinImage.resize(pkgProperties["ICON"], self.get_staging_folder(pkgName) + "/res/drawable/icon.png", 256, 256) image.resize(pkgProperties["ICON"], self.get_staging_folder(pkgName) + "/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_folder(pkgName) + "/res/drawable/plop.txt", 'w') tmpFile = open(self.get_staging_folder(pkgName) + "/res/drawable/plop.txt", 'w')
@ -596,7 +595,7 @@ class Target(lutinTarget.Target):
+ "-S " + self.get_staging_folder(pkgName) + "/res/ " \ + "-S " + self.get_staging_folder(pkgName) + "/res/ " \
+ adModResouceFolder \ + adModResouceFolder \
+ "-J " + self.get_staging_folder(pkgName) + "/src/ " + "-J " + self.get_staging_folder(pkgName) + "/src/ "
lutinMultiprocess.run_command(cmdLine) multiprocess.run_command(cmdLine)
#aapt package -f -M ${manifest.file} -F ${packaged.resource.file} -I ${path.to.android-jar.library} #aapt package -f -M ${manifest.file} -F ${packaged.resource.file} -I ${path.to.android-jar.library}
# -S ${android-resource-directory} [-m -J ${folder.to.output.the.R.java}] # -S ${android-resource-directory} [-m -J ${folder.to.output.the.R.java}]
@ -637,7 +636,7 @@ class Target(lutinTarget.Target):
+ filesString \ + filesString \
+ self.file_finalAbstraction + " " \ + self.file_finalAbstraction + " " \
+ self.get_staging_folder(pkgName) + "/src/R.java " + self.get_staging_folder(pkgName) + "/src/R.java "
lutinMultiprocess.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 " \
@ -648,7 +647,7 @@ class Target(lutinTarget.Target):
if "ADMOD_ID" in pkgProperties: if "ADMOD_ID" in pkgProperties:
cmdLine += self.folder_sdk + "/extras/google/google_play_services/libproject/google-play-services_lib/libs/google-play-services.jar " cmdLine += self.folder_sdk + "/extras/google/google_play_services/libproject/google-play-services_lib/libs/google-play-services.jar "
lutinMultiprocess.run_command(cmdLine) multiprocess.run_command(cmdLine)
debug.print_element("pkg", ".apk", "<==", ".dex, assets, .so, res") debug.print_element("pkg", ".apk", "<==", ".dex, assets, .so, res")
#builderDebug="-agentlib:jdwp=transport=dt_socket,server=y,address=8050,suspend=y " #builderDebug="-agentlib:jdwp=transport=dt_socket,server=y,address=8050,suspend=y "
@ -664,7 +663,7 @@ class Target(lutinTarget.Target):
+ " -z " + self.get_staging_folder(pkgName) + "/resources.res " \ + " -z " + self.get_staging_folder(pkgName) + "/resources.res " \
+ " -f " + self.get_staging_folder(pkgName) + "/build/" + pkgNameApplicationName + ".dex " \ + " -f " + self.get_staging_folder(pkgName) + "/build/" + pkgNameApplicationName + ".dex " \
+ " -rf " + self.get_staging_folder(pkgName) + "/data " + " -rf " + self.get_staging_folder(pkgName) + "/data "
lutinMultiprocess.run_command(cmdLine) multiprocess.run_command(cmdLine)
# doc : # doc :
# http://developer.android.com/tools/publishing/app-signing.html # http://developer.android.com/tools/publishing/app-signing.html
@ -683,7 +682,7 @@ class Target(lutinTarget.Target):
+ " -keypass PassKey__AndroidDebugKey " \ + " -keypass PassKey__AndroidDebugKey " \
+ self.get_staging_folder(pkgName) + "/build/" + pkgNameApplicationName + "-unalligned.apk " \ + self.get_staging_folder(pkgName) + "/build/" + pkgNameApplicationName + "-unalligned.apk " \
+ " alias__AndroidDebugKey" + " alias__AndroidDebugKey"
lutinMultiprocess.run_command(cmdLine) multiprocess.run_command(cmdLine)
tmpFile = open("tmpPass.boo", 'w') tmpFile = open("tmpPass.boo", 'w')
tmpFile.write("\n") tmpFile.write("\n")
tmpFile.flush() tmpFile.flush()
@ -696,12 +695,12 @@ class Target(lutinTarget.Target):
+ " -sigalg SHA1withRSA -digestalg SHA1 " \ + " -sigalg SHA1withRSA -digestalg SHA1 " \
+ self.get_staging_folder(pkgName) + "/build/" + pkgNameApplicationName + "-unalligned.apk " \ + self.get_staging_folder(pkgName) + "/build/" + pkgNameApplicationName + "-unalligned.apk " \
+ " " + pkgNameApplicationName + " " + pkgNameApplicationName
lutinMultiprocess.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_folder(pkgName) + "/build/" + pkgNameApplicationName + "-unalligned.apk " + self.get_staging_folder(pkgName) + "/build/" + pkgNameApplicationName + "-unalligned.apk "
lutinMultiprocess.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_folder(pkgName) + "/" + pkgNameApplicationName + ".apk") tools.remove_file(self.get_staging_folder(pkgName) + "/" + pkgNameApplicationName + ".apk")
@ -709,7 +708,7 @@ class Target(lutinTarget.Target):
cmdLine = androidToolPath + "zipalign 4 " \ cmdLine = androidToolPath + "zipalign 4 " \
+ self.get_staging_folder(pkgName) + "/build/" + pkgNameApplicationName + "-unalligned.apk " \ + self.get_staging_folder(pkgName) + "/build/" + pkgNameApplicationName + "-unalligned.apk " \
+ self.get_staging_folder(pkgName) + "/" + pkgNameApplicationName + ".apk " + self.get_staging_folder(pkgName) + "/" + pkgNameApplicationName + ".apk "
lutinMultiprocess.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_folder(pkgName) + "/" + pkgNameApplicationName + ".apk", tools.copy_file(self.get_staging_folder(pkgName) + "/" + pkgNameApplicationName + ".apk",
@ -725,7 +724,7 @@ class Target(lutinTarget.Target):
pkgNameApplicationName += "debug" pkgNameApplicationName += "debug"
cmdLine = self.folder_sdk + "/platform-tools/adb install -r " \ cmdLine = self.folder_sdk + "/platform-tools/adb install -r " \
+ self.get_staging_folder(pkgName) + "/" + pkgNameApplicationName + ".apk " + self.get_staging_folder(pkgName) + "/" + pkgNameApplicationName + ".apk "
lutinMultiprocess.run_command(cmdLine) multiprocess.run_command(cmdLine)
def un_install_package(self, pkgName): def un_install_package(self, pkgName):
debug.debug("------------------------------------------------------------------------") debug.debug("------------------------------------------------------------------------")
@ -735,7 +734,7 @@ class Target(lutinTarget.Target):
if self.config["mode"] == "debug": if self.config["mode"] == "debug":
pkgNameApplicationName += "debug" pkgNameApplicationName += "debug"
cmdLine = self.folder_sdk + "/platform-tools/adb uninstall " + pkgNameApplicationName cmdLine = self.folder_sdk + "/platform-tools/adb uninstall " + pkgNameApplicationName
RlutinMultiprocess.unCommand(cmdLine) Rmultiprocess.unCommand(cmdLine)
def Log(self, pkgName): def Log(self, pkgName):
debug.debug("------------------------------------------------------------------------") debug.debug("------------------------------------------------------------------------")
@ -743,6 +742,6 @@ class Target(lutinTarget.Target):
debug.debug("------------------------------------------------------------------------") debug.debug("------------------------------------------------------------------------")
debug.info("cmd: " + self.folder_sdk + "/platform-tools/adb shell logcat ") debug.info("cmd: " + self.folder_sdk + "/platform-tools/adb shell logcat ")
cmdLine = self.folder_sdk + "/platform-tools/adb shell logcat " cmdLine = self.folder_sdk + "/platform-tools/adb shell logcat "
lutinMultiprocess.run_command(cmdLine) multiprocess.run_command(cmdLine)

View File

@ -7,18 +7,18 @@
## @license APACHE v2.0 (see license file) ## @license APACHE v2.0 (see license file)
## ##
import lutinDebug as debug from lutin import debug
import lutinTarget from lutin import target
import lutinTools from lutin import tools
import lutinImage from lutin import image
import os import os
import stat import stat
import lutinMultiprocess from lutin import multiprocess
import lutinHost from lutin import host
import random import random
import re import re
class Target(lutinTarget.Target): class Target(target.Target):
def __init__(self, config): def __init__(self, config):
if config["compilator"] == "gcc": if config["compilator"] == "gcc":
debug.info("compile only with clang for IOs"); debug.info("compile only with clang for IOs");
@ -37,7 +37,7 @@ class Target(lutinTarget.Target):
else: else:
arch="arm64" # for ipad air arch="arm64" # for ipad air
#arch="armv7" # for Iphone 4 #arch="armv7" # for Iphone 4
lutinTarget.Target.__init__(self, "IOs", config, arch) target.Target.__init__(self, "IOs", config, arch)
if self.config["simulation"] == True: if self.config["simulation"] == True:
self.set_cross_base("/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/") self.set_cross_base("/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/")
else: else:
@ -76,7 +76,7 @@ class Target(lutinTarget.Target):
#self.global_flags_m.append("-fmodules") #self.global_flags_m.append("-fmodules")
def get_staging_folder(self, binaryName): def get_staging_folder(self, binaryName):
return lutinTools.get_run_folder() + self.folder_out + self.folder_staging + "/" + binaryName + ".app/" return tools.get_run_folder() + self.folder_out + self.folder_staging + "/" + binaryName + ".app/"
def get_staging_folder_data(self, binaryName): def get_staging_folder_data(self, binaryName):
return self.get_staging_folder(binaryName) + self.folder_data + "/" return self.get_staging_folder(binaryName) + self.folder_data + "/"
@ -92,23 +92,23 @@ class Target(lutinTarget.Target):
# TODO : Do not regenerate if source resource is not availlable # TODO : Do not regenerate if source resource is not availlable
# TODO : Add a colored background ... # TODO : Add a colored background ...
debug.print_element("pkg", "iTunesArtwork.png", "<==", pkgProperties["ICON"]) debug.print_element("pkg", "iTunesArtwork.png", "<==", pkgProperties["ICON"])
lutinImage.resize(pkgProperties["ICON"], self.get_staging_folder(pkgName) + "/iTunesArtwork.png", 512, 512) image.resize(pkgProperties["ICON"], self.get_staging_folder(pkgName) + "/iTunesArtwork.png", 512, 512)
debug.print_element("pkg", "iTunesArtwork@2x.png", "<==", pkgProperties["ICON"]) debug.print_element("pkg", "iTunesArtwork@2x.png", "<==", pkgProperties["ICON"])
lutinImage.resize(pkgProperties["ICON"], self.get_staging_folder(pkgName) + "/iTunesArtwork@2x.png", 1024, 1024) image.resize(pkgProperties["ICON"], self.get_staging_folder(pkgName) + "/iTunesArtwork@2x.png", 1024, 1024)
debug.print_element("pkg", "Icon-60@2x.png", "<==", pkgProperties["ICON"]) debug.print_element("pkg", "Icon-60@2x.png", "<==", pkgProperties["ICON"])
lutinImage.resize(pkgProperties["ICON"], self.get_staging_folder(pkgName) + "/Icon-60@2x.png", 120, 120) image.resize(pkgProperties["ICON"], self.get_staging_folder(pkgName) + "/Icon-60@2x.png", 120, 120)
debug.print_element("pkg", "Icon-76.png", "<==", pkgProperties["ICON"]) debug.print_element("pkg", "Icon-76.png", "<==", pkgProperties["ICON"])
lutinImage.resize(pkgProperties["ICON"], self.get_staging_folder(pkgName) + "/Icon-76.png", 76, 76) image.resize(pkgProperties["ICON"], self.get_staging_folder(pkgName) + "/Icon-76.png", 76, 76)
debug.print_element("pkg", "Icon-76@2x.png", "<==", pkgProperties["ICON"]) debug.print_element("pkg", "Icon-76@2x.png", "<==", pkgProperties["ICON"])
lutinImage.resize(pkgProperties["ICON"], self.get_staging_folder(pkgName) + "/Icon-76@2x.png", 152, 152) image.resize(pkgProperties["ICON"], self.get_staging_folder(pkgName) + "/Icon-76@2x.png", 152, 152)
debug.print_element("pkg", "Icon-Small-40.png", "<==", pkgProperties["ICON"]) debug.print_element("pkg", "Icon-Small-40.png", "<==", pkgProperties["ICON"])
lutinImage.resize(pkgProperties["ICON"], self.get_staging_folder(pkgName) + "/Icon-Small-40.png", 40, 40) image.resize(pkgProperties["ICON"], self.get_staging_folder(pkgName) + "/Icon-Small-40.png", 40, 40)
debug.print_element("pkg", "Icon-Small-40@2x.png", "<==", pkgProperties["ICON"]) debug.print_element("pkg", "Icon-Small-40@2x.png", "<==", pkgProperties["ICON"])
lutinImage.resize(pkgProperties["ICON"], self.get_staging_folder(pkgName) + "/Icon-Small-40@2x.png", 80, 80) image.resize(pkgProperties["ICON"], self.get_staging_folder(pkgName) + "/Icon-Small-40@2x.png", 80, 80)
debug.print_element("pkg", "Icon-Small.png", "<==", pkgProperties["ICON"]) debug.print_element("pkg", "Icon-Small.png", "<==", pkgProperties["ICON"])
lutinImage.resize(pkgProperties["ICON"], self.get_staging_folder(pkgName) + "/Icon-Small.png", 29, 29) image.resize(pkgProperties["ICON"], self.get_staging_folder(pkgName) + "/Icon-Small.png", 29, 29)
debug.print_element("pkg", "Icon-Small@2x.png", "<==", pkgProperties["ICON"]) debug.print_element("pkg", "Icon-Small@2x.png", "<==", pkgProperties["ICON"])
lutinImage.resize(pkgProperties["ICON"], self.get_staging_folder(pkgName) + "/Icon-Small@2x.png", 58, 58) image.resize(pkgProperties["ICON"], self.get_staging_folder(pkgName) + "/Icon-Small@2x.png", 58, 58)
debug.print_element("pkg", "PkgInfo", "<==", "APPL????") debug.print_element("pkg", "PkgInfo", "<==", "APPL????")
infoFile = self.get_staging_folder(pkgName) + "/PkgInfo" infoFile = self.get_staging_folder(pkgName) + "/PkgInfo"
@ -227,7 +227,7 @@ class Target(lutinTarget.Target):
else: else:
cmdLine += " -platform iphoneos " cmdLine += " -platform iphoneos "
cmdLine += " -o " + self.get_staging_folder(pkgName) + "/" + "Info.plist" cmdLine += " -o " + self.get_staging_folder(pkgName) + "/" + "Info.plist"
lutinMultiprocess.run_command(cmdLine) multiprocess.run_command(cmdLine)
""" """
""" """
@ -329,16 +329,16 @@ class Target(lutinTarget.Target):
# application signing : # application signing :
debug.print_element("pkg(signed)", "pkg", "<==", "Signing application") debug.print_element("pkg(signed)", "pkg", "<==", "Signing application")
iosDevelopperKeyFile = ".iosKey.txt" iosDevelopperKeyFile = ".iosKey.txt"
if lutinTools.file_size(iosDevelopperKeyFile) < 10: if tools.file_size(iosDevelopperKeyFile) < 10:
debug.error("To sign an application we need to have a signing key in the file '" + iosDevelopperKeyFile + "' \n it is represented like: 'iPhone Developer: Francis DUGENOUX (YRRQE5KGTH)'\n you can obtain it with : 'certtool y | grep \"Developer\"'") debug.error("To sign an application we need to have a signing key in the file '" + iosDevelopperKeyFile + "' \n it is represented like: 'iPhone Developer: Francis DUGENOUX (YRRQE5KGTH)'\n you can obtain it with : 'certtool y | grep \"Developer\"'")
signatureKey = lutinTools.file_read_data(iosDevelopperKeyFile) signatureKey = tools.file_read_data(iosDevelopperKeyFile)
signatureKey = re.sub('\n', '', signatureKey) signatureKey = re.sub('\n', '', signatureKey)
cmdLine = 'codesign --force --sign ' cmdLine = 'codesign --force --sign '
# to get this key ; certtool y | grep "Developer" # to get this key ; certtool y | grep "Developer"
cmdLine += ' "' + signatureKey + '" ' cmdLine += ' "' + signatureKey + '" '
cmdLine += ' --entitlements ' + self.get_build_folder(pkgName) + '/worddown.xcent' cmdLine += ' --entitlements ' + self.get_build_folder(pkgName) + '/worddown.xcent'
cmdLine += ' ' + self.get_staging_folder(pkgName) cmdLine += ' ' + self.get_staging_folder(pkgName)
lutinMultiprocess.run_command(cmdLine) multiprocess.run_command(cmdLine)
# --force --sign "iPhone Developer: Edouard DUPIN (SDFGSDFGSDFG)" # --force --sign "iPhone Developer: Edouard DUPIN (SDFGSDFGSDFG)"
# --resource-rules=/Users/edouarddupin/Library/Developer/Xcode/DerivedData/worddown-cmuvjchgtiteexdiacyqoexsyadg/Build/Products/Debug-iphoneos/worddown.app/ResourceRules.plist # --resource-rules=/Users/edouarddupin/Library/Developer/Xcode/DerivedData/worddown-cmuvjchgtiteexdiacyqoexsyadg/Build/Products/Debug-iphoneos/worddown.app/ResourceRules.plist
@ -357,18 +357,18 @@ class Target(lutinTarget.Target):
debug.info("Install package '" + pkgName + "'") debug.info("Install package '" + pkgName + "'")
debug.debug("------------------------------------------------------------------------") debug.debug("------------------------------------------------------------------------")
if self.sumulator == False: if self.sumulator == False:
if lutinTools.file_size("ewol/ios-deploy/ios-deploy") == 0: if tools.file_size("ewol/ios-deploy/ios-deploy") == 0:
debug.print_element("tool", "ios-deploy", "<==", "external sources") debug.print_element("tool", "ios-deploy", "<==", "external sources")
cmdLine = 'cd ewol/ios-deploy ; make ; cd ../.. ' cmdLine = 'cd ewol/ios-deploy ; make ; cd ../.. '
lutinMultiprocess.run_command(cmdLine) multiprocess.run_command(cmdLine)
if lutinTools.file_size("ewol/ios-deploy/ios-deploy") == 0: if tools.file_size("ewol/ios-deploy/ios-deploy") == 0:
debug.error("Can not create ios-deploy external software ...") debug.error("Can not create ios-deploy external software ...")
debug.print_element("deploy", "iphone/ipad", "<==", "aplication") debug.print_element("deploy", "iphone/ipad", "<==", "aplication")
cmdLine = './ewol/ios-deploy/ios-deploy --bundle ' + self.get_staging_folder(pkgName) cmdLine = './ewol/ios-deploy/ios-deploy --bundle ' + self.get_staging_folder(pkgName)
lutinMultiprocess.run_command(cmdLine) multiprocess.run_command(cmdLine)
else: else:
simulatorIdFile = ".iosSimutatorId_" + pkgName + ".txt" simulatorIdFile = ".iosSimutatorId_" + pkgName + ".txt"
if lutinTools.file_size(simulatorIdFile) < 10: if tools.file_size(simulatorIdFile) < 10:
#create the file: #create the file:
tmpFile = open(simulatorIdFile, 'w') tmpFile = open(simulatorIdFile, 'w')
tmpFile.write(self.createRandomNumber(8)) tmpFile.write(self.createRandomNumber(8))
@ -382,17 +382,17 @@ class Target(lutinTarget.Target):
tmpFile.write(self.createRandomNumber(12)) tmpFile.write(self.createRandomNumber(12))
tmpFile.flush() tmpFile.flush()
tmpFile.close() tmpFile.close()
simulatorId = lutinTools.file_read_data(simulatorIdFile) simulatorId = tools.file_read_data(simulatorIdFile)
home = os.path.expanduser("~") home = os.path.expanduser("~")
destinationFolderBase = home + "/Library/Application\\ Support/iPhone\\ Simulator/7.1/Applications/" + simulatorId destinationFolderBase = home + "/Library/Application\\ Support/iPhone\\ Simulator/7.1/Applications/" + simulatorId
destinationFolder = home + "/Library/Application Support/iPhone Simulator/7.1/Applications/" + simulatorId + "/" + pkgName + ".app" destinationFolder = home + "/Library/Application Support/iPhone Simulator/7.1/Applications/" + simulatorId + "/" + pkgName + ".app"
destinationFolder2 = home + "/Library/Application\\ Support/iPhone\\ Simulator/7.1/Applications/" + simulatorId + "/" + pkgName + ".app" destinationFolder2 = home + "/Library/Application\\ Support/iPhone\\ Simulator/7.1/Applications/" + simulatorId + "/" + pkgName + ".app"
debug.info("install in simulator : " + destinationFolder) debug.info("install in simulator : " + destinationFolder)
lutinTools.create_directory_of_file(destinationFolder + "/plop.txt") tools.create_directory_of_file(destinationFolder + "/plop.txt")
cmdLine = "cp -rf " + self.get_staging_folder(pkgName) + " " + destinationFolder2 cmdLine = "cp -rf " + self.get_staging_folder(pkgName) + " " + destinationFolder2
lutinMultiprocess.run_command(cmdLine) multiprocess.run_command(cmdLine)
cmdLine = "touch " + destinationFolderBase cmdLine = "touch " + destinationFolderBase
lutinMultiprocess.run_command(cmdLine) multiprocess.run_command(cmdLine)
#sudo dpkg -i $(TARGET_OUT_FINAL)/$(PROJECT_NAME) + self.suffix_package #sudo dpkg -i $(TARGET_OUT_FINAL)/$(PROJECT_NAME) + self.suffix_package
@ -404,7 +404,7 @@ class Target(lutinTarget.Target):
debug.warning("not implemented") debug.warning("not implemented")
else: else:
simulatorIdFile = ".iosSimutatorId_" + pkgName + ".txt" simulatorIdFile = ".iosSimutatorId_" + pkgName + ".txt"
if lutinTools.file_size(simulatorIdFile) < 10: if tools.file_size(simulatorIdFile) < 10:
debug.warning("Can not get simulation O_ID : " + simulatorIdFile) debug.warning("Can not get simulation O_ID : " + simulatorIdFile)
#sudo dpkg -r $(TARGET_OUT_FINAL)/$(PROJECT_NAME) + self.suffix_package #sudo dpkg -r $(TARGET_OUT_FINAL)/$(PROJECT_NAME) + self.suffix_package
@ -414,18 +414,18 @@ class Target(lutinTarget.Target):
debug.info("log of iOs board") debug.info("log of iOs board")
debug.debug("------------------------------------------------------------------------") debug.debug("------------------------------------------------------------------------")
if self.sumulator == False: if self.sumulator == False:
if lutinTools.file_size("ewol/ios-deploy/ios-deploy") == 0: if tools.file_size("ewol/ios-deploy/ios-deploy") == 0:
debug.print_element("tool", "ios-deploy", "<==", "external sources") debug.print_element("tool", "ios-deploy", "<==", "external sources")
cmdLine = 'cd ewol/ios-deploy ; make ; cd ../.. ' cmdLine = 'cd ewol/ios-deploy ; make ; cd ../.. '
lutinMultiprocess.run_command(cmdLine) multiprocess.run_command(cmdLine)
if lutinTools.file_size("ewol/ios-deploy/ios-deploy") == 0: if tools.file_size("ewol/ios-deploy/ios-deploy") == 0:
debug.error("Can not create ios-deploy external software ...") debug.error("Can not create ios-deploy external software ...")
debug.print_element("deploy", "iphone/ipad", "<==", "aplication") debug.print_element("deploy", "iphone/ipad", "<==", "aplication")
cmdLine = './ewol/ios-deploy/ios-deploy --debug --bundle ' + self.get_staging_folder(pkgName) cmdLine = './ewol/ios-deploy/ios-deploy --debug --bundle ' + self.get_staging_folder(pkgName)
lutinMultiprocess.run_command(cmdLine) multiprocess.run_command(cmdLine)
else: else:
cmdLine = "tail -f ~/Library/Logs/iOS\ Simulator/7.1/system.log" cmdLine = "tail -f ~/Library/Logs/iOS\ Simulator/7.1/system.log"
lutinMultiprocess.run_command(cmdLine) multiprocess.run_command(cmdLine)

View File

@ -7,31 +7,30 @@
## @license APACHE v2.0 (see license file) ## @license APACHE v2.0 (see license file)
## ##
import lutinDebug as debug from lutin import debug
import lutinTarget from lutin import target
import lutinTools as tools from lutin import tools
import os import os
import stat import stat
import re import re
import lutinMultiprocess from lutin import host
import lutinHost
class Target(lutinTarget.Target): class Target(target.Target):
def __init__(self, config): def __init__(self, config):
#processor type selection (auto/arm/ppc/x86) #processor type selection (auto/arm/ppc/x86)
if config["arch"] == "auto": if config["arch"] == "auto":
config["arch"] = "x86" config["arch"] = "x86"
#bus size selection (auto/32/64) #bus size selection (auto/32/64)
if config["bus-size"] == "auto": if config["bus-size"] == "auto":
config["bus-size"] = str(lutinHost.BUS_SIZE) config["bus-size"] = str(host.BUS_SIZE)
lutinTarget.Target.__init__(self, "Linux", config, "") target.Target.__init__(self, "Linux", config, "")
if self.config["bus-size"] == "64": if self.config["bus-size"] == "64":
# 64 bits # 64 bits
if lutinHost.BUS_SIZE != 64: if host.BUS_SIZE != 64:
self.global_flags_cc.append("-m64") self.global_flags_cc.append("-m64")
else: else:
# 32 bits # 32 bits
if lutinHost.BUS_SIZE != 32: if host.BUS_SIZE != 32:
self.global_flags_cc.append("-m32") self.global_flags_cc.append("-m32")
def generate_list_separate_coma(self, list): def generate_list_separate_coma(self, list):

View File

@ -7,24 +7,24 @@
## @license APACHE v2.0 (see license file) ## @license APACHE v2.0 (see license file)
## ##
import lutinDebug as debug from lutin import debug
import lutinTarget from lutin import target
import lutinTools from lutin import tools
import lutinHost from lutin import host
import os import os
import stat import stat
class Target(lutinTarget.Target): class Target(target.Target):
def __init__(self, config): def __init__(self, config):
#processor type selection (auto/arm/ppc/x86) #processor type selection (auto/arm/ppc/x86)
if config["arch"] == "auto": if config["arch"] == "auto":
config["arch"] = "x86" config["arch"] = "x86"
#bus size selection (auto/32/64) #bus size selection (auto/32/64)
if config["bus-size"] == "auto": if config["bus-size"] == "auto":
config["bus-size"] = str(lutinHost.BUS_SIZE) config["bus-size"] = str(host.BUS_SIZE)
# http://biolpc22.york.ac.uk/pub/linux-mac-cross/ # http://biolpc22.york.ac.uk/pub/linux-mac-cross/
# http://devs.openttd.org/~truebrain/compile-farm/apple-darwin9.txt # http://devs.openttd.org/~truebrain/compile-farm/apple-darwin9.txt
lutinTarget.Target.__init__(self, "MacOs", config, "") target.Target.__init__(self, "MacOs", config, "")
self.folder_bin="/MacOS" self.folder_bin="/MacOS"
self.folder_lib="/lib" self.folder_lib="/lib"
@ -38,7 +38,7 @@ class Target(lutinTarget.Target):
def get_staging_folder(self, binaryName): def get_staging_folder(self, binaryName):
return lutinTools.get_run_folder() + self.folder_out + self.folder_staging + "/" + binaryName + ".app/Contents/" return tools.get_run_folder() + self.folder_out + self.folder_staging + "/" + binaryName + ".app/Contents/"
def get_staging_folder_data(self, binaryName): def get_staging_folder_data(self, binaryName):
return self.get_staging_folder(binaryName) + self.folder_data + "/" return self.get_staging_folder(binaryName) + self.folder_data + "/"
@ -50,7 +50,7 @@ class Target(lutinTarget.Target):
if "ICON" in pkgProperties.keys() \ if "ICON" in pkgProperties.keys() \
and pkgProperties["ICON"] != "": and pkgProperties["ICON"] != "":
lutinTools.copy_file(pkgProperties["ICON"], self.get_staging_folder_data(pkgName) + "/icon.icns", force=True) tools.copy_file(pkgProperties["ICON"], self.get_staging_folder_data(pkgName) + "/icon.icns", force=True)
# http://www.sandroid.org/imcross/#Deployment # http://www.sandroid.org/imcross/#Deployment
infoFile=self.get_staging_folder(pkgName) + "/Info.plist" infoFile=self.get_staging_folder(pkgName) + "/Info.plist"

View File

@ -7,16 +7,16 @@
## @license APACHE v2.0 (see license file) ## @license APACHE v2.0 (see license file)
## ##
import lutinDebug as debug from lutin import debug
import lutinTarget from lutin import target
import lutinTools as tools from lutin import tools
import lutinHost from lutin import host
import os import os
import stat import stat
import sys import sys
import lutinZip as zip from lutin import zip
class Target(lutinTarget.Target): class Target(target.Target):
def __init__(self, config): def __init__(self, config):
if config["compilator"] != "gcc": if config["compilator"] != "gcc":
debug.error("Windows does not support '" + config["compilator"] + "' compilator ... availlable : [gcc]") debug.error("Windows does not support '" + config["compilator"] + "' compilator ... availlable : [gcc]")
@ -27,14 +27,14 @@ class Target(lutinTarget.Target):
config["arch"] = "x86" config["arch"] = "x86"
#bus size selection (auto/32/64) #bus size selection (auto/32/64)
if config["bus-size"] == "auto": if config["bus-size"] == "auto":
config["bus-size"] = str(lutinHost.BUS_SIZE) config["bus-size"] = str(host.BUS_SIZE)
lutinTarget.Target.__init__(self, "Windows", config, "") target.Target.__init__(self, "Windows", config, "")
# on windows board the basic path is not correct # on windows board the basic path is not correct
# TODO : get external PATH for the minGW path # TODO : get external PATH for the minGW path
# TODO : Set the cyngwin path ... # TODO : Set the cyngwin path ...
if lutinHost.OS == "Windows": if host.OS == "Windows":
self.set_cross_base("c:\\MinGW\\bin\\") self.set_cross_base("c:\\MinGW\\bin\\")
sys.path.append("c:\\MinGW\\bin" ) sys.path.append("c:\\MinGW\\bin" )
os.environ['PATH'] += ";c:\\MinGW\\bin\\" os.environ['PATH'] += ";c:\\MinGW\\bin\\"

View File

@ -10,11 +10,11 @@
import os import os
import shutil import shutil
import errno import errno
from . import debug
import fnmatch import fnmatch
from . import multiprocess as lutinMultiprocess # Local import
from . import depend as dependency from . import debug
from . import depend
import multiprocess
""" """
@ -101,12 +101,12 @@ def copy_file(src, dst, cmd_file=None, force=False):
debug.error("Request a copy a file that does not existed : '" + src + "'") debug.error("Request a copy a file that does not existed : '" + src + "'")
cmd_line = "copy \"" + src + "\" \"" + dst + "\"" cmd_line = "copy \"" + src + "\" \"" + dst + "\""
if force == False \ if force == False \
and dependency.need_re_build(dst, src, file_cmd=cmd_file , cmdLine=cmd_line) == False: and depend.need_re_build(dst, src, file_cmd=cmd_file , cmdLine=cmd_line) == False:
return return
debug.print_element("copy file", src, "==>", dst) debug.print_element("copy file", src, "==>", dst)
create_directory_of_file(dst) create_directory_of_file(dst)
shutil.copyfile(src, dst) shutil.copyfile(src, dst)
lutinMultiprocess.store_command(cmd_line, cmd_file) multiprocess.store_command(cmd_line, cmd_file)
def copy_anything(src, dst): def copy_anything(src, dst):

View File

@ -9,7 +9,7 @@
import platform import platform
import os import os
import zipfile import zipfile
# Local import
from . import debug from . import debug
from . import tools from . import tools

View File

@ -1,13 +1,31 @@
#!/usr/bin/python #!/usr/bin/python
from setuptools import setup from setuptools import setup
def readme():
with open('README.rst') as f:
return f.read()
# https://pypi.python.org/pypi?%3Aaction=list_classifiers
setup(name='lutin', setup(name='lutin',
version='0.5.0', version='0.5.2',
description='Lutin generic builder', description='Lutin generic builder',
long_description=readme(),
url='http://github.com/HeeroYui/lutin', url='http://github.com/HeeroYui/lutin',
author='Edouard DUPIN', author='Edouard DUPIN',
author_email='yui.heero@gmail.com', author_email='yui.heero@gmail.com',
license='APACHE-2', license='APACHE-2',
packages=['lutin'], packages=['lutin',
'lutin/builder',
'lutin/system',
'lutin/target'
],
classifiers=[
'Development Status :: 3 - Alpha',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python',
'Topic :: Software Development :: Compilers',
],
keywords='builder c++ c android ios macos makefile cmake',
scripts=['bin/lutin'], scripts=['bin/lutin'],
include_package_data = True,
zip_safe=False) zip_safe=False)