Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow using cocoapods without react native link #244

Merged
merged 1 commit into from Apr 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
#import "RCTUtils.h"
#endif

@import AppCenterAnalytics;
@import AppCenterReactNativeShared;
#import <AppCenter/MSAppCenter.h>
#import <AppCenterAnalytics/MSAnalytics.h>
#import <AppCenterReactNativeShared/AppCenterReactNativeShared.h>

@interface AppCenterReactNativeAnalytics () <RCTBridgeModule>
@end
Expand Down
7 changes: 3 additions & 4 deletions appcenter-analytics/ios/appcenter-analytics.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ Pod::Spec.new do |s|
s.homepage = package['homepage']
s.documentation_url = "https://docs.microsoft.com/en-us/appcenter/"

s.author = { 'Microsoft' => 'appcentersdk@microsoft.com' }

s.source = { :git => "https://github.com/Microsoft/AppCenter-SDK-React-Native.git" }
s.source_files = "appcenter-analytics/ios/AppCenterReactNativeAnalytics/*.{h,m}"
s.author = { 'Microsoft' => 'appcentersdk@microsoft.com' }
s.source = { :git => "https://github.com/Microsoft/AppCenter-SDK-React-Native.git" }
s.source_files = "AppCenterReactNativeAnalytics/**/*.{h,m}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was that required that you replace some part of the paths with stars?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not required, however, this way it included sub-folders as well.

s.platform = :ios, '9.0'
s.requires_arc = true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
#import <AppCenterCrashes/MSWrapperCrashesHelper.h>
#pragma GCC diagnostic pop

@import AppCenterCrashes;
@import AppCenterReactNativeShared;
#import <AppCenter/MSAppCenter.h>
#import <AppCenterCrashes/AppCenterCrashes.h>
#import <AppCenterReactNativeShared/AppCenterReactNativeShared.h>

@implementation AppCenterReactNativeCrashes

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#import "AppCenterReactNativeCrashesUtils.h"

@import AppCenterCrashes.MSErrorReport;
@import AppCenterCrashes.MSErrorAttachmentLog;
@import AppCenterCrashes.MSErrorAttachmentLog_Utility;
#import <AppCenterCrashes/MSErrorReport.h>
#import <AppCenterCrashes/MSErrorAttachmentLog.h>
#import <AppCenterCrashes/MSErrorAttachmentLog+Utility.h>

@import AppCenter.MSDevice;
#import <AppCenter/MSDevice.h>

NSArray* convertReportsToJS(NSArray* reports) {
NSMutableArray* jsReadyReports = [[NSMutableArray alloc] init];
Expand Down
6 changes: 3 additions & 3 deletions appcenter-crashes/ios/appcenter-crashes.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ Pod::Spec.new do |s|
s.homepage = package['homepage']
s.documentation_url = "https://docs.microsoft.com/en-us/appcenter/"

s.author = { 'Microsoft' => 'appcentersdk@microsoft.com' }
s.author = { 'Microsoft' => 'appcentersdk@microsoft.com' }

s.source = { :git => "https://github.com/Microsoft/AppCenter-SDK-React-Native.git" }
s.source_files = "appcenter-crashes/ios/AppCenterReactNativeCrashes/*.{h,m}"
s.source = { :git => "https://github.com/Microsoft/AppCenter-SDK-React-Native.git" }
s.source_files = "AppCenterReactNativeCrashes/**/*.{h,m}"
Copy link
Member

@guperrot guperrot Apr 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested your branch on a sample project and this seems to work for cocopods project too. However before I merge, can you elaborate why it works to remove the beginning of the path, and what about the stars?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep: the source_files path is related to the root of the .podspec file. So we want to include in the podspec all .h and .m files (including sub-folders thus **/*.{h.m}) in AppCenterReactNativeCrashes folder starting from the root.

Starting from 2 levels up in the filesystem path would break the spec since source files would not be found.

s.platform = :ios, '9.0'
s.requires_arc = true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
#import "RCTUtils.h"
#endif

@import AppCenterPush;
@import AppCenterReactNativeShared;
#import <AppCenter/MSAppCenter.h>
#import <AppCenterPush/AppCenterPush.h>
#import <AppCenterReactNativeShared/AppCenterReactNativeShared.h>

#import "AppCenterReactNativePushUtils.h"
#import "AppCenterReactNativePushDelegate.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#import "AppCenterReactNativePushUtils.h"

@import AppCenterPush.MSPushNotification;
#import <AppCenterPush/MSPushNotification.h>

NSDictionary* convertNotificationToJS(MSPushNotification* pushNotification) {
if (pushNotification == nil) {
Expand Down
6 changes: 3 additions & 3 deletions appcenter-push/ios/appcenter-push.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ Pod::Spec.new do |s|
s.homepage = package['homepage']
s.documentation_url = "https://docs.microsoft.com/en-us/appcenter/"

s.author = { 'Microsoft' => 'appcentersdk@microsoft.com' }
s.author = { 'Microsoft' => 'appcentersdk@microsoft.com' }

s.source = { :git => "https://github.com/Microsoft/AppCenter-SDK-React-Native.git" }
s.source_files = "appcenter-push/ios/AppCenterReactNativePush/*.{h,m}"
s.source = { :git => "https://github.com/Microsoft/AppCenter-SDK-React-Native.git" }
s.source_files = "AppCenterReactNativePush/**/*.{h,m}"
s.platform = :ios, '9.0'
s.requires_arc = true

Expand Down
4 changes: 2 additions & 2 deletions appcenter/ios/AppCenterReactNative/AppCenterReactNative.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
#import "RCTUtils.h"
#endif

@import AppCenter;
@import AppCenterReactNativeShared;
#import <AppCenter/AppCenter.h>
#import <AppCenterReactNativeShared/AppCenterReactNativeShared.h>

@interface AppCenterReactNative () <RCTBridgeModule>
@end
Expand Down
5 changes: 2 additions & 3 deletions appcenter/ios/appcenter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ Pod::Spec.new do |s|

s.author = { 'Microsoft' => 'appcentersdk@microsoft.com' }

s.source = { :git => "https://github.com/Microsoft/AppCenter-SDK-React-Native.git" }
s.source_files = "appcenter/ios/AppCenterReactNative/*.{h,m}"
s.source = { :git => "https://github.com/Microsoft/AppCenter-SDK-React-Native.git" }
s.source_files = "AppCenterReactNative/**/*.{h,m}"
s.platform = :ios, '9.0'
s.requires_arc = true

s.vendored_frameworks = 'AppCenterReactNativeShared/AppCenterReactNativeShared.framework'

s.dependency 'AppCenterReactNativeShared'
end