diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6b66838 --- /dev/null +++ b/.gitignore @@ -0,0 +1,23 @@ +.DS_Store +tmp +bin +build + +*/*/modules +*/*/modules* +.apt_generated +build.properties +.svn +*.pyc +*~.nib/ +*.pbxuser +*.perspective +*.perspectivev3 +*.xcworkspace/ +xcuserdata +*.xcuserstate +*.xcuserdata* + +/metadata.json +/dist +/metadata.json diff --git a/Classes/TiScannerModule.h b/Classes/TiScannerModule.h new file mode 100644 index 0000000..a217115 --- /dev/null +++ b/Classes/TiScannerModule.h @@ -0,0 +1,17 @@ +/** + * titanium-scanner + * + * Created by Your Name + * Copyright (c) 2019 Your Company. All rights reserved. + */ + +#import +#import +#import "TiModule.h" + +@interface TiScannerModule : TiModule { + VNDocumentCameraViewController *_scannerViewController; + VNDocumentCameraScan *_currentScan; +} + +@end diff --git a/Classes/TiScannerModule.m b/Classes/TiScannerModule.m new file mode 100644 index 0000000..6c25dec --- /dev/null +++ b/Classes/TiScannerModule.m @@ -0,0 +1,88 @@ +/** + * titanium-scanner + * + * Created by Your Name + * Copyright (c) 2019 Your Company. All rights reserved. + */ + +#import +#import "TiScannerModule.h" +#import "TiBase.h" +#import "TiHost.h" +#import "TiUtils.h" + +@implementation TiScannerModule + +#pragma mark Internal + +- (id)moduleGUID +{ + return @"558d8ef6-a01d-4474-ac25-777fdecf86a8"; +} + +- (NSString *)moduleId +{ + return @"ti.scanner"; +} + +#pragma Public APIs + +- (NSNumber *)isSupported:(id)unused +{ + return @(VNDocumentCameraViewController.supported); +} + +- (void)showScanner:(id)value +{ + [[TiApp app] showModalController:[self scannerViewController] animated:YES]; +} + +- (TiBlob *)imageOfPageAtIndex:(id)index +{ + ENSURE_SINGLE_ARG(index, NSNumber); + + if (_currentScan == nil) { + return nil; + } + + UIImage *image = [_currentScan imageOfPageAtIndex:[(NSNumber *)index integerValue]]; + TiBlob *blob = [[TiBlob alloc] initWithImage:image]; + + return blob; +} + +#pragma mark Utils + +- (VNDocumentCameraViewController *)scannerViewController +{ + if (_scannerViewController == nil) { + _scannerViewController = [VNDocumentCameraViewController new]; + _scannerViewController.delegate = self; + } + + return _scannerViewController; +} + +#pragma mark VNDocumentCameraViewControllerDelegate + +- (void)documentCameraViewControllerDidCancel:(VNDocumentCameraViewController *)controller +{ + [self fireEvent:@"cancel"]; + [controller dismissViewControllerAnimated:YES completion:nil]; +} + +- (void)documentCameraViewController:(VNDocumentCameraViewController *)controller didFailWithError:(NSError *)error +{ + [self fireEvent:@"error" withObject:@{ @"error": error.localizedDescription }]; + [controller dismissViewControllerAnimated:YES completion:nil]; +} + +- (void)documentCameraViewController:(VNDocumentCameraViewController *)controller didFinishWithScan:(VNDocumentCameraScan *)scan +{ + _currentScan = scan; + + [self fireEvent:@"success" withObject:@{ @"count": @(scan.pageCount), @"title": NULL_IF_NIL(scan.title) }]; + [controller dismissViewControllerAnimated:YES completion:nil]; +} + +@end diff --git a/Classes/TiScannerModuleAssets.h b/Classes/TiScannerModuleAssets.h new file mode 100644 index 0000000..247c993 --- /dev/null +++ b/Classes/TiScannerModuleAssets.h @@ -0,0 +1,12 @@ +/** + * This is a generated file. Do not edit or your changes will be lost + */ + +@interface TiScannerModuleAssets : NSObject { + +} + +- (NSData *)moduleAsset; +- (NSData *)resolveModuleAsset:(NSString*)path; + +@end diff --git a/Classes/TiScannerModuleAssets.m b/Classes/TiScannerModuleAssets.m new file mode 100644 index 0000000..3968f24 --- /dev/null +++ b/Classes/TiScannerModuleAssets.m @@ -0,0 +1,24 @@ +/** + * This is a generated file. Do not edit or your changes will be lost + */ +#import "TiScannerModuleAssets.h" + +extern NSData* filterDataInRange(NSData* thedata, NSRange range); + +@implementation TiScannerModuleAssets + +- (NSData *)moduleAsset +{ + + + return nil; +} + +- (NSData *)resolveModuleAsset:(NSString *)path +{ + + + return nil; +} + +@end diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..1817727 --- /dev/null +++ b/LICENSE @@ -0,0 +1,7 @@ +Copyright 2019 Hans Knöchel + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..fef4122 --- /dev/null +++ b/README.md @@ -0,0 +1,69 @@ +# Titanium iOS 13+ Document Scanner + +Use the iOS 13+ `VisionKit` document scanner API in Appcelerator Titanium. + +## Requirements + +- [x] Titanium SDK 8.2.0+ +- [x] iOS 13+ + +## Example + +```js +var Scanner = require('ti.scanner'); + +var win = Ti.UI.createWindow({ + backgroundColor: '#fff' +}); + +var btn = Ti.UI.createButton({ + title: 'Scan Document' +}); + +btn.addEventListener('click', function () { + Ti.Media.requestCameraPermissions(event => { + if (!event.success) { + alert('No camera permissions'); + return; + } + Scanner.showScanner(); + }); +}); + +Scanner.addEventListener('cancel', function () { + Ti.API.warn('Cancelled …'); +}); + +Scanner.addEventListener('error', function (event) { + Ti.API.error('Errored …'); + Ti.API.error(event.error); +}); + +Scanner.addEventListener('success', function (event) { + Ti.API.warn('Succeeded …'); + Ti.API.warn(event); + + var win2 = Ti.UI.createWindow({ + backgroundColor: '#333' + }); + + var image = Ti.UI.createImageView({ + height: '70%', + image: Scanner.imageOfPageAtIndex(0) /* Or many images via "event.pageCount" */ + }); + + win2.add(image); + win2.open(); +}); + +win.add(btn); +win.open(); +``` + +## License + +MIT + +## Author + +Hans Knöchel diff --git a/TiScanner_Prefix.pch b/TiScanner_Prefix.pch new file mode 100644 index 0000000..186d246 --- /dev/null +++ b/TiScanner_Prefix.pch @@ -0,0 +1,5 @@ + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/example/app.js b/example/app.js new file mode 100644 index 0000000..70fdcde --- /dev/null +++ b/example/app.js @@ -0,0 +1,42 @@ +var Scanner = require('ti.scanner'); + +var win = Ti.UI.createWindow({ + backgroundColor: '#fff' +}); + +var btn = Ti.UI.createButton({ + title: 'Scan Document' +}); + +btn.addEventListener('click', function () { + Ti.Media.requestCameraPermissions(event => { + if (!event.success) { + alert('No camera permissions'); + return; + } + Scanner.showScanner({}); + }); +}); + +Scanner.addEventListener('cancel', function () { + Ti.API.warn('Cancelled …'); +}); + +Scanner.addEventListener('error', function (event) { + Ti.API.error('Errored …'); + Ti.API.error(event.error); +}); + +Scanner.addEventListener('success', function (event) { + Ti.API.warn('Succeeded …'); + Ti.API.warn(event); + + var win2 = Ti.UI.createWindow({ backgroundColor: '#333' }); + var image = Ti.UI.createImageView({ height: '70%', image: Scanner.imageOfPageAtIndex(0) /* Or many images via "event.pageCount" */ }); + + win2.add(image); + win2.open(); +}); + +win.add(btn); +win.open(); \ No newline at end of file diff --git a/manifest b/manifest new file mode 100644 index 0000000..547fdb3 --- /dev/null +++ b/manifest @@ -0,0 +1,18 @@ +# +# this is your module manifest and used by Titanium +# during compilation, packaging, distribution, etc. +# +version: 1.0.0 +apiversion: 2 +architectures: armv7 arm64 i386 x86_64 +description: titanium-scanner +author: Hans Knöchel +license: MIT +copyright: Copyright (c) 2019 by Hans Knöchel + +# these should not be edited +name: titanium-scanner +moduleid: ti.scanner +guid: 558d8ef6-a01d-4474-ac25-777fdecf86a8 +platform: iphone +minsdk: 8.2.0 diff --git a/module.xcconfig b/module.xcconfig new file mode 100644 index 0000000..9969d7c --- /dev/null +++ b/module.xcconfig @@ -0,0 +1,15 @@ +// +// PLACE ANY BUILD DEFINITIONS IN THIS FILE AND THEY WILL BE +// PICKED UP DURING THE APP BUILD FOR YOUR MODULE +// +// see the following webpage for instructions on the settings +// for this file: +// https://developer.apple.com/library/content/featuredarticles/XcodeConcepts/Concept-Build_Settings.html +// + +// +// How to manually add a Framework (example) +// Note: Titanium SDK 6.2.2+ detects and links frameworks automatically +// + +OTHER_LDFLAGS=$(inherited) -weak_framework Vision -weak_framework VisionKit diff --git a/timodule.xml b/timodule.xml new file mode 100644 index 0000000..ae31597 --- /dev/null +++ b/timodule.xml @@ -0,0 +1,11 @@ + + + + + + + + diff --git a/titanium-scanner.xcodeproj/project.pbxproj b/titanium-scanner.xcodeproj/project.pbxproj new file mode 100644 index 0000000..3ea9f25 --- /dev/null +++ b/titanium-scanner.xcodeproj/project.pbxproj @@ -0,0 +1,475 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXAggregateTarget section */ + 24416B8111C4CA220047AFDD /* Build & Test */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 24416B8A11C4CA520047AFDD /* Build configuration list for PBXAggregateTarget "Build & Test" */; + buildPhases = ( + 24416B8011C4CA220047AFDD /* ShellScript */, + ); + dependencies = ( + 24416B8511C4CA280047AFDD /* PBXTargetDependency */, + ); + name = "Build & Test"; + productName = "Build & test"; + }; +/* End PBXAggregateTarget section */ + +/* Begin PBXBuildFile section */ + 24DD6CF91134B3F500162E58 /* TiScannerModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 24DD6CF71134B3F500162E58 /* TiScannerModule.h */; }; + 24DD6CFA1134B3F500162E58 /* TiScannerModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 24DD6CF81134B3F500162E58 /* TiScannerModule.m */; }; + 24DE9E1111C5FE74003F90F6 /* TiScannerModuleAssets.h in Headers */ = {isa = PBXBuildFile; fileRef = 24DE9E0F11C5FE74003F90F6 /* TiScannerModuleAssets.h */; }; + 24DE9E1211C5FE74003F90F6 /* TiScannerModuleAssets.m in Sources */ = {isa = PBXBuildFile; fileRef = 24DE9E1011C5FE74003F90F6 /* TiScannerModuleAssets.m */; }; + AA747D9F0F9514B9006C5449 /* TiScanner_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = AA747D9E0F9514B9006C5449 /* TiScanner_Prefix.pch */; }; + AACBBE4A0F95108600F1A2B1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AACBBE490F95108600F1A2B1 /* Foundation.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 24416B8411C4CA280047AFDD /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = D2AAC07D0554694100DB518D; + remoteInfo = "titanium-scanner"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 24DD6CF71134B3F500162E58 /* TiScannerModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TiScannerModule.h; path = Classes/TiScannerModule.h; sourceTree = ""; }; + 24DD6CF81134B3F500162E58 /* TiScannerModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TiScannerModule.m; path = Classes/TiScannerModule.m; sourceTree = ""; }; + 24DD6D1B1134B66800162E58 /* titanium.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = titanium.xcconfig; sourceTree = ""; }; + 24DE9E0F11C5FE74003F90F6 /* TiScannerModuleAssets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TiScannerModuleAssets.h; path = Classes/TiScannerModuleAssets.h; sourceTree = ""; }; + 24DE9E1011C5FE74003F90F6 /* TiScannerModuleAssets.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TiScannerModuleAssets.m; path = Classes/TiScannerModuleAssets.m; sourceTree = ""; }; + AA747D9E0F9514B9006C5449 /* TiScanner_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TiScanner_Prefix.pch; sourceTree = SOURCE_ROOT; }; + AACBBE490F95108600F1A2B1 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + D2AAC07E0554694100DB518D /* libti.scanner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libti.scanner.a; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + D2AAC07C0554694100DB518D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + AACBBE4A0F95108600F1A2B1 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 034768DFFF38A50411DB9C8B /* Products */ = { + isa = PBXGroup; + children = ( + D2AAC07E0554694100DB518D /* libti.scanner.a */, + ); + name = Products; + sourceTree = ""; + }; + 0867D691FE84028FC02AAC07 /* titanium-scanner */ = { + isa = PBXGroup; + children = ( + 08FB77AEFE84172EC02AAC07 /* Classes */, + 32C88DFF0371C24200C91783 /* Other Sources */, + 0867D69AFE84028FC02AAC07 /* Frameworks */, + 034768DFFF38A50411DB9C8B /* Products */, + ); + name = "titanium-scanner"; + sourceTree = ""; + }; + 0867D69AFE84028FC02AAC07 /* Frameworks */ = { + isa = PBXGroup; + children = ( + AACBBE490F95108600F1A2B1 /* Foundation.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 08FB77AEFE84172EC02AAC07 /* Classes */ = { + isa = PBXGroup; + children = ( + 24DE9E0F11C5FE74003F90F6 /* TiScannerModuleAssets.h */, + 24DE9E1011C5FE74003F90F6 /* TiScannerModuleAssets.m */, + 24DD6CF71134B3F500162E58 /* TiScannerModule.h */, + 24DD6CF81134B3F500162E58 /* TiScannerModule.m */, + ); + name = Classes; + sourceTree = ""; + }; + 32C88DFF0371C24200C91783 /* Other Sources */ = { + isa = PBXGroup; + children = ( + AA747D9E0F9514B9006C5449 /* TiScanner_Prefix.pch */, + 24DD6D1B1134B66800162E58 /* titanium.xcconfig */, + ); + name = "Other Sources"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + D2AAC07A0554694100DB518D /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + AA747D9F0F9514B9006C5449 /* TiScanner_Prefix.pch in Headers */, + 24DD6CF91134B3F500162E58 /* TiScannerModule.h in Headers */, + 24DE9E1111C5FE74003F90F6 /* TiScannerModuleAssets.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + D2AAC07D0554694100DB518D /* titanium-scanner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1DEB921E08733DC00010E9CD /* Build configuration list for PBXNativeTarget "titanium-scanner" */; + buildPhases = ( + D2AAC07A0554694100DB518D /* Headers */, + D2AAC07B0554694100DB518D /* Sources */, + D2AAC07C0554694100DB518D /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "titanium-scanner"; + productName = "titanium-scanner"; + productReference = D2AAC07E0554694100DB518D /* libti.scanner.a */; + productType = "com.apple.product-type.library.static"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 0867D690FE84028FC02AAC07 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1020; + }; + buildConfigurationList = 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "titanium-scanner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 1; + knownRegions = ( + ja, + fr, + Base, + en, + de, + ); + mainGroup = 0867D691FE84028FC02AAC07 /* titanium-scanner */; + productRefGroup = 034768DFFF38A50411DB9C8B /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + D2AAC07D0554694100DB518D /* titanium-scanner */, + 24416B8111C4CA220047AFDD /* Build & Test */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXShellScriptBuildPhase section */ + 24416B8011C4CA220047AFDD /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "# shell script goes here\n\nappc run --project-dir \"${PROJECT_DIR}\"\nexit $?\n"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + D2AAC07B0554694100DB518D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 24DD6CFA1134B3F500162E58 /* TiScannerModule.m in Sources */, + 24DE9E1211C5FE74003F90F6 /* TiScannerModuleAssets.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 24416B8511C4CA280047AFDD /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = D2AAC07D0554694100DB518D /* titanium-scanner */; + targetProxy = 24416B8411C4CA280047AFDD /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 1DEB921F08733DC00010E9CD /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 24DD6D1B1134B66800162E58 /* titanium.xcconfig */; + buildSettings = { + CLANG_ENABLE_OBJC_ARC = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + DSTROOT = /tmp/TiScanner.dst; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = TiScanner_Prefix.pch; + GCC_PREPROCESSOR_DEFINITIONS = "TI_VERSION=$(TI_VERSION)"; + GCC_TREAT_WARNINGS_AS_ERRORS = NO; + GCC_VERSION = ""; + GCC_WARN_ABOUT_RETURN_TYPE = NO; + GCC_WARN_MISSING_PARENTHESES = NO; + GCC_WARN_SHADOW = NO; + GCC_WARN_STRICT_SELECTOR_MATCH = NO; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_PARAMETER = NO; + GCC_WARN_UNUSED_VALUE = NO; + GCC_WARN_UNUSED_VARIABLE = NO; + INSTALL_PATH = /usr/local/lib; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LIBRARY_SEARCH_PATHS = ""; + OTHER_CFLAGS = ( + "-DDEBUG", + "-DTI_POST_1_2", + ); + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = ti.scanner; + PROVISIONING_PROFILE = ""; + "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; + RUN_CLANG_STATIC_ANALYZER = NO; + SDKROOT = iphoneos; + USER_HEADER_SEARCH_PATHS = ""; + WARNING_CFLAGS = "-Wno-arc-performSelector-leaks"; + }; + name = Debug; + }; + 1DEB922008733DC00010E9CD /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 24DD6D1B1134B66800162E58 /* titanium.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ENABLE_OBJC_ARC = YES; + DEPLOYMENT_POSTPROCESSING = YES; + DSTROOT = /tmp/TiScanner.dst; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_MODEL_TUNING = G5; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = TiScanner_Prefix.pch; + GCC_PREPROCESSOR_DEFINITIONS = ( + "TI_VERSION=$(TI_VERSION)", + NDEBUG, + ); + GCC_TREAT_WARNINGS_AS_ERRORS = NO; + GCC_VERSION = ""; + GCC_WARN_ABOUT_RETURN_TYPE = NO; + GCC_WARN_MISSING_PARENTHESES = NO; + GCC_WARN_SHADOW = NO; + GCC_WARN_STRICT_SELECTOR_MATCH = NO; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_PARAMETER = NO; + GCC_WARN_UNUSED_VALUE = NO; + GCC_WARN_UNUSED_VARIABLE = NO; + INSTALL_PATH = /usr/local/lib; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LIBRARY_SEARCH_PATHS = ""; + OTHER_CFLAGS = "-DTI_POST_1_2"; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = ti.scanner; + RUN_CLANG_STATIC_ANALYZER = NO; + SDKROOT = iphoneos; + USER_HEADER_SEARCH_PATHS = ""; + WARNING_CFLAGS = "-Wno-arc-performSelector-leaks"; + }; + name = Release; + }; + 1DEB922308733DC00010E9CD /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 24DD6D1B1134B66800162E58 /* titanium.xcconfig */; + buildSettings = { + CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_CXX_LIBRARY = "compiler-default"; + CLANG_ENABLE_MODULES = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = NO; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = NO; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + DSTROOT = /tmp/TiScanner.dst; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = TiScanner_Prefix.pch; + GCC_PREPROCESSOR_DEFINITIONS = "TI_VERSION=$(TI_VERSION)"; + GCC_TREAT_WARNINGS_AS_ERRORS = NO; + GCC_VERSION = ""; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = NO; + GCC_WARN_MISSING_PARENTHESES = NO; + GCC_WARN_SHADOW = NO; + GCC_WARN_STRICT_SELECTOR_MATCH = NO; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_PARAMETER = NO; + GCC_WARN_UNUSED_VALUE = NO; + GCC_WARN_UNUSED_VARIABLE = NO; + INSTALL_PATH = /usr/local/lib; + ONLY_ACTIVE_ARCH = YES; + OTHER_CFLAGS = ( + "-DDEBUG", + "-DTI_POST_1_2", + ); + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = ti.scanner; + PROVISIONING_PROFILE = ""; + "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; + RUN_CLANG_STATIC_ANALYZER = NO; + SDKROOT = iphoneos; + USER_HEADER_SEARCH_PATHS = ""; + }; + name = Debug; + }; + 1DEB922408733DC00010E9CD /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 24DD6D1B1134B66800162E58 /* titanium.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_CXX_LIBRARY = "compiler-default"; + CLANG_ENABLE_MODULES = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = NO; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = NO; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + DSTROOT = /tmp/TiScanner.dst; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_MODEL_TUNING = G5; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = TiScanner_Prefix.pch; + GCC_PREPROCESSOR_DEFINITIONS = "TI_VERSION=$(TI_VERSION)"; + GCC_TREAT_WARNINGS_AS_ERRORS = NO; + GCC_VERSION = ""; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = NO; + GCC_WARN_MISSING_PARENTHESES = NO; + GCC_WARN_SHADOW = NO; + GCC_WARN_STRICT_SELECTOR_MATCH = NO; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_PARAMETER = NO; + GCC_WARN_UNUSED_VALUE = NO; + GCC_WARN_UNUSED_VARIABLE = NO; + INSTALL_PATH = /usr/local/lib; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + OTHER_CFLAGS = "-DTI_POST_1_2"; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = ti.scanner; + RUN_CLANG_STATIC_ANALYZER = NO; + SDKROOT = iphoneos; + USER_HEADER_SEARCH_PATHS = ""; + }; + name = Release; + }; + 24416B8211C4CA220047AFDD /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 24DD6D1B1134B66800162E58 /* titanium.xcconfig */; + buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + PRODUCT_NAME = "Build & test"; + }; + name = Debug; + }; + 24416B8311C4CA220047AFDD /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 24DD6D1B1134B66800162E58 /* titanium.xcconfig */; + buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + PRODUCT_NAME = "Build & test"; + ZERO_LINK = NO; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 1DEB921E08733DC00010E9CD /* Build configuration list for PBXNativeTarget "titanium-scanner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1DEB921F08733DC00010E9CD /* Debug */, + 1DEB922008733DC00010E9CD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "titanium-scanner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1DEB922308733DC00010E9CD /* Debug */, + 1DEB922408733DC00010E9CD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 24416B8A11C4CA520047AFDD /* Build configuration list for PBXAggregateTarget "Build & Test" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 24416B8211C4CA220047AFDD /* Debug */, + 24416B8311C4CA220047AFDD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 0867D690FE84028FC02AAC07 /* Project object */; +} diff --git a/titanium.xcconfig b/titanium.xcconfig new file mode 100644 index 0000000..1334f66 --- /dev/null +++ b/titanium.xcconfig @@ -0,0 +1,14 @@ +// +// +// CHANGE THESE VALUES TO REFLECT THE VERSION (AND LOCATION IF DIFFERENT) +// OF YOUR TITANIUM SDK YOU'RE BUILDING FOR +// +// +TITANIUM_SDK_VERSION = 8.2.0 + +// +// THESE SHOULD BE OK GENERALLY AS-IS +// +TITANIUM_SDK = ~/Library/Application Support/Titanium/mobilesdk/osx/$(TITANIUM_SDK_VERSION) +HEADER_SEARCH_PATHS = $(inherited) "$(TITANIUM_SDK)/iphone/include" +FRAMEWORK_SEARCH_PATHS = $(inherited) "$(TITANIUM_SDK)/iphone/Frameworks"