Skip to content

Commit

Permalink
updated project for 64 bit archs
Browse files Browse the repository at this point in the history
  • Loading branch information
omorandi committed Nov 24, 2014
1 parent 7ad2a94 commit f658301
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 20 deletions.
2 changes: 0 additions & 2 deletions Classes/ComOmorandiModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ -(void)startup
// this method is called when the module is first loaded
// you *must* call the superclass
[super startup];

NSLog(@"[INFO] %@ loaded",self);
}

-(void)shutdown:(id)sender
Expand Down
32 changes: 17 additions & 15 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ def replace_vars(config,token):
token = token.replace('$(%s)' % key, config[key])
idx = token.find('$(')
return token


def read_ti_xcconfig():
contents = open(os.path.join(cwd,'titanium.xcconfig')).read()
config = {}
Expand Down Expand Up @@ -60,18 +60,18 @@ def generate_doc(config):
def compile_js(manifest,config):
js_file = os.path.join(cwd,'assets','com.omorandi.js')
if not os.path.exists(js_file): return

sdk = config['TITANIUM_SDK']
iphone_dir = os.path.join(sdk,'iphone')
sys.path.insert(0,iphone_dir)
from compiler import Compiler

path = os.path.basename(js_file)
metadata = Compiler.make_function_from_file(path,js_file)
method = metadata['method']
eq = path.replace('.','_')
method = ' return %s;' % method

f = os.path.join(cwd,'Classes','ComOmorandiModuleAssets.m')
c = open(f).read()
idx = c.find('return ')
Expand All @@ -82,24 +82,24 @@ def compile_js(manifest,config):
@end
"""
newc = before + method + after

if newc!=c:
x = open(f,'w')
x.write(newc)
x.close()

def die(msg):
print msg
sys.exit(1)

def warn(msg):
print "[WARN] %s" % msg
print "[WARN] %s" % msg

def validate_license():
c = open('LICENSE').read()
if c.find(module_license_default)!=1:
warn('please update the LICENSE file with your license text before distributing')

def validate_manifest():
path = os.path.join(cwd,'manifest')
f = open(path)
Expand All @@ -112,7 +112,7 @@ def validate_manifest():
key,value = line.split(':')
manifest[key.strip()]=value.strip()
for key in required_module_keys:
if not manifest.has_key(key): die("missing required manifest key '%s'" % key)
if not manifest.has_key(key): die("missing required manifest key '%s'" % key)
if module_defaults.has_key(key):
defvalue = module_defaults[key]
curvalue = manifest[key]
Expand All @@ -126,12 +126,12 @@ def zip_dir(zf,dir,basepath,ignore=[]):
for root, dirs, files in os.walk(dir):
for name in ignoreDirs:
if name in dirs:
dirs.remove(name) # don't visit ignored directories
dirs.remove(name) # don't visit ignored directories
for file in files:
if file in ignoreFiles: continue
e = os.path.splitext(file)
if len(e)==2 and e[1]=='.pyc':continue
from_ = os.path.join(root, file)
from_ = os.path.join(root, file)
to_ = from_.replace(dir, basepath, 1)
zf.write(from_, to_)

Expand All @@ -154,9 +154,11 @@ def build_module(manifest,config):
libpaths = ''
for libfile in glob_libfiles():
libpaths+='%s ' % libfile

os.system("lipo %s -create -output build/lib%s.a" %(libpaths,moduleid))

os.system("lipo -info build/lib%s.a" %moduleid)


def package_module(manifest,mf,config):
name = manifest['name'].lower()
moduleid = manifest['moduleid'].lower()
Expand All @@ -174,7 +176,7 @@ def package_module(manifest,mf,config):
zf.write('LICENSE','%s/LICENSE' % modulepath)
zf.write('module.xcconfig','%s/module.xcconfig' % modulepath)
zf.close()


if __name__ == '__main__':
manifest,mf = validate_manifest()
Expand Down
Binary file removed com.omorandi-iphone-1.1.1.zip
Binary file not shown.
Binary file added com.omorandi-iphone-1.1.2.zip
Binary file not shown.
5 changes: 3 additions & 2 deletions manifest
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# this is your module manifest and used by Titanium
# during compilation, packaging, distribution, etc.
#
version: 1.1.1
version: 1.1.2
description: The SMSDialog Module extends the Appcelerator Titanium Mobile framework implementing an iPhone dialog window that enables you to send in application text messages on behalf of the app user, exposing an API very similar to the one of the Ti.UI.EmailDialog object. Both recipients and body fields can be pre-populated from your application.
author: Olivier Morandi
license: MIT license
Expand All @@ -14,4 +14,5 @@ name: smsdialog
moduleid: com.omorandi
guid: 87f37de9-e076-43cb-a2a0-a840e45af0d7
platform: iphone
minsdk: 3.2.3.GA
minsdk: 3.4.1.GA
architectures: armv7 arm64 i386 x86_64
5 changes: 4 additions & 1 deletion smsdialog.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0510;
LastUpgradeCheck = 0610;
};
buildConfigurationList = 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "smsdialog" */;
compatibilityVersion = "Xcode 3.2";
Expand Down Expand Up @@ -263,6 +263,8 @@
GCC_OPTIMIZATION_LEVEL = 0;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
ONLY_ACTIVE_ARCH = NO;
OTHER_LDFLAGS = "";
PREBINDING = NO;
SDKROOT = iphoneos;
Expand All @@ -276,6 +278,7 @@
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
OTHER_LDFLAGS = "";
PREBINDING = NO;
SDKROOT = iphoneos;
Expand Down

0 comments on commit f658301

Please sign in to comment.