Skip to content

Commit

Permalink
Merge branch 'feature/cbl_104_lib' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
pegli committed Apr 14, 2015
2 parents 6550366 + cd92e68 commit e60c923
Show file tree
Hide file tree
Showing 18 changed files with 60 additions and 18 deletions.
Binary file removed mobile/android/lib/cbl_collator_so-1.0.3.1.jar
Binary file not shown.
Binary file not shown.
Binary file added mobile/android/lib/commons-logging-1.1.3.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added mobile/android/lib/httpclient-4.0-beta1.jar
Binary file not shown.
Binary file added mobile/android/lib/httpcore-4.0-beta2.jar
Binary file not shown.
1 change: 0 additions & 1 deletion mobile/ios/Classes/TDBridge.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#import "TDBridge.h"

#import "TiCore.h"
#import "KrollBridge.h"
#import "KrollContext.h"
#import "KrollMethod.h"
Expand Down
69 changes: 56 additions & 13 deletions mobile/ios/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

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']
required_module_keys = ['architectures', 'name','version','moduleid','description','copyright','license','copyright','platform','minsdk']
module_defaults = {
'description':'My module',
'author': 'Your Name',
Expand Down Expand Up @@ -49,6 +49,8 @@ def read_ti_xcconfig():

def generate_doc(config):
docdir = os.path.join(cwd,'documentation')
if not os.path.exists(docdir):
docdir = os.path.join(cwd,'..','documentation')
if not os.path.exists(docdir):
print "Couldn't find documentation file at: %s" % docdir
return None
Expand All @@ -67,7 +69,9 @@ def generate_doc(config):
return documentation

def compile_js(manifest,config):
js_file = os.path.join(cwd,'assets','foo.module.js')
js_file = os.path.join(cwd,'assets','com.foogle.js')
if not os.path.exists(js_file):
js_file = os.path.join(cwd,'..','assets','com.foogle.js')
if not os.path.exists(js_file): return

from compiler import Compiler
Expand Down Expand Up @@ -97,7 +101,7 @@ def compile_js(manifest,config):

from tools import splice_code

assets_router = os.path.join(cwd,'Classes','FooModuleModuleAssets.m')
assets_router = os.path.join(cwd,'Classes','ComFoogleModuleAssets.m')
splice_code(assets_router, 'asset', root_asset_content)
splice_code(assets_router, 'resolve_asset', module_asset_content)

Expand All @@ -114,9 +118,13 @@ 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')
license_file = os.path.join(cwd,'LICENSE')
if not os.path.exists(license_file):
license_file = os.path.join(cwd,'..','LICENSE')
if os.path.exists(license_file):
c = open(license_file).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')
Expand All @@ -131,6 +139,7 @@ def validate_manifest():
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 manifest[key].strip() == '': die("manifest key '%s' missing required value" % key)
if module_defaults.has_key(key):
defvalue = module_defaults[key]
curvalue = manifest[key]
Expand All @@ -140,7 +149,7 @@ def validate_manifest():
ignoreFiles = ['.DS_Store','.gitignore','libTitanium.a','titanium.jar','README']
ignoreDirs = ['.DS_Store','.svn','.git','CVSROOT']

def zip_dir(zf,dir,basepath,ignore=[]):
def zip_dir(zf,dir,basepath,ignore=[],includeJSFiles=False):
for root, dirs, files in os.walk(dir):
for name in ignoreDirs:
if name in dirs:
Expand All @@ -149,7 +158,7 @@ def zip_dir(zf,dir,basepath,ignore=[]):
if file in ignoreFiles: continue
e = os.path.splitext(file)
if len(e) == 2 and e[1] == '.pyc': continue
if len(e) == 2 and e[1] == '.js': continue
if not includeJSFiles and len(e) == 2 and e[1] == '.js': continue
from_ = os.path.join(root, file)
to_ = from_.replace(dir, basepath, 1)
zf.write(from_, to_)
Expand Down Expand Up @@ -179,6 +188,24 @@ def build_module(manifest,config):

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

def verify_build_arch(manifest, config):
binaryname = 'lib%s.a' % manifest['moduleid']
binarypath = os.path.join('build', binaryname)
manifestarch = set(manifest['architectures'].split(' '))

output = subprocess.check_output('xcrun lipo -info %s' % binarypath, shell=True)

builtarch = set(output.split(':')[-1].strip().split(' '))

if ('arm64' not in builtarch):
warn('built module is missing 64-bit support.')

if (manifestarch != builtarch):
warn('there is discrepancy between the architectures specified in module manifest and compiled binary.')
warn('architectures in manifest: %s' % ', '.join(manifestarch))
warn('compiled binary architectures: %s' % ', '.join(builtarch))
die('please update manifest to match module binary architectures.')

def package_module(manifest,mf,config):
name = manifest['name'].lower()
moduleid = manifest['moduleid'].lower()
Expand All @@ -196,10 +223,26 @@ def package_module(manifest,mf,config):
for file, html in doc.iteritems():
filename = string.replace(file,'.md','.html')
zf.writestr('%s/documentation/%s'%(modulepath,filename),html)
for dn in ('assets','example','platform'):
if os.path.exists(dn):
zip_dir(zf,dn,'%s/%s' % (modulepath,dn),['README'])
zf.write('LICENSE','%s/LICENSE' % modulepath)

p = os.path.join(cwd, 'assets')
if not os.path.exists(p):
p = os.path.join(cwd, '..', 'assets')
if os.path.exists(p):
zip_dir(zf,p,'%s/%s' % (modulepath,'assets'),['README'])

for dn in ('example','platform'):
p = os.path.join(cwd, dn)
if not os.path.exists(p):
p = os.path.join(cwd, '..', dn)
if os.path.exists(p):
zip_dir(zf,p,'%s/%s' % (modulepath,dn),['README'],True)

license_file = os.path.join(cwd,'LICENSE')
if not os.path.exists(license_file):
license_file = os.path.join(cwd,'..','LICENSE')
if os.path.exists(license_file):
zf.write(license_file,'%s/LICENSE' % modulepath)

zf.write('module.xcconfig','%s/module.xcconfig' % modulepath)
exports_file = 'metadata.json'
if os.path.exists(exports_file):
Expand All @@ -218,6 +261,6 @@ def package_module(manifest,mf,config):

compile_js(manifest,config)
build_module(manifest,config)
verify_build_arch(manifest, config)
package_module(manifest,mf,config)
sys.exit(0)

2 changes: 1 addition & 1 deletion mobile/ios/titanium.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// OF YOUR TITANIUM SDK YOU'RE BUILDING FOR
//
//
TITANIUM_SDK_VERSION = 3.5.0.GA
TITANIUM_SDK_VERSION = 3.5.1.GA


//
Expand Down
2 changes: 1 addition & 1 deletion mobile/ios/vendor/couchbase-lite-ios
Submodule couchbase-lite-ios updated 57 files
+16 −32 CouchbaseLite.xcodeproj/project.pbxproj
+77 −0 CouchbaseLite.xcodeproj/xcshareddata/xcschemes/CBL Listener iOS.xcscheme
+27 −0 CouchbaseLite.xcodeproj/xcshareddata/xcschemes/Continuous iOS.xcscheme
+7 −1 Demo-Mac/DemoAppController.m
+27 −1 Listener/CBLListener.h
+28 −40 Listener/CBLListener.m
+26 −11 Listener/LiteServ.m
+1 −0 README.md
+1 −0 Source/API/APITestUtils.h
+88 −50 Source/API/APITests.m
+69 −7 Source/API/APIViewTests.m
+11 −2 Source/API/CBLDatabase.m
+2 −2 Source/API/CBLDocument.h
+1 −1 Source/API/CBLDocument.m
+2 −4 Source/API/CBLManager.m
+12 −0 Source/API/CBLModel+Properties.m
+2 −1 Source/API/CBLModel.h
+1 −1 Source/API/CBLModel.m
+5 −0 Source/API/CBLQuery.h
+85 −43 Source/API/CBLQuery.m
+5 −1 Source/API/CBLReplication.h
+13 −5 Source/API/CBLReplication.m
+1 −0 Source/API/CouchbaseLitePrivate.h
+1 −1 Source/API/Extras/CBLIncrementalStore.m
+12 −12 Source/API/Extras/CBLIncrementalStoreTests.m
+50 −11 Source/API/ModelTests.m
+21 −0 Source/API/ReplicationAPITests.m
+3 −2 Source/CBJSONEncoder.m
+5 −0 Source/CBLBatcher.m
+21 −7 Source/CBLDatabase+Insertion.m
+7 −1 Source/CBLDatabase+Internal.h
+63 −50 Source/CBLDatabase+Internal.m
+29 −11 Source/CBLJSViewCompiler.m
+20 −0 Source/CBLJSViewCompiler_Test.m
+6 −0 Source/CBLMisc.h
+47 −3 Source/CBLMisc.m
+4 −0 Source/CBLRemoteRequest.m
+87 −7 Source/CBLReplicator_Tests.m
+30 −4 Source/CBLRouter_Tests.m
+1 −0 Source/CBLSequenceMap.h
+3 −0 Source/CBLSequenceMap.m
+1 −0 Source/CBLStatus.h
+1 −0 Source/CBLStatus.m
+21 −1 Source/CBL_Puller.m
+4 −0 Source/CBL_Replicator.h
+52 −12 Source/CBL_Replicator.m
+5 −1 Source/CBL_Router+Handlers.m
+26 −1 Source/CBL_Router.m
+11 −7 Source/CBL_Shared.m
+2 −0 Source/ChangeTracker/CBLChangeTracker.h
+1 −0 Source/ChangeTracker/CBLChangeTracker.m
+16 −1 Source/ChangeTracker/CBLSocketChangeTracker.m
+21 −1 Source/ChangeTracker/CBLWebSocketChangeTracker.m
+1 −0 Source/CouchbaseLite.exp
+14 −1 Source/CouchbaseLitePrefix.h
+1 −1 vendor/MYUtilities
+1 −1 vendor/WebSockets-Cocoa
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"host": "10.8.17.21",
"host": "10.8.169.18",
"port": 59840,
"dbname": "elements"
}
2 changes: 1 addition & 1 deletion mobile/noarch/testapp/tiapp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<target device="blackberry">false</target>
<target device="android">true</target>
</deployment-targets>
<sdk-version>3.5.0.GA</sdk-version>
<sdk-version>3.5.1.GA</sdk-version>
<id>com.obscure.titouchdb</id>
<name>testapp</name>
<version>1.0</version>
Expand Down

0 comments on commit e60c923

Please sign in to comment.