Skip to content

Commit 83982aa

Browse files
rigor789darind
andauthored
feat: apple silicon support (NativeScript#108)
* feat: Add support for Apple silicon * feat: Multi-arch metadata generator * build: simplify build scripts Co-authored-by: Darin Dimitrov <[email protected]>
1 parent 6ec9335 commit 83982aa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+597
-92
lines changed

.gitmodules

+4
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@
22
path = libffi
33
url = https://github.com/NativeScript/libffi.git
44
branch = darind/v8-ios
5+
[submodule "llvm"]
6+
path = llvm
7+
url = https://github.com/NativeScript/ios-llvm.git
8+
branch = master

.travis.yml

+1-5
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,10 @@ os: osx
22
osx_image: xcode11
33
language: objective-c
44
git:
5-
submodules: false
5+
submodules: true
66
depth: 1
77

88
before_install:
9-
- curl https://releases.llvm.org/8.0.0/clang+llvm-8.0.0-x86_64-apple-darwin.tar.xz --output $HOME/clang+llvm-8.0.0-x86_64-apple-darwin.tar.xz
10-
- tar -xzf $HOME/clang+llvm-8.0.0-x86_64-apple-darwin.tar.xz --directory $HOME
11-
- export PATH=$PATH:$HOME/clang+llvm-8.0.0-x86_64-apple-darwin/bin
12-
- llvm-config --version
139
- cmake --version
1410
- make --version
1511
- brew install chargepoint/xcparse/xcparse
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>AvailableLibraries</key>
6+
<array>
7+
<dict>
8+
<key>LibraryIdentifier</key>
9+
<string>ios-arm64_x86_64-simulator</string>
10+
<key>LibraryPath</key>
11+
<string>TNSWidgets.framework</string>
12+
<key>SupportedArchitectures</key>
13+
<array>
14+
<string>arm64</string>
15+
<string>x86_64</string>
16+
</array>
17+
<key>SupportedPlatform</key>
18+
<string>ios</string>
19+
<key>SupportedPlatformVariant</key>
20+
<string>simulator</string>
21+
</dict>
22+
<dict>
23+
<key>LibraryIdentifier</key>
24+
<string>ios-arm64</string>
25+
<key>LibraryPath</key>
26+
<string>TNSWidgets.framework</string>
27+
<key>SupportedArchitectures</key>
28+
<array>
29+
<string>arm64</string>
30+
</array>
31+
<key>SupportedPlatform</key>
32+
<string>ios</string>
33+
</dict>
34+
</array>
35+
<key>CFBundlePackageType</key>
36+
<string>XFWK</string>
37+
<key>XCFrameworkFormatVersion</key>
38+
<string>1.0</string>
39+
</dict>
40+
</plist>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//
2+
// NSData+Async.h
3+
// TNSWidgets
4+
//
5+
// Created by Peter Staev on 7.08.19.
6+
// Copyright © 2019 Telerik A D. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
11+
NS_ASSUME_NONNULL_BEGIN
12+
13+
@interface NSData (Async)
14+
15+
+ (void)dataWithContentsOfFile:(nonnull NSString*)path
16+
completion:(void (^) (NSData*))callback;
17+
18+
- (void)writeToFile:(nonnull NSString*) path
19+
atomically:(BOOL)atomically
20+
completion:(void (^) ())callback;
21+
22+
@end
23+
24+
NS_ASSUME_NONNULL_END
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//
2+
// NSString+Async.h
3+
// TNSWidgets
4+
//
5+
// Created by Peter Staev on 5.08.19.
6+
// Copyright © 2019 Telerik A D. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
11+
NS_ASSUME_NONNULL_BEGIN
12+
13+
@interface NSString (Async)
14+
15+
+ (void)stringWithContentsOfFile:(nonnull NSString*)path
16+
encoding:(NSStringEncoding)enc
17+
completion:(void (^) (NSString*, NSError*))callback;
18+
19+
- (void)writeToFile:(nonnull NSString*) path
20+
atomically:(BOOL)atomically
21+
encoding:(NSStringEncoding)enc
22+
completion:(void (^) (NSError*))callback;
23+
@end
24+
25+
NS_ASSUME_NONNULL_END

AppWithModules/Frameworks/TNSWidgets.framework/Headers/TNSWidgets.h renamed to AppWithModules/Frameworks/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers/TNSWidgets.h

+2
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ FOUNDATION_EXPORT const unsigned char TNSWidgetsVersionString[];
2020
#import "UIView+PassThroughParent.h"
2121
#import "TNSLabel.h"
2222
#import "TNSProcess.h"
23+
#import "NSString+Async.h"
24+
#import "NSData+Async.h"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//
2+
// NSObject+Swizzling.h
3+
// TNSWidgets
4+
//
5+
// Created by Manol Donev on 21.08.18.
6+
// Copyright © 2018 Telerik A D. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
#import <objc/runtime.h>
11+
12+
13+
@interface NSObject (Swizzling)
14+
15+
+ (void)swizzleInstanceMethodWithOriginalSelector:(SEL)originalSelector fromClass:(Class)classContainigOriginalSel withSwizzlingSelector:(SEL)swizzlingSelector;
16+
17+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//
2+
// UIView+PropertyBag.h
3+
// TNSWidgets
4+
//
5+
// Created by Manol Donev on 21.08.18.
6+
// Copyright © 2018 Telerik A D. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
#import <UIKit/UIKit.h>
11+
12+
13+
@interface UIView (PropertyBag)
14+
15+
- (id) propertyValueForKey:(NSString*) key;
16+
- (void) setPropertyValue:(id) value forKey:(NSString*) key;
17+
18+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//
2+
// NSData+Async.h
3+
// TNSWidgets
4+
//
5+
// Created by Peter Staev on 7.08.19.
6+
// Copyright © 2019 Telerik A D. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
11+
NS_ASSUME_NONNULL_BEGIN
12+
13+
@interface NSData (Async)
14+
15+
+ (void)dataWithContentsOfFile:(nonnull NSString*)path
16+
completion:(void (^) (NSData*))callback;
17+
18+
- (void)writeToFile:(nonnull NSString*) path
19+
atomically:(BOOL)atomically
20+
completion:(void (^) ())callback;
21+
22+
@end
23+
24+
NS_ASSUME_NONNULL_END
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//
2+
// NSString+Async.h
3+
// TNSWidgets
4+
//
5+
// Created by Peter Staev on 5.08.19.
6+
// Copyright © 2019 Telerik A D. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
11+
NS_ASSUME_NONNULL_BEGIN
12+
13+
@interface NSString (Async)
14+
15+
+ (void)stringWithContentsOfFile:(nonnull NSString*)path
16+
encoding:(NSStringEncoding)enc
17+
completion:(void (^) (NSString*, NSError*))callback;
18+
19+
- (void)writeToFile:(nonnull NSString*) path
20+
atomically:(BOOL)atomically
21+
encoding:(NSStringEncoding)enc
22+
completion:(void (^) (NSError*))callback;
23+
@end
24+
25+
NS_ASSUME_NONNULL_END
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//
2+
// TNSLabel.h
3+
// TNSWidgets
4+
//
5+
// Created by Hristo Hristov on 6/9/16.
6+
// Copyright © 2016 Telerik A D. All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
11+
@interface TNSLabel : UILabel
12+
13+
@property(nonatomic) UIEdgeInsets padding;
14+
@property(nonatomic) UIEdgeInsets borderThickness;
15+
16+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//
2+
// TNSProcess.h
3+
// TNSWidgets
4+
//
5+
// Created by Panayot Cankov on 15/05/2017.
6+
// Copyright © 2017 Telerik A D. All rights reserved.
7+
//
8+
9+
#ifndef TNSProcess_h
10+
#define TNSProcess_h
11+
12+
#import <Foundation/Foundation.h>
13+
14+
/**
15+
* Get the milliseconds since the process started.
16+
*/
17+
double __tns_uptime();
18+
19+
/**
20+
* Provides access to NSLog. The runtime implementation of console.log is filtered in release.
21+
* We rarely need to log in release but in cases such as when logging app startup times in release,
22+
* this will be convenient shortcut to NSLog, NSLog is not exposed.
23+
*
24+
* Please note the {N} CLI may be filtering app output, prefixing the message with "CONSOLE LOG"
25+
* will make the logs visible in "tns run ios --release" builds.
26+
*/
27+
void __nslog(NSString* message);
28+
29+
#endif /* TNSProcess_h */
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//
2+
// TNSWidgets.h
3+
// TNSWidgets
4+
//
5+
// Created by Panayot Cankov on 4/27/16.
6+
// Copyright © 2016 Telerik A D. All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
11+
//! Project version number for TNSWidgets.
12+
FOUNDATION_EXPORT double TNSWidgetsVersionNumber;
13+
14+
//! Project version string for TNSWidgets.
15+
FOUNDATION_EXPORT const unsigned char TNSWidgetsVersionString[];
16+
17+
// In this header, you should import all the public headers of your framework using statements like #import <TNSWidgets/PublicHeader.h>
18+
19+
#import "UIImage+TNSBlocks.h"
20+
#import "UIView+PassThroughParent.h"
21+
#import "TNSLabel.h"
22+
#import "TNSProcess.h"
23+
#import "NSString+Async.h"
24+
#import "NSData+Async.h"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//
2+
// UIImage+UIImage_Async.h
3+
// TKImageAsync
4+
//
5+
// Created by Panayot Cankov on 4/18/16.
6+
// Copyright © 2016 Telerik A D. All rights reserved.
7+
//
8+
9+
@interface UIImage (TNSBlocks)
10+
11+
/**
12+
* Similar to imageNamed: however it runs on a separate queue so the UI thread is not blocked.
13+
* It also draws the UIImage in a small thumb to force decoding potentially avoiding UI hicckups when displayed.
14+
*/
15+
+ (void) tns_safeDecodeImageNamed: (NSString*) name completion: (void (^) (UIImage*))callback;
16+
17+
/**
18+
* Same as imageNamed, however calls to this method are sinchronized to be thread safe in iOS8 along with calls to tns_safeImageNamed and tns_safeDecodeImageNamed:completion:
19+
* imageNamed is thread safe in iOS 9 and later so in later versions this methods simply fallbacks to imageNamed:
20+
*/
21+
+ (UIImage*) tns_safeImageNamed: (NSString*) name;
22+
23+
+ (void) tns_decodeImageWithData: (NSData*) data completion: (void (^) (UIImage*))callback;
24+
+ (void) tns_decodeImageWidthContentsOfFile: (NSString*) file completion: (void (^) (UIImage*))callback;
25+
26+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//
2+
// UIView+PassThroughParent.h
3+
// TNSWidgets
4+
//
5+
// Created by Manol Donev on 21.08.18.
6+
// Copyright © 2018 Telerik A D. All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
11+
12+
@interface UIView (PassThroughParent)
13+
14+
- (BOOL) passThroughParent;
15+
- (void) setPassThroughParent:(BOOL) passThroughParent;
16+
17+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
framework module TNSWidgets {
2+
umbrella header "TNSWidgets.h"
3+
4+
export *
5+
module * { export * }
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//
2+
// NSObject+Swizzling.h
3+
// TNSWidgets
4+
//
5+
// Created by Manol Donev on 21.08.18.
6+
// Copyright © 2018 Telerik A D. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
#import <objc/runtime.h>
11+
12+
13+
@interface NSObject (Swizzling)
14+
15+
+ (void)swizzleInstanceMethodWithOriginalSelector:(SEL)originalSelector fromClass:(Class)classContainigOriginalSel withSwizzlingSelector:(SEL)swizzlingSelector;
16+
17+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//
2+
// UIView+PropertyBag.h
3+
// TNSWidgets
4+
//
5+
// Created by Manol Donev on 21.08.18.
6+
// Copyright © 2018 Telerik A D. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
#import <UIKit/UIKit.h>
11+
12+
13+
@interface UIView (PropertyBag)
14+
15+
- (id) propertyValueForKey:(NSString*) key;
16+
- (void) setPropertyValue:(id) value forKey:(NSString*) key;
17+
18+
@end

0 commit comments

Comments
 (0)