diff --git a/lutin.py b/lutin.py
index 5fec246..29bca04 100755
--- a/lutin.py
+++ b/lutin.py
@@ -26,6 +26,7 @@ myLutinArg.add(lutinArg.ArgDefine("c", "compilator", list=[["clang",""],["gcc","
myLutinArg.add(lutinArg.ArgDefine("m", "mode", list=[["debug",""],["release",""]], desc="Compile in release or debug mode (default release)"))
myLutinArg.add(lutinArg.ArgDefine("r", "prj", desc="Use external project management (not build with lutin..."))
myLutinArg.add(lutinArg.ArgDefine("p", "package", desc="Disable the package generation (usefull when just compile for test on linux ...)"))
+myLutinArg.add(lutinArg.ArgDefine("", "simulation", desc="simulater mode (availlable only for IOS)"))
myLutinArg.add_section("cible", "generate in order set")
localArgument = myLutinArg.parse()
@@ -107,6 +108,7 @@ def Start():
generatePackage=True
# load the default target :
target = None
+ simulationMode=False
actionDone=False
#build with extern tool
externBuild=False
@@ -116,6 +118,8 @@ def Start():
continue
elif argument.get_option_nName() == "package":
generatePackage=False
+ elif argument.get_option_nName() == "simulation":
+ simulationMode=True
elif argument.get_option_nName() == "prj":
externBuild=True
elif argument.get_option_nName() == "compilator":
@@ -133,6 +137,7 @@ def Start():
compilator="gcc"
mode="release"
generatePackage=True
+ simulationMode=False
#remove previous target
target = None
elif argument.get_option_nName() == "mode":
@@ -148,14 +153,14 @@ def Start():
else:
#load the target if needed :
if target == None:
- target = lutinTarget.target_load(targetName, compilator, mode, generatePackage, externBuild)
+ target = lutinTarget.target_load(targetName, compilator, mode, generatePackage, externBuild, simulationMode)
target.build(argument.get_arg())
actionDone=True
# if no action done : we do "all" ...
if actionDone==False:
#load the target if needed :
if target == None:
- target = lutinTarget.target_load(targetName, compilator, mode, generatePackage, externBuild)
+ target = lutinTarget.target_load(targetName, compilator, mode, generatePackage, externBuild, simulationMode)
target.build("all")
# stop all started threads
lutinMultiprocess.un_init()
diff --git a/lutinArg.py b/lutinArg.py
index 8333144..85669c4 100644
--- a/lutinArg.py
+++ b/lutinArg.py
@@ -66,7 +66,7 @@ class ArgDefine:
print(" -" + self.m_optionSmall + " / --" + self.m_optionBig)
elif self.m_optionSmall != "":
print(" -" + self.m_optionSmall)
- elif self.m_optionSmall != "":
+ elif self.m_optionBig != "":
print(" --" + self.m_optionBig)
else:
print(" ???? ==> internal error ...")
diff --git a/lutinModule.py b/lutinModule.py
index e673774..ec23ccc 100644
--- a/lutinModule.py
+++ b/lutinModule.py
@@ -682,6 +682,8 @@ class Module:
self.packageProp[variable] = value
elif "ADMOD_ID" == variable:
self.packageProp[variable] = value
+ elif "APPLE_APPLICATION_IOS_ID" == variable:
+ self.packageProp[variable] = value
else:
debug.error("not know pak element : '" + variable + "'")
diff --git a/lutinTarget.py b/lutinTarget.py
index 36a6674..db81242 100644
--- a/lutinTarget.py
+++ b/lutinTarget.py
@@ -5,11 +5,12 @@ import lutinTools
import lutinModule
class Target:
- def __init__(self, name, typeCompilator, debugMode, generatePackage, arch, cross):
+ def __init__(self, name, typeCompilator, debugMode, generatePackage, arch, cross, sumulator=False):
if arch != "":
self.arch = "-arch " + arch
else:
self.arch = ""
+ self.sumulator = sumulator
self.cross = cross
self.name=name
self.endGeneratePackage = generatePackage
@@ -299,10 +300,10 @@ class Target:
__startTargetName="lutinTarget"
-def target_load(targetName, compilator, mode, generatePackage, externBuild):
+def target_load(targetName, compilator, mode, generatePackage, externBuild, simulationMode):
theTarget = __import__(__startTargetName + targetName)
#try:
- tmpTarget = theTarget.Target(compilator, mode, generatePackage)
+ tmpTarget = theTarget.Target(compilator, mode, generatePackage, simulationMode)
tmpTarget.set_use_of_extern_build_tool(externBuild)
return tmpTarget
#except:
diff --git a/lutinTargetAndroid.py b/lutinTargetAndroid.py
index 2aa9b41..6756004 100644
--- a/lutinTargetAndroid.py
+++ b/lutinTargetAndroid.py
@@ -9,7 +9,7 @@ import os
import sys
class Target(lutinTarget.Target):
- def __init__(self, typeCompilator, debugMode, generatePackage):
+ def __init__(self, typeCompilator, debugMode, generatePackage, sumulator=False):
self.folder_ndk = os.getenv('PROJECT_NDK', "AUTO")
self.folder_sdk = os.getenv('PROJECT_SDK', "AUTO")
@@ -49,7 +49,7 @@ class Target(lutinTarget.Target):
if not os.path.isdir(baseFolderX86):
debug.info("Gcc x86 pah does not exist !!!")
- lutinTarget.Target.__init__(self, "Android", typeCompilator, debugMode, generatePackage, arch, cross)
+ lutinTarget.Target.__init__(self, "Android", typeCompilator, debugMode, generatePackage, arch, cross, sumulator)
# for gcc :
diff --git a/lutinTargetIOs.py b/lutinTargetIOs.py
index 43fcc54..8f0a7b1 100644
--- a/lutinTargetIOs.py
+++ b/lutinTargetIOs.py
@@ -7,16 +7,22 @@ import stat
import lutinExtProjectGeneratorXCode
import lutinMultiprocess
import random
+import re
class Target(lutinTarget.Target):
- def __init__(self, typeCompilator, debugMode, generatePackage):
- cross = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/"
+ def __init__(self, typeCompilator, debugMode, generatePackage, sumulator=False):
if typeCompilator == "gcc":
debug.info("compile only with clang for IOs");
typeCompilator = "clang"
# http://biolpc22.york.ac.uk/pub/linux-mac-cross/
# http://devs.openttd.org/~truebrain/compile-farm/apple-darwin9.txt
- lutinTarget.Target.__init__(self, "IOs", typeCompilator, debugMode, generatePackage, "i386", cross)
+ if sumulator == True:
+ arch = "i386"
+ cross = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/"
+ else:
+ arch="arm64"
+ cross = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/"
+ lutinTarget.Target.__init__(self, "IOs", typeCompilator, debugMode, generatePackage, arch, cross, sumulator)
# remove unneeded ranlib ...
self.ranlib=""
@@ -28,11 +34,16 @@ class Target(lutinTarget.Target):
self.suffix_lib_dynamic='.dylib'
self.suffix_binary=''
self.suffix_package=''
-
- self.sysroot = "-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk"
-
+ if self.sumulator == True:
+ self.sysroot = "-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk"
+ self.global_flags_ld.append("-mios-simulator-version-min=7.0")
+ self.global_flags_cc.append("-mios-simulator-version-min=7.0")
+ else:
+ self.sysroot = "-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk"
+ self.global_flags_ld.append("-miphoneos-version-min=7.0")
+ self.global_flags_cc.append("-miphoneos-version-min=7.0")
+
self.global_flags_ld.append([
- "-mios-simulator-version-min=7.0",
"-Xlinker",
"-objc_abi_version",
"-Xlinker 2",
@@ -42,7 +53,6 @@ class Target(lutinTarget.Target):
"-fobjc-arc",
"-fobjc-link-runtime"])
- self.global_flags_cc.append("-mios-simulator-version-min=7.0")
self.global_flags_m.append("-fobjc-arc")
#self.global_flags_m.append("-fmodules")
@@ -64,105 +74,117 @@ class Target(lutinTarget.Target):
and pkgProperties["ICON"] != "":
lutinTools.copy_file(pkgProperties["ICON"], self.get_staging_folder_data(pkgName) + "/icon.icns", True)
- # http://www.sandroid.org/imcross/#Deployment
- infoFile=self.get_staging_folder(pkgName) + "/Info.plist"
+ debug.print_element("pkg", "PkgInfo", "<==", "APPL????")
+ infoFile = self.get_staging_folder(pkgName) + "/PkgInfo"
# Create the info file
tmpFile = open(infoFile, 'w')
- tmpFile.write("\n")
- tmpFile.write("\n")
- tmpFile.write("\n")
- tmpFile.write(" \n")
- tmpFile.write(" CFBundleDevelopmentRegion\n")
- tmpFile.write(" en\n")
- tmpFile.write(" CFBundleDisplayName\n")
- tmpFile.write(" " + pkgProperties["NAME"] + "\n")
- tmpFile.write(" CFBundleExecutable\n")
- tmpFile.write(" " + pkgName + "\n")
- tmpFile.write(" CFBundleIdentifier\n")
- tmpFile.write(" com." + pkgProperties["COMPAGNY_NAME2"] + "." + pkgName + "\n")
+ tmpFile.write("APPL????")
+ tmpFile.flush()
+ tmpFile.close()
+
+ debug.print_element("pkg", "Info.plist", "<==", "Package properties")
+ # http://www.sandroid.org/imcross/#Deployment
+ dataFile = "\n"
+ dataFile += "\n"
+ dataFile += "\n"
+ dataFile += " \n"
+ dataFile += " CFBundleDevelopmentRegion\n"
+ dataFile += " en\n"
+ dataFile += " CFBundleDisplayName\n"
+ dataFile += " " + pkgProperties["NAME"] + "\n"
+ dataFile += " CFBundleExecutable\n"
+ dataFile += " " + pkgName + "\n"
+ dataFile += " CFBundleIdentifier\n"
+ dataFile += " com." + pkgProperties["COMPAGNY_NAME2"] + "." + pkgName + "\n"
"""
- tmpFile.write(" CFBundleIconFile\n")
- tmpFile.write(" icon.icns\n")
+ dataFile += " CFBundleIconFile\n"
+ dataFile += " icon.icns\n"
"""
- tmpFile.write(" CFBundleInfoDictionaryVersion\n")
- tmpFile.write(" 6.0\n")
- tmpFile.write(" CFBundleName\n")
- tmpFile.write(" " + pkgName + "\n")
- tmpFile.write(" CFBundlePackageType\n")
- tmpFile.write(" APPL\n")
- tmpFile.write(" CFBundleShortVersionString\n")
- tmpFile.write(" 1.0\n")
- tmpFile.write(" CFBundleSignature\n")
- tmpFile.write(" ????\n")
- tmpFile.write(" CFBundleSupportedPlatforms\n")
- tmpFile.write(" \n")
- tmpFile.write(" iPhoneSimulator\n")
- tmpFile.write(" \n")
- """
- tmpFile.write(" CFBundleVersion\n")
- tmpFile.write(" 1.0\n")
- """
- tmpFile.write(" DTPlatformName\n")
- tmpFile.write(" iphonesimulator\n")
- tmpFile.write(" DTSDKName\n")
- tmpFile.write(" iphonesimulator7.0\n")
- """
- tmpFile.write(" LSRequiresIPhoneOS\n")
- tmpFile.write(" \n")
- """
- tmpFile.write(" UIDeviceFamily\n")
- tmpFile.write(" \n")
- tmpFile.write(" 1\n")
- tmpFile.write(" 2\n")
- tmpFile.write(" \n")
- """
- tmpFile.write(" UILaunchImages\n")
- tmpFile.write(" \n")
- tmpFile.write(" \n")
- tmpFile.write(" UILaunchImageMinimumOSVersion\n")
- tmpFile.write(" 7.0\n")
- tmpFile.write(" UILaunchImageName\n")
- tmpFile.write(" LaunchImage-700-568h\n")
- tmpFile.write(" UILaunchImageOrientation\n")
- tmpFile.write(" Portrait\n")
- tmpFile.write(" UILaunchImageSize\n")
- tmpFile.write(" {320, 568}\n")
- tmpFile.write(" \n")
- tmpFile.write(" \n")
- """
- """
- tmpFile.write(" UIMainStoryboardFile\n")
- tmpFile.write(" Main_iPhone\n")
- tmpFile.write(" UIMainStoryboardFile~ipad\n")
- tmpFile.write(" Main_iPad\n")
- """
- tmpFile.write(" UIRequiredDeviceCapabilities\n")
- tmpFile.write(" \n")
- tmpFile.write(" armv7\n")
- tmpFile.write(" \n")
- tmpFile.write(" UIStatusBarHidden\n")
- tmpFile.write(" \n")
- tmpFile.write(" UISupportedInterfaceOrientations\n")
- tmpFile.write(" \n")
- tmpFile.write(" UIInterfaceOrientationPortrait\n")
- tmpFile.write(" UIInterfaceOrientationPortraitUpsideDown\n")
- tmpFile.write(" UIInterfaceOrientationLandscapeLeft\n")
- tmpFile.write(" UIInterfaceOrientationLandscapeRight\n")
- tmpFile.write(" \n")
- tmpFile.write(" UISupportedInterfaceOrientations~ipad\n")
- tmpFile.write(" \n")
- tmpFile.write(" UIInterfaceOrientationPortrait\n")
- tmpFile.write(" UIInterfaceOrientationPortraitUpsideDown\n")
- tmpFile.write(" UIInterfaceOrientationLandscapeLeft\n")
- tmpFile.write(" UIInterfaceOrientationLandscapeRight\n")
- tmpFile.write(" \n")
- tmpFile.write(" \n")
- tmpFile.write("\n")
- tmpFile.write("\n\n")
+ dataFile += " CFBundleInfoDictionaryVersion\n"
+ dataFile += " 6.0\n"
+ dataFile += " CFBundleName\n"
+ dataFile += " " + pkgName + "\n"
+ dataFile += " CFBundlePackageType\n"
+ dataFile += " APPL\n"
+ dataFile += " CFBundleSignature\n"
+ dataFile += " ????\n"
+ dataFile += " CFBundleSupportedPlatforms\n"
+ dataFile += " \n"
+ dataFile += " iPhoneSimulator\n"
+ dataFile += " \n"
+ dataFile += " \n"
+ dataFile += " CFBundleShortVersionString\n"
+ dataFile += " "+pkgProperties["VERSION"]+"\n"
+ dataFile += " CFBundleVersion\n"
+ dataFile += " "+pkgProperties["VERSION_CODE"]+"\n"
+ dataFile += " \n"
+ dataFile += " CFBundleResourceSpecification\n"
+ dataFile += " ResourceRules.plist\n"
+ if self.sumulator == False:
+ dataFile += " LSRequiresIPhoneOS\n"
+ dataFile += " \n"
+ else:
+ dataFile += " DTPlatformName\n"
+ dataFile += " iphonesimulator\n"
+ dataFile += " DTSDKName\n"
+ dataFile += " iphonesimulator7.0\n"
+ dataFile += " \n"
+ dataFile += " UIDeviceFamily\n"
+ dataFile += " \n"
+ dataFile += " 1\n"
+ dataFile += " 2\n"
+ dataFile += " \n"
+ dataFile += " UIRequiredDeviceCapabilities\n"
+ dataFile += " \n"
+ dataFile += " armv7\n"
+ dataFile += " \n"
+ dataFile += " UIStatusBarHidden\n"
+ dataFile += " \n"
+ dataFile += " UISupportedInterfaceOrientations\n"
+ dataFile += " \n"
+ dataFile += " UIInterfaceOrientationPortrait\n"
+ dataFile += " UIInterfaceOrientationPortraitUpsideDown\n"
+ dataFile += " UIInterfaceOrientationLandscapeLeft\n"
+ dataFile += " UIInterfaceOrientationLandscapeRight\n"
+ dataFile += " \n"
+ dataFile += " UISupportedInterfaceOrientations~ipad\n"
+ dataFile += " \n"
+ dataFile += " UIInterfaceOrientationPortrait\n"
+ dataFile += " UIInterfaceOrientationPortraitUpsideDown\n"
+ dataFile += " UIInterfaceOrientationLandscapeLeft\n"
+ dataFile += " UIInterfaceOrientationLandscapeRight\n"
+ dataFile += " \n"
+ dataFile += " \n"
+ dataFile += "\n"
+ dataFile += "\n\n"
+
+ infoFile = self.get_staging_folder(pkgName) + "/Info.plist"
+ # Create the info file
+ tmpFile = open(infoFile, 'w')
+ tmpFile.write(dataFile)
tmpFile.flush()
tmpFile.close()
"""
- builtin-infoPlistUtility
+ infoFile = self.get_staging_folder(pkgName) + "/" + pkgName + "-Info.plist"
+ # Create the info file
+ tmpFile = open(infoFile, 'w')
+ tmpFile.write(dataFile)
+ tmpFile.flush()
+ tmpFile.close()
+ cmdLine = "builtin-infoPlistUtility "
+ cmdLine += " " + self.get_staging_folder(pkgName) + "/" + pkgName + "-Info.plist "
+ cmdLine += " -genpkginfo " + self.get_staging_folder(pkgName) + "/PkgInfo"
+ cmdLine += " -expandbuildsettings "
+ cmdLine += " -format binary "
+ if self.sumulator == False:
+ cmdLine += " -platform iphonesimulator "
+ else:
+ cmdLine += " -platform iphoneos "
+ cmdLine += " -o " + self.get_staging_folder(pkgName) + "/" + "Info.plist"
+ lutinMultiprocess.run_command(cmdLine)
+ """
+ """
+
/Users/edouarddupin/dev/exampleProjectXcode/projectName/projectName/projectName-Info.plist
-genpkginfo
/Users/edouarddupin/Library/Developer/Xcode/DerivedData/projectName-gwycnyyzohokcmalgodeucqppxro/Build/Products/Debug-iphonesimulator/projectName.app/PkgInfo
@@ -171,15 +193,64 @@ class Target(lutinTarget.Target):
-platform iphonesimulator
-additionalcontentfile /Users/edouarddupin/Library/Developer/Xcode/DerivedData/projectName-gwycnyyzohokcmalgodeucqppxro/Build/Intermediates/projectName.build/Debug-iphonesimulator/projectName.build/assetcatalog_generated_info.plist
-o /Users/edouarddupin/Library/Developer/Xcode/DerivedData/projectName-gwycnyyzohokcmalgodeucqppxro/Build/Products/Debug-iphonesimulator/projectName.app/Info.plist
- """
+ -additionalcontentfile /Users/edouarddupin/Library/Developer/Xcode/DerivedData/zdzdzd-bjuyukzpzhnyerdmxohjyuxfdllv/Build/Intermediates/zdzdzd.build/Debug-iphoneos/zdzdzd.build/assetcatalog_generated_info.plist -o /Users/edouarddupin/Library/Developer/Xcode/DerivedData/zdzdzd-bjuyukzpzhnyerdmxohjyuxfdllv/Build/Products/Debug-iphoneos/zdzdzd.app/Info.plist
+
+ """
#/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil /Users/edouarddupin/Library/Developer/Xcode/DerivedData/projectName-gwycnyyzohokcmalgodeucqppxro/Build/Products/Debug-iphonesimulator/projectName.app/projectName -o /Users/edouarddupin/Library/Developer/Xcode/DerivedData/projectName-gwycnyyzohokcmalgodeucqppxro/Build/Products/Debug-iphonesimulator/projectName.app.dSYM
+
+ debug.print_element("pkg", "ResourceRules.plist", "<==", "Resources autorisation")
+ dataFile = "\n"
+ dataFile += "\n"
+ dataFile += "\n"
+ dataFile += " \n"
+ dataFile += " rules\n"
+ dataFile += " \n"
+ dataFile += " .*\n"
+ dataFile += " \n"
+ dataFile += " Info.plist\n"
+ dataFile += " \n"
+ dataFile += " omit\n"
+ dataFile += " \n"
+ dataFile += " weight\n"
+ dataFile += " 10\n"
+ dataFile += " \n"
+ dataFile += " ResourceRules.plist\n"
+ dataFile += " \n"
+ dataFile += " omit\n"
+ dataFile += " \n"
+ dataFile += " weight\n"
+ dataFile += " 100\n"
+ dataFile += " \n"
+ dataFile += " \n"
+ dataFile += " \n"
+ dataFile += "\n"
+ dataFile += "\n\n"
- infoFile=self.get_staging_folder(pkgName) + "/PkgInfo"
+ infoFile = self.get_staging_folder(pkgName) + "/ResourceRules.plist"
# Create the info file
tmpFile = open(infoFile, 'w')
- tmpFile.write("APPL????")
+ tmpFile.write(dataFile)
tmpFile.flush()
tmpFile.close()
+
+ debug.print_element("pkg", "Entitlements.plist", "<==", "application mode")
+ dataFile = "\n"
+ dataFile += "\n"
+ dataFile += "\n"
+ dataFile += " \n"
+ dataFile += " get-task-allow\n"
+ dataFile += " \n"
+ dataFile += " \n"
+ dataFile += "\n"
+ dataFile += "\n\n"
+
+ infoFile = self.get_staging_folder(pkgName) + "/Entitlements.plist"
+ # Create the info file
+ tmpFile = open(infoFile, 'w')
+ tmpFile.write(dataFile)
+ tmpFile.flush()
+ tmpFile.close()
+
# Simulateur folder :
#~/Library/Application\ Support/iPhone\ Simulator/7.0.3/Applications/
# must have a 'uuidgen' UID generate value with this elemennt ...
@@ -189,6 +260,45 @@ class Target(lutinTarget.Target):
# Must create the tarball of the application
#cd $(TARGET_OUT_FINAL)/; tar -cf $(PROJECT_NAME).tar $(PROJECT_NAME).app
#cd $(TARGET_OUT_FINAL)/; tar -czf $(PROJECT_NAME).tar.gz $(PROJECT_NAME).app
+
+ if self.sumulator == False:
+ # Create the info file
+ tmpFile = open(self.get_build_folder(pkgName) + "/worddown.xcent", 'w')
+ tmpFile.write("\n")
+ tmpFile.write("\n")
+ tmpFile.write("\n")
+ tmpFile.write(" \n")
+ tmpFile.write(" application-identifier\n")
+ tmpFile.write(" " + pkgProperties["APPLE_APPLICATION_IOS_ID"] + "." + pkgProperties["COMPAGNY_TYPE"] + "." + pkgProperties["COMPAGNY_NAME2"] + "." + pkgName + "\n")
+ tmpFile.write(" get-task-allow\n")
+ tmpFile.write(" \n")
+ tmpFile.write(" keychain-access-groups\n")
+ tmpFile.write(" \n")
+ tmpFile.write(" " + pkgProperties["APPLE_APPLICATION_IOS_ID"] + ".atriasoft.worddown\n")
+ tmpFile.write(" \n")
+ tmpFile.write(" \n")
+ tmpFile.write("\n")
+ tmpFile.flush()
+ tmpFile.close()
+ # application signing :
+ debug.print_element("pkg(signed)", "pkg", "<==", "Signing application")
+ iosDevelopperKeyFile = ".iosKey.txt"
+ if lutinTools.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\"'")
+ signatureKey = lutinTools.file_read_data(iosDevelopperKeyFile)
+ signatureKey = re.sub('\n', '', signatureKey)
+ cmdLine = 'codesign --force --sign '
+ # to get this key ; certtool y | grep "Developer"
+ cmdLine += ' "' + signatureKey + '" '
+ cmdLine += ' --entitlements ' + self.get_build_folder(pkgName) + '/worddown.xcent'
+ cmdLine += ' ' + self.get_staging_folder(pkgName)
+ lutinMultiprocess.run_command(cmdLine)
+
+ # --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
+ # --entitlements /Users/edouarddupin/Library/Developer/Xcode/DerivedData/worddown-cmuvjchgtiteexdiacyqoexsyadg/Build/Intermediates/worddown.build/Debug-iphoneos/worddown.build/worddown.xcent
+ # /Users/edouarddupin/Library/Developer/Xcode/DerivedData/worddown-cmuvjchgtiteexdiacyqoexsyadg/Build/Products/Debug-iphoneos/worddown.app
+
def createRandomNumber(self, len):
out = ""
@@ -200,32 +310,43 @@ class Target(lutinTarget.Target):
debug.debug("------------------------------------------------------------------------")
debug.info("Install package '" + pkgName + "'")
debug.debug("------------------------------------------------------------------------")
- simulatorIdFile = ".iosSimutatorId_" + pkgName + ".txt"
- if lutinTools.file_size(simulatorIdFile) < 10:
- #create the file:
- tmpFile = open(simulatorIdFile, 'w')
- tmpFile.write(self.createRandomNumber(8))
- tmpFile.write("-")
- tmpFile.write(self.createRandomNumber(4))
- tmpFile.write("-")
- tmpFile.write(self.createRandomNumber(4))
- tmpFile.write("-")
- tmpFile.write(self.createRandomNumber(4))
- tmpFile.write("-")
- tmpFile.write(self.createRandomNumber(12))
- tmpFile.flush()
- tmpFile.close()
- simulatorId = lutinTools.file_read_data(simulatorIdFile)
- home = os.path.expanduser("~")
- destinationFolderBase = home + "/Library/Application\\ Support/iPhone\\ Simulator/7.0.3/Applications/" + simulatorId
- destinationFolder = home + "/Library/Application Support/iPhone Simulator/7.0.3/Applications/" + simulatorId + "/" + pkgName + ".app"
- destinationFolder2 = home + "/Library/Application\\ Support/iPhone\\ Simulator/7.0.3/Applications/" + simulatorId + "/" + pkgName + ".app"
- debug.info("install in simulator : " + destinationFolder)
- lutinTools.create_directory_of_file(destinationFolder + "/plop.txt")
- cmdLine = "cp -rf " + self.get_staging_folder(pkgName) + " " + destinationFolder2
- lutinMultiprocess.run_command(cmdLine)
- cmdLine = "touch " + destinationFolderBase
- lutinMultiprocess.run_command(cmdLine)
+ if self.sumulator == False:
+ if lutinTools.file_size("ewol/ios-deploy/ios-deploy") == 0:
+ debug.print_element("tool", "ios-deploy", "<==", "external sources")
+ cmdLine = 'cd ewol/ios-deploy ; make ; cd ../.. '
+ lutinMultiprocess.run_command(cmdLine)
+ if lutinTools.file_size("ewol/ios-deploy/ios-deploy") == 0:
+ debug.error("Can not create ios-deploy external software ...")
+ debug.print_element("deploy", "iphone/ipad", "<==", "aplication")
+ cmdLine = './ewol/ios-deploy/ios-deploy --bundle ' + self.get_staging_folder(pkgName)
+ lutinMultiprocess.run_command(cmdLine)
+ else:
+ simulatorIdFile = ".iosSimutatorId_" + pkgName + ".txt"
+ if lutinTools.file_size(simulatorIdFile) < 10:
+ #create the file:
+ tmpFile = open(simulatorIdFile, 'w')
+ tmpFile.write(self.createRandomNumber(8))
+ tmpFile.write("-")
+ tmpFile.write(self.createRandomNumber(4))
+ tmpFile.write("-")
+ tmpFile.write(self.createRandomNumber(4))
+ tmpFile.write("-")
+ tmpFile.write(self.createRandomNumber(4))
+ tmpFile.write("-")
+ tmpFile.write(self.createRandomNumber(12))
+ tmpFile.flush()
+ tmpFile.close()
+ simulatorId = lutinTools.file_read_data(simulatorIdFile)
+ home = os.path.expanduser("~")
+ destinationFolderBase = home + "/Library/Application\\ Support/iPhone\\ Simulator/7.1/Applications/" + simulatorId
+ 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"
+ debug.info("install in simulator : " + destinationFolder)
+ lutinTools.create_directory_of_file(destinationFolder + "/plop.txt")
+ cmdLine = "cp -rf " + self.get_staging_folder(pkgName) + " " + destinationFolder2
+ lutinMultiprocess.run_command(cmdLine)
+ cmdLine = "touch " + destinationFolderBase
+ lutinMultiprocess.run_command(cmdLine)
#sudo dpkg -i $(TARGET_OUT_FINAL)/$(PROJECT_NAME) + self.suffix_package
@@ -233,9 +354,12 @@ class Target(lutinTarget.Target):
debug.debug("------------------------------------------------------------------------")
debug.info("Un-Install package '" + pkgName + "'")
debug.debug("------------------------------------------------------------------------")
- simulatorIdFile = ".iosSimutatorId_" + pkgName + ".txt"
- if lutinTools.file_size(simulatorIdFile) < 10:
- debug.warning("Can not get simulation O_ID : " + simulatorIdFile)
+ if self.sumulator == False:
+ debug.warning("not implemented")
+ else:
+ simulatorIdFile = ".iosSimutatorId_" + pkgName + ".txt"
+ if lutinTools.file_size(simulatorIdFile) < 10:
+ debug.warning("Can not get simulation O_ID : " + simulatorIdFile)
#sudo dpkg -r $(TARGET_OUT_FINAL)/$(PROJECT_NAME) + self.suffix_package
@@ -243,8 +367,19 @@ class Target(lutinTarget.Target):
debug.debug("------------------------------------------------------------------------")
debug.info("log of iOs board")
debug.debug("------------------------------------------------------------------------")
- cmdLine = "tail -f ~/Library/Logs/iOS\ Simulator/7.0.3/system.log"
- lutinMultiprocess.run_command(cmdLine)
+ if self.sumulator == False:
+ if lutinTools.file_size("ewol/ios-deploy/ios-deploy") == 0:
+ debug.print_element("tool", "ios-deploy", "<==", "external sources")
+ cmdLine = 'cd ewol/ios-deploy ; make ; cd ../.. '
+ lutinMultiprocess.run_command(cmdLine)
+ if lutinTools.file_size("ewol/ios-deploy/ios-deploy") == 0:
+ debug.error("Can not create ios-deploy external software ...")
+ debug.print_element("deploy", "iphone/ipad", "<==", "aplication")
+ cmdLine = './ewol/ios-deploy/ios-deploy --debug --bundle ' + self.get_staging_folder(pkgName)
+ lutinMultiprocess.run_command(cmdLine)
+ else:
+ cmdLine = "tail -f ~/Library/Logs/iOS\ Simulator/7.1/system.log"
+ lutinMultiprocess.run_command(cmdLine)
diff --git a/lutinTargetLinux.py b/lutinTargetLinux.py
index f6490f6..d86057b 100644
--- a/lutinTargetLinux.py
+++ b/lutinTargetLinux.py
@@ -7,7 +7,7 @@ import stat
import lutinMultiprocess
class Target(lutinTarget.Target):
- def __init__(self, typeCompilator, debugMode, generatePackage):
+ def __init__(self, typeCompilator, debugMode, generatePackage, sumulator=False):
lutinTarget.Target.__init__(self, "Linux", typeCompilator, debugMode, generatePackage, "", "")
def generate_list_separate_coma(self, list):
diff --git a/lutinTargetMacOs.py b/lutinTargetMacOs.py
index 3058e9c..c263408 100644
--- a/lutinTargetMacOs.py
+++ b/lutinTargetMacOs.py
@@ -6,7 +6,7 @@ import os
import stat
class Target(lutinTarget.Target):
- def __init__(self, typeCompilator, debugMode, generatePackage):
+ def __init__(self, typeCompilator, debugMode, generatePackage, sumulator=False):
cross = ""
# http://biolpc22.york.ac.uk/pub/linux-mac-cross/
@@ -52,7 +52,7 @@ class Target(lutinTarget.Target):
tmpFile.write(" CFBundleName\n")
tmpFile.write(" "+pkgName+"\n")
tmpFile.write(" CFBundleIdentifier\n")
- tmpFile.write(" com."+pkgProperties["COMPAGNY_NAME2"]+"."+pkgName+"\n")
+ tmpFile.write(" " + pkgProperties["COMPAGNY_TYPE"] + "." + pkgProperties["COMPAGNY_NAME2"] + "." + pkgName + "\n")
tmpFile.write(" CFBundleSignature\n")
tmpFile.write(" ????\n")
tmpFile.write(" CFBundleIconFile\n")
diff --git a/lutinTargetWindows.py b/lutinTargetWindows.py
index 7d9a38b..b829ea7 100644
--- a/lutinTargetWindows.py
+++ b/lutinTargetWindows.py
@@ -8,7 +8,7 @@ import lutinHost
import sys
class Target(lutinTarget.Target):
- def __init__(self, typeCompilator, debugMode, generatePackage):
+ def __init__(self, typeCompilator, debugMode, generatePackage, sumulator=False):
# on windows board the basic path is not correct
# TODO : get external PATH for the minGW path
# TODO : Set the cyngwin path ...