Skip to content

Commit 8a57f07

Browse files
amgleitmanalloy
andauthored
feat: Add macOS support for progress-view (#42)
Co-authored-by: Eloy Durán <[email protected]>
1 parent 6059704 commit 8a57f07

34 files changed

+2548
-27
lines changed

README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
[![Build Status][build-badge]][build]
44
[![Version][version-badge]][package]
5-
![Supports iOS][support-badge]
5+
![Platforms][support-badge]
66
[![MIT License][license-badge]][license]
77
[![Lean Core Badge][lean-core-badge]][lean-core-issue]
88

9-
ProgressBar Component for iOS (based on UIProgressView) and Windows.
9+
ProgressBar Component for macOS, iOS (based on UIProgressView), and Windows.
1010

11-
| iOS | Windows |
12-
| --- | --- |
13-
| <img src="https://user-images.githubusercontent.com/6936373/73007429-e09dd500-3e4f-11ea-85dd-ce06be668975.png" width="320"> | <img src="https://user-images.githubusercontent.com/42554868/87102503-fb4de580-c206-11ea-98f7-b9f911d115f8.gif" width="320" height="500"> >
11+
| macOS | iOS | Windows |
12+
| ----- | --- | --- |
13+
| <img src="https://user-images.githubusercontent.com/717674/90926972-0325ab80-e3a9-11ea-86e3-1f9ca6df60f3.png" width="480"> | <img src="https://user-images.githubusercontent.com/6936373/73007429-e09dd500-3e4f-11ea-85dd-ce06be668975.png" width="320"> | <img src="https://user-images.githubusercontent.com/42554868/87102503-fb4de580-c206-11ea-98f7-b9f911d115f8.gif" width="320" height="500"> >
1414

1515
## Getting started
1616

@@ -110,6 +110,12 @@ Add ProgressView like this
110110
2. cd into example/ios and run `pod install`
111111
4. cd back into progress-view and run `yarn ios`
112112

113+
#### macOS
114+
1. Clone branch
115+
2. cd into progress-view and run `yarn install`
116+
2. cd into example/macos/example/macos and run `pod install`
117+
4. Open the newly created example.xcworkspace in Xcode, build, and run
118+
113119
## Reference
114120

115121
### Props
@@ -209,7 +215,7 @@ The library is released under the MIT license. For more information see [`LICENS
209215
[build]: https://circleci.com/gh/react-native-community/progress-view
210216
[version-badge]: https://img.shields.io/npm/v/@react-native-community/progress-view.svg?style=flat-square
211217
[package]: https://www.npmjs.com/package/@react-native-community/progress-view
212-
[support-badge]:https://img.shields.io/badge/platforms-ios-lightgrey.svg?style=flat-square
218+
[support-badge]:https://img.shields.io/badge/platforms-ios%20|%20macos-lightgrey.svg?style=flat-square
213219
[license-badge]: https://img.shields.io/npm/l/@react-native-community/progress-view.svg?style=flat-square
214220
[license]: https://opensource.org/licenses/MIT
215221
[lean-core-badge]: https://img.shields.io/badge/Lean%20Core-Extracted-brightgreen.svg?style=flat-square

example/macos/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# CocoaPods
2+
Pods/
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#include "example.shared.xcconfig"
2+
3+
DEAD_CODE_STRIPPING = NO
4+
ENABLE_TESTABILITY = YES
5+
GCC_DYNAMIC_NO_PIC = NO
6+
GCC_OPTIMIZATION_LEVEL = 0
7+
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) DEBUG=1
8+
MTL_ENABLE_DEBUG_INFO = YES
9+
ONLY_ACTIVE_ARCH = YES
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#include "example.shared.xcconfig"
2+
3+
COPY_PHASE_STRIP = YES
4+
ENABLE_NS_ASSERTIONS = NO
5+
MTL_ENABLE_DEBUG_INFO = NO
6+
VALIDATE_PRODUCT = YES
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
PRODUCT_NAME = example
2+
3+
ALWAYS_SEARCH_USER_PATHS = NO
4+
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon
5+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES
6+
CLANG_CXX_LANGUAGE_STANDARD = gnu++0x
7+
CLANG_CXX_LIBRARY = libc++
8+
CLANG_ENABLE_MODULES = YES
9+
CLANG_ENABLE_OBJC_ARC = YES
10+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES
11+
CLANG_WARN_BOOL_CONVERSION = YES
12+
CLANG_WARN_COMMA = YES
13+
CLANG_WARN_CONSTANT_CONVERSION = YES
14+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES
15+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR
16+
CLANG_WARN_EMPTY_BODY = YES
17+
CLANG_WARN_ENUM_CONVERSION = YES
18+
CLANG_WARN_INFINITE_RECURSION = YES
19+
CLANG_WARN_INT_CONVERSION = YES
20+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES
21+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES
22+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES
23+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR
24+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES
25+
CLANG_WARN_STRICT_PROTOTYPES = YES
26+
CLANG_WARN_SUSPICIOUS_MOVE = YES
27+
CLANG_WARN_UNREACHABLE_CODE = YES
28+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES
29+
CURRENT_PROJECT_VERSION = 1
30+
ENABLE_STRICT_OBJC_MSGSEND = YES
31+
GCC_C_LANGUAGE_STANDARD = gnu99
32+
GCC_NO_COMMON_BLOCKS = YES
33+
GCC_SYMBOLS_PRIVATE_EXTERN = NO
34+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES
35+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR
36+
GCC_WARN_UNDECLARED_SELECTOR = YES
37+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE
38+
GCC_WARN_UNUSED_FUNCTION = YES
39+
GCC_WARN_UNUSED_VARIABLE = YES
40+
INFOPLIST_FILE = example-macos/Info.plist
41+
LD_RUNPATH_SEARCH_PATHS = /usr/lib/swift $(inherited) @executable_path/Frameworks
42+
LIBRARY_SEARCH_PATHS = $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) $(inherited)
43+
MACOSX_DEPLOYMENT_TARGET = 10.14
44+
OTHER_LDFLAGS = $(inherited) -ObjC -lc++
45+
PRODUCT_BUNDLE_IDENTIFIER = org.reactjs.native.$(PRODUCT_NAME:rfc1034identifier)
46+
SDKROOT = macosx

example/macos/Podfile

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
require_relative '../../node_modules/@react-native-community/cli-platform-ios/native_modules'
2+
3+
abstract_target 'Shared' do
4+
pod 'react-native-progress-view', :path => '../..'
5+
# Pods for example
6+
pod 'FBLazyVector', :path => '../../node_modules/react-native-macos/Libraries/FBLazyVector'
7+
pod 'FBReactNativeSpec', :path => '../../node_modules/react-native-macos/Libraries/FBReactNativeSpec'
8+
pod 'RCTRequired', :path => '../../node_modules/react-native-macos/Libraries/RCTRequired'
9+
pod 'RCTTypeSafety', :path => '../../node_modules/react-native-macos/Libraries/TypeSafety'
10+
pod 'React', :path => '../../node_modules/react-native-macos/'
11+
pod 'React-Core', :path => '../../node_modules/react-native-macos/'
12+
pod 'React-CoreModules', :path => '../../node_modules/react-native-macos/React/CoreModules'
13+
pod 'React-Core/DevSupport', :path => '../../node_modules/react-native-macos/'
14+
pod 'React-RCTActionSheet', :path => '../../node_modules/react-native-macos/Libraries/ActionSheetIOS'
15+
pod 'React-RCTAnimation', :path => '../../node_modules/react-native-macos/Libraries/NativeAnimation'
16+
pod 'React-RCTBlob', :path => '../../node_modules/react-native-macos/Libraries/Blob'
17+
pod 'React-RCTImage', :path => '../../node_modules/react-native-macos/Libraries/Image'
18+
pod 'React-RCTLinking', :path => '../../node_modules/react-native-macos/Libraries/LinkingIOS'
19+
pod 'React-RCTNetwork', :path => '../../node_modules/react-native-macos/Libraries/Network'
20+
pod 'React-RCTSettings', :path => '../../node_modules/react-native-macos/Libraries/Settings'
21+
pod 'React-RCTText', :path => '../../node_modules/react-native-macos/Libraries/Text'
22+
pod 'React-RCTVibration', :path => '../../node_modules/react-native-macos/Libraries/Vibration'
23+
pod 'React-Core/RCTWebSocket', :path => '../../node_modules/react-native-macos/'
24+
25+
pod 'React-cxxreact', :path => '../../node_modules/react-native-macos/ReactCommon/cxxreact'
26+
pod 'React-jsi', :path => '../../node_modules/react-native-macos/ReactCommon/jsi'
27+
pod 'React-jsiexecutor', :path => '../../node_modules/react-native-macos/ReactCommon/jsiexecutor'
28+
pod 'React-jsinspector', :path => '../../node_modules/react-native-macos/ReactCommon/jsinspector'
29+
pod 'ReactCommon/callinvoker', :path => '../../node_modules/react-native-macos/ReactCommon'
30+
pod 'ReactCommon/turbomodule/core', :path => '../../node_modules/react-native-macos/ReactCommon'
31+
pod 'Yoga', :path => '../../node_modules/react-native-macos/ReactCommon/yoga'
32+
33+
pod 'boost-for-react-native', :podspec => '../../node_modules/react-native-macos/third-party-podspecs/boost-for-react-native.podspec'
34+
pod 'DoubleConversion', :podspec => '../../node_modules/react-native-macos/third-party-podspecs/DoubleConversion.podspec'
35+
pod 'glog', :podspec => '../../node_modules/react-native-macos/third-party-podspecs/glog.podspec'
36+
pod 'RCT-Folly', :podspec => '../../node_modules/react-native-macos/third-party-podspecs/RCT-Folly.podspec'
37+
38+
target 'example-macOS' do
39+
platform :macos, '10.14'
40+
use_native_modules!
41+
# Pods specifically for macOS target
42+
end
43+
end

0 commit comments

Comments
 (0)