diff --git a/Classes/DeMarcelpociotSidemenuModuleAssets.m b/Classes/DeMarcelpociotSidemenuModuleAssets.m index be7266c..1bbabef 100644 --- a/Classes/DeMarcelpociotSidemenuModuleAssets.m +++ b/Classes/DeMarcelpociotSidemenuModuleAssets.m @@ -9,18 +9,16 @@ @implementation DeMarcelpociotSidemenuModuleAssets - (NSData*) moduleAsset { - //##TI_AUTOGEN_BEGIN asset - //Compiler generates code for asset here - return nil; // DEFAULT BEHAVIOR - //##TI_AUTOGEN_END asset + + + return nil; } - (NSData*) resolveModuleAsset:(NSString*)path { - //##TI_AUTOGEN_BEGIN resolve_asset - //Compiler generates code for asset resolution here - return nil; // DEFAULT BEHAVIOR - //##TI_AUTOGEN_END resolve_asset + + + return nil; } @end diff --git a/Classes/DeMarcelpociotSidemenuSideMenu.m b/Classes/DeMarcelpociotSidemenuSideMenu.m index 30c757b..90bfe44 100644 --- a/Classes/DeMarcelpociotSidemenuSideMenu.m +++ b/Classes/DeMarcelpociotSidemenuSideMenu.m @@ -16,6 +16,9 @@ UIViewController * TiSideMenuControllerForViewProxy(TiViewProxy * proxy) { + if (proxy == nil) { + return nil; + } [[proxy view] setAutoresizingMask:UIViewAutoresizingNone]; //make the proper resize ! diff --git a/build.py b/build.py deleted file mode 100755 index 0fc413a..0000000 --- a/build.py +++ /dev/null @@ -1,223 +0,0 @@ -#!/usr/bin/env python -# -# Appcelerator Titanium Module Packager -# -# -import os, subprocess, sys, glob, string -import zipfile -from datetime import date - -cwd = os.path.abspath(os.path.dirname(sys._getframe(0).f_code.co_filename)) -os.chdir(cwd) -required_module_keys = ['name','version','moduleid','description','copyright','license','copyright','platform','minsdk'] -module_defaults = { - 'description':'My module', - 'author': 'Your Name', - 'license' : 'Specify your license', - 'copyright' : 'Copyright (c) %s by Your Company' % str(date.today().year), -} -module_license_default = "TODO: place your license here and we'll include it in the module distribution" - -def find_sdk(config): - sdk = config['TITANIUM_SDK'] - return os.path.expandvars(os.path.expanduser(sdk)) - -def replace_vars(config,token): - idx = token.find('$(') - while idx != -1: - idx2 = token.find(')',idx+2) - if idx2 == -1: break - key = token[idx+2:idx2] - if not config.has_key(key): break - 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 = {} - for line in contents.splitlines(False): - line = line.strip() - if line[0:2]=='//': continue - idx = line.find('=') - if idx > 0: - key = line[0:idx].strip() - value = line[idx+1:].strip() - config[key] = replace_vars(config,value) - return config - -def generate_doc(config): - docdir = os.path.join(cwd,'documentation') - if not os.path.exists(docdir): - print "Couldn't find documentation file at: %s" % docdir - return None - - try: - import markdown2 as markdown - except ImportError: - import markdown - documentation = [] - for file in os.listdir(docdir): - if file in ignoreFiles or os.path.isdir(os.path.join(docdir, file)): - continue - md = open(os.path.join(docdir,file)).read() - html = markdown.markdown(md) - documentation.append({file:html}); - return documentation - -def compile_js(manifest,config): - js_file = os.path.join(cwd,'assets','de.marcelpociot.sidemenu.js') - if not os.path.exists(js_file): return - - from compiler import Compiler - try: - import json - except: - import simplejson as json - - compiler = Compiler(cwd, manifest['moduleid'], manifest['name'], 'commonjs') - root_asset, module_assets = compiler.compile_module() - - root_asset_content = """ -%s - - return filterDataInRange([NSData dataWithBytesNoCopy:data length:sizeof(data) freeWhenDone:NO], ranges[0]); -""" % root_asset - - module_asset_content = """ -%s - - NSNumber *index = [map objectForKey:path]; - if (index == nil) { - return nil; - } - return filterDataInRange([NSData dataWithBytesNoCopy:data length:sizeof(data) freeWhenDone:NO], ranges[index.integerValue]); -""" % module_assets - - from tools import splice_code - - assets_router = os.path.join(cwd,'Classes','DeMarcelpociotSidemenuModuleAssets.m') - splice_code(assets_router, 'asset', root_asset_content) - splice_code(assets_router, 'resolve_asset', module_asset_content) - - # Generate the exports after crawling all of the available JS source - exports = open('metadata.json','w') - json.dump({'exports':compiler.exports }, exports) - exports.close() - -def die(msg): - print msg - sys.exit(1) - -def warn(msg): - print "[WARN] %s" % msg - -def validate_license(): - c = open(os.path.join(cwd,'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) - if not os.path.exists(path): die("missing %s" % path) - manifest = {} - for line in f.readlines(): - line = line.strip() - if line[0:1]=='#': continue - if line.find(':') < 0: continue - 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 module_defaults.has_key(key): - defvalue = module_defaults[key] - curvalue = manifest[key] - if curvalue==defvalue: warn("please update the manifest key: '%s' to a non-default value" % key) - return manifest,path - -ignoreFiles = ['.DS_Store','.gitignore','libTitanium.a','titanium.jar','README'] -ignoreDirs = ['.DS_Store','.svn','.git','CVSROOT'] - -def zip_dir(zf,dir,basepath,ignoreExt=[]): - if not os.path.exists(dir): return - for root, dirs, files in os.walk(dir): - for name in ignoreDirs: - if name in dirs: - 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] in ignoreExt: continue - from_ = os.path.join(root, file) - to_ = from_.replace(dir, '%s/%s'%(basepath,dir), 1) - zf.write(from_, to_) - -def glob_libfiles(): - files = [] - for libfile in glob.glob('build/**/*.a'): - if libfile.find('Release-')!=-1: - files.append(libfile) - return files - -def build_module(manifest,config): - from tools import ensure_dev_path - ensure_dev_path() - - rc = os.system("xcodebuild -sdk iphoneos -configuration Release") - if rc != 0: - die("xcodebuild failed") - rc = os.system("xcodebuild -sdk iphonesimulator -configuration Release") - if rc != 0: - die("xcodebuild failed") - # build the merged library using lipo - moduleid = manifest['moduleid'] - libpaths = '' - for libfile in glob_libfiles(): - libpaths+='%s ' % libfile - - os.system("lipo %s -create -output build/lib%s.a" %(libpaths,moduleid)) - -def package_module(manifest,mf,config): - name = manifest['name'].lower() - moduleid = manifest['moduleid'].lower() - version = manifest['version'] - modulezip = '%s-iphone-%s.zip' % (moduleid,version) - if os.path.exists(modulezip): os.remove(modulezip) - zf = zipfile.ZipFile(modulezip, 'w', zipfile.ZIP_DEFLATED) - modulepath = 'modules/iphone/%s/%s' % (moduleid,version) - zf.write(mf,'%s/manifest' % modulepath) - libname = 'lib%s.a' % moduleid - zf.write('build/%s' % libname, '%s/%s' % (modulepath,libname)) - docs = generate_doc(config) - if docs!=None: - for doc in docs: - for file, html in doc.iteritems(): - filename = string.replace(file,'.md','.html') - zf.writestr('%s/documentation/%s'%(modulepath,filename),html) - zip_dir(zf,'assets',modulepath,['.pyc','.js']) - zip_dir(zf,'example',modulepath,['.pyc']) - zip_dir(zf,'platform',modulepath,['.pyc','.js']) - zf.write('LICENSE','%s/LICENSE' % modulepath) - zf.write('module.xcconfig','%s/module.xcconfig' % modulepath) - exports_file = 'metadata.json' - if os.path.exists(exports_file): - zf.write(exports_file, '%s/%s' % (modulepath, exports_file)) - zf.close() - - -if __name__ == '__main__': - manifest,mf = validate_manifest() - validate_license() - config = read_ti_xcconfig() - - sdk = find_sdk(config) - sys.path.insert(0,os.path.join(sdk,'iphone')) - sys.path.append(os.path.join(sdk, "common")) - - compile_js(manifest,config) - build_module(manifest,config) - package_module(manifest,mf,config) - sys.exit(0) - diff --git a/de.marcelpociot.sidemenu-iphone-2.3.zip b/de.marcelpociot.sidemenu-iphone-2.3.zip new file mode 100644 index 0000000..8d328a6 Binary files /dev/null and b/de.marcelpociot.sidemenu-iphone-2.3.zip differ diff --git a/manifest b/manifest index 2956625..6443f2d 100644 --- a/manifest +++ b/manifest @@ -2,12 +2,12 @@ # this is your module manifest and used by Titanium # during compilation, packaging, distribution, etc. # -version: 2.2 -apiversion: 3 +version: 2.3.0 +apiversion: 2 description: My module author: Marcel Pociot license: MIT -copyright: Copyright (c) 2013-2014 by Marcel Pociot +copyright: Copyright (c) 2013-present by Marcel Pociot # these should not be edited @@ -15,5 +15,5 @@ name: TiSideMenu moduleid: de.marcelpociot.sidemenu guid: 544290ca-7102-4cf4-8b20-feedb53f2045 platform: iphone -minsdk: 3.4.0.GA +minsdk: 6.0.1.GA architectures: armv7 arm64 i386 x86_64 diff --git a/metadata.json b/metadata.json new file mode 100644 index 0000000..43a62e5 --- /dev/null +++ b/metadata.json @@ -0,0 +1 @@ +{"exports":[]} \ No newline at end of file diff --git a/titanium.xcconfig b/titanium.xcconfig index 086b844..5c1ce2f 100644 --- a/titanium.xcconfig +++ b/titanium.xcconfig @@ -4,16 +4,13 @@ // OF YOUR TITANIUM SDK YOU'RE BUILDING FOR // // -TITANIUM_SDK_VERSION = 3.4.0.GA +TITANIUM_SDK_VERSION = 6.1.2.GA -// +// // THESE SHOULD BE OK GENERALLY AS-IS // TITANIUM_SDK = $HOME/Library/Application Support/Titanium/mobilesdk/osx/$(TITANIUM_SDK_VERSION) TITANIUM_BASE_SDK = "$(TITANIUM_SDK)/iphone/include" TITANIUM_BASE_SDK2 = "$(TITANIUM_SDK)/iphone/include/TiCore" HEADER_SEARCH_PATHS= $(TITANIUM_BASE_SDK) $(TITANIUM_BASE_SDK2) - - -