diff --git a/lutin/env.py b/lutin/env.py
index 071f111..d280d56 100644
--- a/lutin/env.py
+++ b/lutin/env.py
@@ -81,7 +81,8 @@ def print_pretty(myString, force=False):
]
elif end_with(cmdApplication, ["jar"]) == True:
baseElementList = [
- "cf"
+ "cf",
+ "-C"
]
for element in baseElementList:
tmpcmdLine = tmpcmdLine.replace(element+'\n\t', element+' ')
diff --git a/lutin/module.py b/lutin/module.py
index b1cc20d..99a00bb 100644
--- a/lutin/module.py
+++ b/lutin/module.py
@@ -53,21 +53,7 @@ class Module:
self.flags = {"export":{},
"local":{}
}
- """
- self.export_flags_ld = []
- self.export_flags_cc = []
- self.export_flags_xx = []
- self.export_flags_m = []
- self.export_flags_mm = []
- # list of all flags:
- self.flags_ld = []
- self.flags_cc = []
- self.flags_xx = []
- self.flags_m = []
- self.flags_mm = []
- self.flags_s = []
- self.flags_ar = []
- """
+ self.extention_order_build = ["java", "javah"] # all is not set here is done in the provided order ...
# sources list:
self.src = []
# copy files and folders:
@@ -203,7 +189,6 @@ class Module:
else :
# TODO : Set it better ...
None
-
# build dependency before
list_sub_file_needed_to_build = []
self.sub_heritage_list = heritage.HeritageList()
@@ -224,9 +209,40 @@ class Module:
inherit_list = target.build(dep, package_name)
# add at the heritage list :
self.sub_heritage_list.add_heritage_list(inherit_list)
+ # do sub library action for automatic generating ...
+ if self.type in target.action_on_state:
+ for action in target.action_on_state[self.type]:
+ elem = action(target, self, package_name);
+
- # build local sources
- for file in self.src:
+
+ # build local sources in a specific order :
+ for extention_local in self.extention_order_build:
+ list_file = tools.filter_extention(self.src, [extention_local])
+ for file in list_file:
+ #debug.info(" " + self.name + " <== " + file);
+ fileExt = file.split(".")[-1]
+ try:
+ tmp_builder = builder.get_builder(fileExt);
+ resFile = tmp_builder.compile(file,
+ package_name,
+ target,
+ self.sub_heritage_list,
+ flags = self.flags,
+ path = self.path,
+ name = self.name,
+ basic_folder = self.origin_folder)
+ if resFile["action"] == "add":
+ list_sub_file_needed_to_build.append(resFile["file"])
+ elif resFile["action"] == "path":
+ self.add_path(resFile["path"], type='c')
+ else:
+ debug.error("an not do action for : " + str(resFile))
+ except ValueError:
+ debug.warning(" UN-SUPPORTED file format: '" + self.origin_folder + "/" + file + "'")
+ # now build the other :
+ list_file = tools.filter_extention(self.src, self.extention_order_build, invert=True)
+ for file in list_file:
#debug.info(" " + self.name + " <== " + file);
fileExt = file.split(".")[-1]
try:
@@ -239,7 +255,12 @@ class Module:
path = self.path,
name = self.name,
basic_folder = self.origin_folder)
- list_sub_file_needed_to_build.append(resFile)
+ if resFile["action"] == "add":
+ list_sub_file_needed_to_build.append(resFile["file"])
+ elif resFile["action"] == "path":
+ self.add_path(resFile["path"], type='c')
+ else:
+ debug.error("an not do action for : " + str(resFile))
except ValueError:
debug.warning(" UN-SUPPORTED file format: '" + self.origin_folder + "/" + file + "'")
# when multiprocess availlable, we need to synchronize here ...
@@ -274,7 +295,7 @@ class Module:
basic_folder = self.origin_folder)
self.local_heritage.add_sources(resFile)
except ValueError:
- debug.error(" UN-SUPPORTED link format: '.jat'")
+ debug.error(" UN-SUPPORTED link format: '.jar'")
elif self.type=='BINARY':
try:
tmp_builder = builder.get_builder_with_output("bin");
@@ -296,15 +317,27 @@ class Module:
try:
tmp_builder = builder.get_builder_with_output("so");
list_file = tools.filter_extention(list_sub_file_needed_to_build, tmp_builder.get_input_type())
- debug.info("plopppp " + str(list_file))
resFile = tmp_builder.link(list_file,
package_name,
target,
self.sub_heritage_list,
- name = "libewol",
+ name = "lib" + self.name,
basic_folder = self.origin_folder)
except ValueError:
debug.error(" UN-SUPPORTED link format: '.so'")
+ try:
+ tmp_builder = builder.get_builder_with_output("jar");
+ list_file = tools.filter_extention(list_sub_file_needed_to_build, tmp_builder.get_input_type())
+ if len(list_file) > 0:
+ resFile = tmp_builder.link(list_file,
+ package_name,
+ target,
+ self.sub_heritage_list,
+ name = self.name,
+ basic_folder = self.origin_folder)
+ self.local_heritage.add_sources(resFile)
+ except ValueError:
+ debug.error(" UN-SUPPORTED link format: '.jar'")
else:
try:
tmp_builder = builder.get_builder_with_output("bin");
diff --git a/lutin/target.py b/lutin/target.py
index 3c9ae31..f61fa98 100644
--- a/lutin/target.py
+++ b/lutin/target.py
@@ -82,6 +82,7 @@ class Target:
self.suffix_binary=''
self.suffix_package='.deb'
+ self.folder_generate_code="/generate_header"
self.folder_arch="/" + self.name
if "debug" == self.config["mode"]:
@@ -111,6 +112,8 @@ class Target:
self.listFinalFile=[]
self.sysroot=""
+
+ self.action_on_state={}
def update_folder_tree(self):
self.folder_out="/out/" + self.name + "_" + self.config["arch"] + "_" + self.config["bus-size"] + "/" + self.config["mode"]
@@ -210,9 +213,15 @@ class Target:
def get_full_name_source(self, basePath, file):
+ if file[0] == '/':
+ if tools.os.path.isfile(file):
+ return file
return basePath + "/" + file
def get_full_name_cmd(self, moduleName, basePath, file):
+ if file[0] == '/':
+ if tools.os.path.isfile(file):
+ return file + self.suffix_cmdLine
return self.get_build_folder(moduleName) + "/" + file + self.suffix_cmdLine
def get_full_name_destination(self, moduleName, basePath, file, suffix, remove_suffix=False):
@@ -302,6 +311,12 @@ class Target:
debug.debug("Add nodule for Taget : " + newModule.name)
self.moduleList.append(newModule)
+ def get_module(self, name):
+ for mod in self.buildDone:
+ if mod.name == name:
+ return mod
+ debug.error("the module '" + str(name) + "'does not exist/already build")
+ return None
# return inherit packages ...
"""
@@ -425,6 +440,12 @@ class Target:
debug.debug("build module '" + moduleName + "'")
return mod.build(self, None)
debug.error("not know module name : '" + moduleName + "' to '" + actionName + "' it")
+
+ def add_action(self, name_of_state="PACKAGE", action=None):
+ if name_of_state not in self.action_on_state:
+ self.action_on_state[name_of_state] = [action]
+ else:
+ self.action_on_state[name_of_state].append(action)
targetList=[]
diff --git a/lutin/tools.py b/lutin/tools.py
index 133b896..d558cf7 100644
--- a/lutin/tools.py
+++ b/lutin/tools.py
@@ -146,13 +146,35 @@ def copy_anything_target(target, src, dst):
target.add_file_staging(root+"/"+cycleFile, newDst+cycleFile)
-def filter_extention(list_files, extentions):
+def filter_extention(list_files, extentions, invert=False):
out = []
- for ext in extentions:
- for file in list_files:
+ for file in list_files:
+ in_list = False
+ for ext in extentions:
if file[-len(ext):] == ext:
- out.append(file)
+ in_list = True
+ if in_list == True \
+ and invert == False:
+ out.append(file)
+ elif in_list == False \
+ and invert == True:
+ out.append(file)
return out
+def move_if_needed(src, dst):
+ if not os.path.isfile(src):
+ debug.error("request move if needed, but file does not exist: '" + str(src) + "' to '" + str(dst) + "'")
+ return
+ src_data = file_read_data(src)
+ if os.path.isfile(dst):
+ # file exist ==> must check ...
+ dst_data = file_read_data(dst)
+ if src_data == dst_data:
+ # nothing to do ...
+ return
+ file_write_data(dst, src_data)
+ remove_file(src)
+
+
diff --git a/lutin/z_builder/lutinBuilder_c.py b/lutin/z_builder/lutinBuilder_c.py
index 5412b6e..fafd70c 100644
--- a/lutin/z_builder/lutinBuilder_c.py
+++ b/lutin/z_builder/lutinBuilder_c.py
@@ -87,12 +87,12 @@ def compile(file, binary, target, depancy, flags, path, name, basic_folder):
cmdLine=tools.list_to_str(cmd)
# check the dependency for this file :
if depend.need_re_build(file_dst, file_src, file_depend, file_cmd, cmdLine) == False:
- return file_dst
+ return {"action":"add", "file":file_dst}
tools.create_directory_of_file(file_dst)
comment = ["c", name, "<==", file]
# process element
multiprocess.run_in_pool(cmdLine, comment, file_cmd)
- return file_dst
+ return {"action":"add", "file":file_dst}
def get_version_compilation_flags(flags, dependency_flags):
diff --git a/lutin/z_builder/lutinBuilder_cpp.py b/lutin/z_builder/lutinBuilder_cpp.py
index 4239e06..bfaeb81 100644
--- a/lutin/z_builder/lutinBuilder_cpp.py
+++ b/lutin/z_builder/lutinBuilder_cpp.py
@@ -94,12 +94,12 @@ def compile(file, binary, target, depancy, flags, path, name, basic_folder):
# check the dependency for this file :
if depend.need_re_build(file_dst, file_src, file_depend, file_cmd, cmdLine) == False:
- return file_dst
+ return {"action":"add", "file":file_dst}
tools.create_directory_of_file(file_dst)
comment = ["c++", name, "<==", file]
#process element
multiprocess.run_in_pool(cmdLine, comment, file_cmd)
- return file_dst
+ return {"action":"add", "file":file_dst}
def get_version_compilation_flags(flags, dependency_flags):
try:
diff --git a/lutin/z_builder/lutinBuilder_jar.py b/lutin/z_builder/lutinBuilder_jar.py
index 93665fd..4ad4d3d 100644
--- a/lutin/z_builder/lutinBuilder_jar.py
+++ b/lutin/z_builder/lutinBuilder_jar.py
@@ -43,12 +43,18 @@ def link(file, binary, target, depancy, name, basic_folder):
#create command Line
cmd = [
target.jar,
- "cf", file_dst
+ "cf", file_dst,
]
- try:
- cmd.append(file_src)
- except:
- pass
+ for file in file_src:
+ path = ""
+ for elem in ["org/", "com/"]:
+ pos = file.find(elem);
+ if pos > 0:
+ path = file[:pos]
+ file = file[pos:]
+ cmd.append("-C")
+ cmd.append(path)
+ cmd.append(file)
cmdLine=tools.list_to_str(cmd)
"""
# check the dependency for this file :
diff --git a/lutin/z_builder/lutinBuilder_java.py b/lutin/z_builder/lutinBuilder_java.py
index d7d8e36..1df0888 100644
--- a/lutin/z_builder/lutinBuilder_java.py
+++ b/lutin/z_builder/lutinBuilder_java.py
@@ -65,19 +65,31 @@ def compile(file, binary, target, depancy, flags, path, name, basic_folder):
out += ":"
out += elem
cmd.append(out)
-
- # dependency : + "-classpath " + self.folder_sdk + "/platforms/android-" + str(self.boardId) + "/android.jar" \
- cmd.append("-classpath " + target.folder_sdk + "/platforms/android-" + str(target.boardId) + "/android.jar")
+ # todo : Remplace this with class_extern = [] and add a dependency with android framework ...
+ class_extern = [target.folder_sdk + "/platforms/android-" + str(target.boardId) + "/android.jar"]
+ upper_jar = tools.filter_extention(depancy.src, ["jar"])
+ #debug.warning("ploppppp = " + str(upper_jar))
+ for elem in upper_jar:
+ class_extern.append(elem)
+ if len(class_extern) > 0:
+ cmd.append("-classpath")
+ out = ""
+ for elem in class_extern:
+ if len(out) > 0:
+ out += ":"
+ out += elem
+ cmd.append(out)
+
cmd.append(file_src)
# Create cmd line
cmdLine=tools.list_to_str(cmd)
# check the dependency for this file :
if depend.need_re_build(file_dst, file_src, file_depend, file_cmd, cmdLine) == False:
- return file_dst
+ return {"action":"add", "file":file_dst}
tools.create_directory_of_file(file_dst)
comment = ["java", name, "<==", file]
#process element
multiprocess.run_in_pool(cmdLine, comment, file_cmd)
- return file_dst
+ return {"action":"add", "file":file_dst}
diff --git a/lutin/z_builder/lutinBuilder_javah.py b/lutin/z_builder/lutinBuilder_javah.py
index 27a116e..7376397 100644
--- a/lutin/z_builder/lutinBuilder_javah.py
+++ b/lutin/z_builder/lutinBuilder_javah.py
@@ -46,26 +46,28 @@ def compile(file, binary, target, depancy, flags, path, name, basic_folder):
# create the command line befor requesting start:
cmd = [
target.javah,
- "-d", target.get_build_folder(name) + "/tmp_header"
+ "-d", target.get_build_folder(name) + target.folder_generate_code
]
- if debug.get_level() >= 4:
+ if debug.get_level() >= 5:
cmd.append("-verbose")
cmd.append("-classpath")
cmd.append(target.get_build_folder(name))
- file = file[:-5]
- cmd.append(file)
+ class_to_build = file[:-6]
+ cmd.append(class_to_build)
# Create cmd line
cmdLine=tools.list_to_str(cmd)
+ file_dst = target.get_build_folder(name) + "/tmp_header/" + class_to_build.replace(".", "_") + ".h"
# check the dependency for this file :
#if depend.need_re_build(file_dst, file_src, file_depend, file_cmd, cmdLine) == False:
# return file_dst
#tools.create_directory_of_file(file_dst)
- comment = ["javah", name, "<==", file]
+ comment = ["javah", class_to_build.replace(".", "_") + ".h", "<==", class_to_build]
#process element
multiprocess.run_in_pool(cmdLine, comment, file_cmd)
+ debug.verbose("file= " + file_dst)
#return file_dst
- return None
+ return {"action":"path", "path":target.get_build_folder(name) + target.folder_generate_code}
diff --git a/lutin/z_builder/lutinBuilder_m.py b/lutin/z_builder/lutinBuilder_m.py
index 02946f1..172fc75 100644
--- a/lutin/z_builder/lutinBuilder_m.py
+++ b/lutin/z_builder/lutinBuilder_m.py
@@ -94,10 +94,10 @@ def compile(file, binary, target, depancy, flags, path, name, basic_folder):
cmdLine=tools.list_to_str(cmd)
# check the dependency for this file :
if False==depend.need_re_build(file_dst, file_src, file_depend, file_cmd, cmdLine):
- return file_dst
+ return {"action":"add", "file":file_dst}
tools.create_directory_of_file(file_dst)
comment = ["m", name, "<==", file]
#process element
multiprocess.run_in_pool(cmdLine, comment, file_cmd)
- return file_dst
+ return {"action":"add", "file":file_dst}
diff --git a/lutin/z_builder/lutinBuilder_mm.py b/lutin/z_builder/lutinBuilder_mm.py
index e23ba1e..5548f09 100644
--- a/lutin/z_builder/lutinBuilder_mm.py
+++ b/lutin/z_builder/lutinBuilder_mm.py
@@ -94,9 +94,9 @@ def compile(file, binary, target, depancy, flags, path, name, basic_folder):
cmdLine=tools.list_to_str(cmd)
# check the dependency for this file :
if False==depend.need_re_build(file_dst, file_src, file_depend, file_cmd, cmdLine):
- return file_dst
+ return {"action":"add", "file":file_dst}
tools.create_directory_of_file(file_dst)
comment = ["m++", name, "<==", file]
#process element
multiprocess.run_in_pool(cmdLine, comment, file_cmd)
- return file_dst
+ return {"action":"add", "file":file_dst}
diff --git a/lutin/z_target/lutinTarget_Android.py b/lutin/z_target/lutinTarget_Android.py
index 61056d4..75493fb 100644
--- a/lutin/z_target/lutinTarget_Android.py
+++ b/lutin/z_target/lutinTarget_Android.py
@@ -220,115 +220,7 @@ class Target(target.Target):
# Create folder :
tools.create_directory_of_file(self.file_finalAbstraction)
# Create file :
- tmpFile = open(self.file_finalAbstraction, 'w')
- if pkgProperties["ANDROID_APPL_TYPE"]=="APPL":
- tmpFile.write( "/**\n")
- tmpFile.write( " * @author Edouard DUPIN, Kevin BILLONNEAU\n")
- tmpFile.write( " * @copyright 2011, Edouard DUPIN, all right reserved\n")
- tmpFile.write( " * @license APACHE v2.0 (see license file)\n")
- tmpFile.write( " * @note This file is autogenerate ==> see documantation to generate your own\n")
- tmpFile.write( " */\n")
- tmpFile.write( "package "+ compleatePackageName + ";\n")
- tmpFile.write( "import org.ewol.EwolActivity;\n")
- if "ADMOD_ID" in pkgProperties:
- tmpFile.write( "import com.google.android.gms.ads.AdRequest;\n")
- tmpFile.write( "import com.google.android.gms.ads.AdSize;\n")
- tmpFile.write( "import com.google.android.gms.ads.AdView;\n")
- tmpFile.write( "import android.widget.LinearLayout;\n")
- tmpFile.write( "import android.widget.Button;\n")
- tmpFile.write( "public class " + pkgNameApplicationName + " extends EwolActivity {\n")
- if "ADMOD_ID" in pkgProperties:
- tmpFile.write( " /** The view to show the ad. */\n")
- tmpFile.write( " private AdView adView;\n")
- tmpFile.write( " private LinearLayout mLayout = null;\n")
- tmpFile.write( " public void onCreate(android.os.Bundle savedInstanceState) {\n")
- tmpFile.write( " super.onCreate(savedInstanceState);\n")
- tmpFile.write( " initApkPath(\"" + pkgProperties["COMPAGNY_TYPE"]+"\", \""+pkgProperties["COMPAGNY_NAME2"]+"\", \"" + pkgNameApplicationName + "\");\n")
- if "ADMOD_ID" in pkgProperties:
- tmpFile.write( " mLayout = new LinearLayout(this);\n")
- tmpFile.write( " mLayout.setOrientation(android.widget.LinearLayout.VERTICAL);\n")
- tmpFile.write( " LinearLayout.LayoutParams paramsWindows = new LinearLayout.LayoutParams(\n")
- tmpFile.write( " LinearLayout.LayoutParams.FILL_PARENT,\n")
- tmpFile.write( " LinearLayout.LayoutParams.FILL_PARENT);\n")
- tmpFile.write( " \n")
- tmpFile.write( " setContentView(mLayout, paramsWindows);\n")
- tmpFile.write( " \n")
- tmpFile.write( " LinearLayout.LayoutParams paramsAdds = new LinearLayout.LayoutParams(\n")
- tmpFile.write( " LinearLayout.LayoutParams.FILL_PARENT,\n")
- tmpFile.write( " LinearLayout.LayoutParams.WRAP_CONTENT);\n")
- tmpFile.write( " paramsAdds.weight = 0;\n")
- tmpFile.write( " \n")
- tmpFile.write( " LinearLayout.LayoutParams paramsGLView = new LinearLayout.LayoutParams(\n")
- tmpFile.write( " LinearLayout.LayoutParams.FILL_PARENT,\n")
- tmpFile.write( " LinearLayout.LayoutParams.FILL_PARENT);\n")
- tmpFile.write( " paramsGLView.weight = 1;\n")
- tmpFile.write( " paramsGLView.height = 0;\n")
- tmpFile.write( " \n")
- tmpFile.write( " mLayout.setGravity(android.view.Gravity.TOP);\n")
- tmpFile.write( " \n")
- tmpFile.write( " // Create an adds.\n")
- tmpFile.write( " adView = new AdView(this);\n")
- tmpFile.write( " adView.setAdSize(AdSize.SMART_BANNER);\n")
- tmpFile.write( " adView.setAdUnitId(\"" + pkgProperties["ADMOD_ID"] + "\");\n")
- tmpFile.write( " \n")
- tmpFile.write( " // Create an ad request. Check logcat output for the hashed device ID to get test ads on a physical device.\n")
- tmpFile.write( " AdRequest adRequest = new AdRequest.Builder()\n")
- tmpFile.write( " .addTestDevice(AdRequest.DEVICE_ID_EMULATOR)\n")
- tmpFile.write( " .build();\n")
- tmpFile.write( " \n")
- tmpFile.write( " // Add the AdView to the view hierarchy. The view will have no size until the ad is loaded.\n")
- if "ADMOD_POSITION" in pkgProperties.keys() \
- and pkgProperties["ADMOD_POSITION"] == "top":
- tmpFile.write( " mLayout.addView(adView, paramsAdds);\n")
- tmpFile.write( " mLayout.addView(mGLView, paramsGLView);\n")
- else:
- tmpFile.write( " mLayout.addView(mGLView, paramsGLView);\n")
- tmpFile.write( " mLayout.addView(adView, paramsAdds);\n")
- tmpFile.write( " \n")
- tmpFile.write( " // Start loading the ad in the background.\n")
- tmpFile.write( " adView.loadAd(adRequest);\n")
- tmpFile.write( " }\n")
- if "ADMOD_ID" in pkgProperties:
- tmpFile.write( " @Override protected void onResume() {\n")
- tmpFile.write( " super.onResume();\n")
- tmpFile.write( " if (adView != null) {\n")
- tmpFile.write( " adView.resume();\n")
- tmpFile.write( " }\n")
- tmpFile.write( " }\n")
- tmpFile.write( " @Override protected void onPause() {\n")
- tmpFile.write( " if (adView != null) {\n")
- tmpFile.write( " adView.pause();\n")
- tmpFile.write( " }\n")
- tmpFile.write( " super.onPause();\n")
- tmpFile.write( " }\n")
- tmpFile.write( " @Override protected void onDestroy() {\n")
- tmpFile.write( " // Destroy the AdView.\n")
- tmpFile.write( " if (adView != null) {\n")
- tmpFile.write( " adView.destroy();\n")
- tmpFile.write( " }\n")
- tmpFile.write( " super.onDestroy();\n")
- tmpFile.write( " }\n")
- tmpFile.write( "}\n")
- else :
- # wallpaper mode ...
- tmpFile.write( "/**\n")
- tmpFile.write( " * @author Edouard DUPIN, Kevin BILLONNEAU\n")
- tmpFile.write( " * @copyright 2011, Edouard DUPIN, all right reserved\n")
- tmpFile.write( " * @license APACHE v2.0 (see license file)\n")
- tmpFile.write( " * @note This file is autogenerate ==> see documantation to generate your own\n")
- tmpFile.write( " */\n")
- tmpFile.write( "package "+ compleatePackageName + ";\n")
- tmpFile.write( "import org.ewol.EwolWallpaper;\n")
- tmpFile.write( "public class " + pkgNameApplicationName + " extends EwolWallpaper {\n")
- tmpFile.write( " public static final String SHARED_PREFS_NAME = \"" + pkgNameApplicationName + "settings\";\n")
- tmpFile.write( " public Engine onCreateEngine() {\n")
- tmpFile.write( " Engine tmpEngine = super.onCreateEngine();\n")
- tmpFile.write( " initApkPath(\"" + pkgProperties["COMPAGNY_TYPE"]+"\", \""+pkgProperties["COMPAGNY_NAME2"]+"\", \"" + pkgNameApplicationName + "\");\n")
- tmpFile.write( " return tmpEngine;\n")
- tmpFile.write( " }\n")
- tmpFile.write( "}\n")
- tmpFile.flush()
- tmpFile.close()
+ # 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_folder(pkgName) + "/res/drawable/icon.png");
if "ICON" in pkgProperties.keys() \
@@ -345,222 +237,7 @@ class Target(target.Target):
debug.print_element("pkg", "AndroidManifest.xml", "<==", pkgProperties["ANDROID_MANIFEST"])
tools.copy_file(pkgProperties["ANDROID_MANIFEST"], self.get_staging_folder(pkgName) + "/AndroidManifest.xml", force=True)
else:
- if "VERSION_CODE" not in pkgProperties:
- pkgProperties["VERSION_CODE"] = "1"
- debug.print_element("pkg", "AndroidManifest.xml", "<==", "package configurations")
- tmpFile = open(self.get_staging_folder(pkgName) + "/AndroidManifest.xml", 'w')
- tmpFile.write( '\n')
- tmpFile.write( '\n')
- tmpFile.write( ' \n')
- tmpFile.write( ' \n')
- tmpFile.write( ' \n')
- if pkgProperties["ANDROID_APPL_TYPE"]=="APPL":
- tmpFile.write( ' \n')
- if "ADMOD_ID" in pkgProperties:
- tmpFile.write( ' \n')
-
- tmpFile.write( ' \n')
- tmpFile.write( ' \n')
- tmpFile.write( ' \n')
- tmpFile.write( ' \n')
- tmpFile.write( ' \n')
- tmpFile.write( ' \n')
- if "ADMOD_ID" in pkgProperties:
- tmpFile.write( ' \n')
-
- tmpFile.write( ' \n')
- else:
- tmpFile.write( ' \n')
- tmpFile.write( ' \n')
- tmpFile.write( ' \n')
- tmpFile.write( ' \n')
- tmpFile.write( ' \n')
- tmpFile.write( ' \n')
- tmpFile.write( ' \n')
- if len(pkgProperties["ANDROID_WALLPAPER_PROPERTIES"])!=0:
- tmpFile.write( ' \n')
- tmpFile.write( ' \n')
- tmpFile.write( ' \n')
- # write package autorisations :
- if True==self.check_right_package(pkgProperties, "WRITE_EXTERNAL_STORAGE"):
- tmpFile.write( ' \n')
- tmpFile.write( ' \n')
- if True==self.check_right_package(pkgProperties, "CAMERA"):
- tmpFile.write( ' \n')
- tmpFile.write( ' \n')
- if True==self.check_right_package(pkgProperties, "INTERNET"):
- tmpFile.write( ' \n')
- tmpFile.write( ' \n')
- if True==self.check_right_package(pkgProperties, "ACCESS_NETWORK_STATE"):
- tmpFile.write( ' \n')
- tmpFile.write( ' \n')
- if True==self.check_right_package(pkgProperties, "MODIFY_AUDIO_SETTINGS"):
- tmpFile.write( ' \n')
- tmpFile.write( ' \n')
- if True==self.check_right_package(pkgProperties, "READ_CALENDAR"):
- tmpFile.write( ' \n')
- tmpFile.write( ' \n')
- if True==self.check_right_package(pkgProperties, "READ_CONTACTS"):
- tmpFile.write( ' \n')
- tmpFile.write( ' \n')
- if True==self.check_right_package(pkgProperties, "READ_FRAME_BUFFER"):
- tmpFile.write( ' \n')
- tmpFile.write( ' \n')
- if True==self.check_right_package(pkgProperties, "READ_PROFILE"):
- tmpFile.write( ' \n')
- tmpFile.write( ' \n')
- if True==self.check_right_package(pkgProperties, "RECORD_AUDIO"):
- tmpFile.write( ' \n')
- tmpFile.write( ' \n')
- if True==self.check_right_package(pkgProperties, "SET_ORIENTATION"):
- tmpFile.write( ' \n')
- tmpFile.write( ' \n')
- if True==self.check_right_package(pkgProperties, "VIBRATE"):
- tmpFile.write( ' \n')
- tmpFile.write( ' \n')
- if True==self.check_right_package(pkgProperties, "ACCESS_COARSE_LOCATION"):
- tmpFile.write( ' \n')
- tmpFile.write( ' \n')
- if True==self.check_right_package(pkgProperties, "ACCESS_FINE_LOCATION"):
- tmpFile.write( ' \n')
- tmpFile.write( ' \n')
- tmpFile.write( '\n\n')
- tmpFile.flush()
- tmpFile.close()
- # end generating android manifest
-
- if pkgProperties["ANDROID_APPL_TYPE"]!="APPL":
- #create the Wallpaper sub files : (main element for the application
- debug.print_element("pkg", pkgNameApplicationName + "_resource.xml", "<==", "package configurations")
- tools.create_directory_of_file(self.get_staging_folder(pkgName) + "/res/xml/" + pkgNameApplicationName + "_resource.xml")
- tmpFile = open(self.get_staging_folder(pkgName) + "/res/xml/" + pkgNameApplicationName + "_resource.xml", 'w')
- tmpFile.write( "\n")
- tmpFile.write( "\n")
- tmpFile.flush()
- tmpFile.close()
- # create wallpaper setting if needed (class and config file)
- if len(pkgProperties["ANDROID_WALLPAPER_PROPERTIES"])!=0:
- tools.create_directory_of_file(self.folder_javaProject + pkgNameApplicationName + "Settings.java")
- debug.print_element("pkg", self.folder_javaProject + pkgNameApplicationName + "Settings.java", "<==", "package configurations")
- tmpFile = open(self.folder_javaProject + pkgNameApplicationName + "Settings.java", 'w');
- tmpFile.write( "package " + compleatePackageName + ";\n")
- tmpFile.write( "\n")
- tmpFile.write( "import " + compleatePackageName + ".R;\n")
- tmpFile.write( "\n")
- tmpFile.write( "import android.content.SharedPreferences;\n")
- tmpFile.write( "import android.os.Bundle;\n")
- tmpFile.write( "import android.preference.PreferenceActivity;\n")
- tmpFile.write( "\n")
- tmpFile.write( "public class " + pkgNameApplicationName + "Settings extends PreferenceActivity implements SharedPreferences.OnSharedPreferenceChangeListener\n")
- tmpFile.write( "{\n")
- tmpFile.write( " @Override protected void onCreate(Bundle icicle) {\n")
- tmpFile.write( " super.onCreate(icicle);\n")
- tmpFile.write( " getPreferenceManager().setSharedPreferencesName("+ pkgNameApplicationName + ".SHARED_PREFS_NAME);\n")
- tmpFile.write( " addPreferencesFromResource(R.xml."+ pkgNameApplicationName + "_settings);\n")
- tmpFile.write( " getPreferenceManager().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);\n")
- tmpFile.write( " }\n")
- tmpFile.write( " @Override protected void onResume() {\n")
- tmpFile.write( " super.onResume();\n")
- tmpFile.write( " }\n")
- tmpFile.write( " @Override protected void onDestroy() {\n")
- tmpFile.write( " getPreferenceManager().getSharedPreferences().unregisterOnSharedPreferenceChangeListener(this);\n")
- tmpFile.write( " super.onDestroy();\n")
- tmpFile.write( " }\n")
- tmpFile.write( " public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,String key) { }\n")
- tmpFile.write( "}\n")
- tmpFile.flush()
- tmpFile.close()
-
- debug.print_element("pkg", self.get_staging_folder(pkgName) + "/res/xml/" + pkgNameApplicationName + "_settings.xml", "<==", "package configurations")
- tools.create_directory_of_file(self.get_staging_folder(pkgName) + "/res/xml/" + pkgNameApplicationName + "_settings.xml")
- tmpFile = open(self.get_staging_folder(pkgName) + "/res/xml/" + pkgNameApplicationName + "_settings.xml", 'w');
- tmpFile.write( "\n")
- tmpFile.write( "\n")
- WALL_haveArray = False
- for WALL_type, WALL_key, WALL_title, WALL_summary, WALL_other in pkgProperties["ANDROID_WALLPAPER_PROPERTIES"]:
- debug.info("find : '" + WALL_type + "'");
- if WALL_type == "list":
- debug.info(" create : LIST");
- tmpFile.write( " \n")
- WALL_haveArray=True
- elif WALL_type == "bool":
- debug.info(" create : CHECKBOX");
- tmpFile.write( " \n")
- tmpFile.write( "\n")
- tmpFile.flush()
- tmpFile.close()
- if WALL_haveArray==True:
- for WALL_type, WALL_key, WALL_title, WALL_summary, WALL_other in pkgProperties["ANDROID_WALLPAPER_PROPERTIES"]:
- if WALL_type == "list":
- debug.print_element("pkg", self.get_staging_folder(pkgName) + "/res/values/" + WALL_key + ".xml", "<==", "package configurations")
- tools.create_directory_of_file(self.get_staging_folder(pkgName) + "/res/values/" + WALL_key + ".xml")
- tmpFile = open(self.get_staging_folder(pkgName) + "/res/values/" + WALL_key + ".xml", 'w');
- tmpFile.write( "\n")
- tmpFile.write( "\n")
- tmpFile.write( " \n")
- for WALL_subKey, WALL_display in WALL_other:
- tmpFile.write( " - " + WALL_display + "
\n")
- tmpFile.write( " \n")
- tmpFile.write( " \n")
- for WALL_subKey, WALL_display in WALL_other:
- tmpFile.write( " - " + WALL_subKey + "
\n")
- tmpFile.write( " \n")
- tmpFile.write( "\n")
- tmpFile.flush()
- tmpFile.close()
-
+ debug.error("missing parameter 'ANDROID_MANIFEST' in the properties ... ")
#add properties on wallpaper :
# myModule.pkg_add("ANDROID_WALLPAPER_PROPERTIES", ["list", key, title, summary, [["key","value display"],["key2","value display 2"]])
@@ -608,14 +285,7 @@ class Target(target.Target):
filesString=""
for element in pkgProperties["ANDROID_JAVA_FILES"]:
if element=="DEFAULT":
- filesString += self.folder_ewol + "/android/src/org/ewol/EwolAudioTask.java "
- filesString += self.folder_ewol + "/android/src/org/ewol/EwolCallback.java "
- filesString += self.folder_ewol + "/android/src/org/ewol/EwolConstants.java "
- filesString += self.folder_ewol + "/android/src/org/ewol/Ewol.java "
- filesString += self.folder_ewol + "/android/src/org/ewol/EwolRendererGL.java "
- filesString += self.folder_ewol + "/android/src/org/ewol/EwolSurfaceViewGL.java "
- filesString += self.folder_ewol + "/android/src/org/ewol/EwolActivity.java "
- filesString += self.folder_ewol + "/android/src/org/ewol/EwolWallpaper.java "
+ # this is deprecated ...
else:
filesString += element + " "