diff --git a/GoogleSignIn.podspec b/GoogleSignIn.podspec index e3102907..b7dcbbdb 100644 --- a/GoogleSignIn.podspec +++ b/GoogleSignIn.podspec @@ -32,7 +32,9 @@ The Google Sign-In SDK allows users to sign in with their Google account from th s.dependency 'AppAuth', '~> 1.4' s.dependency 'GTMAppAuth', '~> 1.0' s.dependency 'GTMSessionFetcher/Core', '~> 1.1' - s.resources = 'GoogleSignIn/Resources/GoogleSignIn.bundle' + s.resource_bundle = { + 'GoogleSignIn' => ['GoogleSignIn/Sources/{Resources,Strings}/*'] + } s.pod_target_xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => 'GID_SDK_VERSION=' + s.version.to_s, 'HEADER_SEARCH_PATHS' => '"${PODS_TARGET_SRCROOT}"' diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/Info.plist b/GoogleSignIn/Resources/GoogleSignIn.bundle/Info.plist deleted file mode 100644 index 290d5343..00000000 --- a/GoogleSignIn/Resources/GoogleSignIn.bundle/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleIconFile - - CFBundleIdentifier - com.google.${PRODUCT_NAME:rfc1034identifier} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - NSPrincipalClass - - - diff --git a/GoogleSignIn/Sources/NSBundle+GID3PAdditions.m b/GoogleSignIn/Sources/NSBundle+GID3PAdditions.m index af0ced4a..5df26a45 100644 --- a/GoogleSignIn/Sources/NSBundle+GID3PAdditions.m +++ b/GoogleSignIn/Sources/NSBundle+GID3PAdditions.m @@ -19,13 +19,24 @@ NS_ASSUME_NONNULL_BEGIN +#if SWIFT_PACKAGE +NSString *const GoogleSignInBundleName = @"GoogleSignIn_GoogleSignIn"; +#else +NSString *const GoogleSignInBundleName = @"GoogleSignIn"; +#endif + @implementation NSBundle (GID3PAdditions) + (nullable NSBundle *)gid_frameworkBundle { - NSString* mainBundlePath = [[NSBundle mainBundle] resourcePath]; - NSString* frameworkBundlePath = [mainBundlePath - stringByAppendingPathComponent:@"GoogleSignIn.bundle"]; - return [NSBundle bundleWithPath:frameworkBundlePath]; + // Look for the resource bundle in the main bundle. + NSString *path = [[NSBundle mainBundle] pathForResource:GoogleSignInBundleName + ofType:@"bundle"]; + if (!path) { + // If we can't find the resource bundle in the main bundle, use the framework bundle instead. + NSString *path = [[NSBundle mainBundle] pathForResource:GoogleSignInBundleName + ofType:@"framework"]; + } + return [NSBundle bundleWithPath:path]; } + (void)gid_registerFonts { diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/Roboto-Bold.ttf b/GoogleSignIn/Sources/Resources/Roboto-Bold.ttf similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/Roboto-Bold.ttf rename to GoogleSignIn/Sources/Resources/Roboto-Bold.ttf diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/google.png b/GoogleSignIn/Sources/Resources/google.png similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/google.png rename to GoogleSignIn/Sources/Resources/google.png diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/google@2x.png b/GoogleSignIn/Sources/Resources/google@2x.png similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/google@2x.png rename to GoogleSignIn/Sources/Resources/google@2x.png diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/google@3x.png b/GoogleSignIn/Sources/Resources/google@3x.png similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/google@3x.png rename to GoogleSignIn/Sources/Resources/google@3x.png diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/ar.lproj/GoogleSignIn.strings b/GoogleSignIn/Sources/Strings/ar.lproj/GoogleSignIn.strings similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/ar.lproj/GoogleSignIn.strings rename to GoogleSignIn/Sources/Strings/ar.lproj/GoogleSignIn.strings diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/ca.lproj/GoogleSignIn.strings b/GoogleSignIn/Sources/Strings/ca.lproj/GoogleSignIn.strings similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/ca.lproj/GoogleSignIn.strings rename to GoogleSignIn/Sources/Strings/ca.lproj/GoogleSignIn.strings diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/cs.lproj/GoogleSignIn.strings b/GoogleSignIn/Sources/Strings/cs.lproj/GoogleSignIn.strings similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/cs.lproj/GoogleSignIn.strings rename to GoogleSignIn/Sources/Strings/cs.lproj/GoogleSignIn.strings diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/da.lproj/GoogleSignIn.strings b/GoogleSignIn/Sources/Strings/da.lproj/GoogleSignIn.strings similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/da.lproj/GoogleSignIn.strings rename to GoogleSignIn/Sources/Strings/da.lproj/GoogleSignIn.strings diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/de.lproj/GoogleSignIn.strings b/GoogleSignIn/Sources/Strings/de.lproj/GoogleSignIn.strings similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/de.lproj/GoogleSignIn.strings rename to GoogleSignIn/Sources/Strings/de.lproj/GoogleSignIn.strings diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/el.lproj/GoogleSignIn.strings b/GoogleSignIn/Sources/Strings/el.lproj/GoogleSignIn.strings similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/el.lproj/GoogleSignIn.strings rename to GoogleSignIn/Sources/Strings/el.lproj/GoogleSignIn.strings diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/en.lproj/GoogleSignIn.strings b/GoogleSignIn/Sources/Strings/en.lproj/GoogleSignIn.strings similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/en.lproj/GoogleSignIn.strings rename to GoogleSignIn/Sources/Strings/en.lproj/GoogleSignIn.strings diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/en_GB.lproj/GoogleSignIn.strings b/GoogleSignIn/Sources/Strings/en_GB.lproj/GoogleSignIn.strings similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/en_GB.lproj/GoogleSignIn.strings rename to GoogleSignIn/Sources/Strings/en_GB.lproj/GoogleSignIn.strings diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/es.lproj/GoogleSignIn.strings b/GoogleSignIn/Sources/Strings/es.lproj/GoogleSignIn.strings similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/es.lproj/GoogleSignIn.strings rename to GoogleSignIn/Sources/Strings/es.lproj/GoogleSignIn.strings diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/es_MX.lproj/GoogleSignIn.strings b/GoogleSignIn/Sources/Strings/es_MX.lproj/GoogleSignIn.strings similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/es_MX.lproj/GoogleSignIn.strings rename to GoogleSignIn/Sources/Strings/es_MX.lproj/GoogleSignIn.strings diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/fi.lproj/GoogleSignIn.strings b/GoogleSignIn/Sources/Strings/fi.lproj/GoogleSignIn.strings similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/fi.lproj/GoogleSignIn.strings rename to GoogleSignIn/Sources/Strings/fi.lproj/GoogleSignIn.strings diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/fr.lproj/GoogleSignIn.strings b/GoogleSignIn/Sources/Strings/fr.lproj/GoogleSignIn.strings similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/fr.lproj/GoogleSignIn.strings rename to GoogleSignIn/Sources/Strings/fr.lproj/GoogleSignIn.strings diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/fr_CA.lproj/GoogleSignIn.strings b/GoogleSignIn/Sources/Strings/fr_CA.lproj/GoogleSignIn.strings similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/fr_CA.lproj/GoogleSignIn.strings rename to GoogleSignIn/Sources/Strings/fr_CA.lproj/GoogleSignIn.strings diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/he.lproj/GoogleSignIn.strings b/GoogleSignIn/Sources/Strings/he.lproj/GoogleSignIn.strings similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/he.lproj/GoogleSignIn.strings rename to GoogleSignIn/Sources/Strings/he.lproj/GoogleSignIn.strings diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/hi.lproj/GoogleSignIn.strings b/GoogleSignIn/Sources/Strings/hi.lproj/GoogleSignIn.strings similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/hi.lproj/GoogleSignIn.strings rename to GoogleSignIn/Sources/Strings/hi.lproj/GoogleSignIn.strings diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/hr.lproj/GoogleSignIn.strings b/GoogleSignIn/Sources/Strings/hr.lproj/GoogleSignIn.strings similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/hr.lproj/GoogleSignIn.strings rename to GoogleSignIn/Sources/Strings/hr.lproj/GoogleSignIn.strings diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/hu.lproj/GoogleSignIn.strings b/GoogleSignIn/Sources/Strings/hu.lproj/GoogleSignIn.strings similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/hu.lproj/GoogleSignIn.strings rename to GoogleSignIn/Sources/Strings/hu.lproj/GoogleSignIn.strings diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/id.lproj/GoogleSignIn.strings b/GoogleSignIn/Sources/Strings/id.lproj/GoogleSignIn.strings similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/id.lproj/GoogleSignIn.strings rename to GoogleSignIn/Sources/Strings/id.lproj/GoogleSignIn.strings diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/it.lproj/GoogleSignIn.strings b/GoogleSignIn/Sources/Strings/it.lproj/GoogleSignIn.strings similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/it.lproj/GoogleSignIn.strings rename to GoogleSignIn/Sources/Strings/it.lproj/GoogleSignIn.strings diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/ja.lproj/GoogleSignIn.strings b/GoogleSignIn/Sources/Strings/ja.lproj/GoogleSignIn.strings similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/ja.lproj/GoogleSignIn.strings rename to GoogleSignIn/Sources/Strings/ja.lproj/GoogleSignIn.strings diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/ko.lproj/GoogleSignIn.strings b/GoogleSignIn/Sources/Strings/ko.lproj/GoogleSignIn.strings similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/ko.lproj/GoogleSignIn.strings rename to GoogleSignIn/Sources/Strings/ko.lproj/GoogleSignIn.strings diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/ms.lproj/GoogleSignIn.strings b/GoogleSignIn/Sources/Strings/ms.lproj/GoogleSignIn.strings similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/ms.lproj/GoogleSignIn.strings rename to GoogleSignIn/Sources/Strings/ms.lproj/GoogleSignIn.strings diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/nb.lproj/GoogleSignIn.strings b/GoogleSignIn/Sources/Strings/nb.lproj/GoogleSignIn.strings similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/nb.lproj/GoogleSignIn.strings rename to GoogleSignIn/Sources/Strings/nb.lproj/GoogleSignIn.strings diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/nl.lproj/GoogleSignIn.strings b/GoogleSignIn/Sources/Strings/nl.lproj/GoogleSignIn.strings similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/nl.lproj/GoogleSignIn.strings rename to GoogleSignIn/Sources/Strings/nl.lproj/GoogleSignIn.strings diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/pl.lproj/GoogleSignIn.strings b/GoogleSignIn/Sources/Strings/pl.lproj/GoogleSignIn.strings similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/pl.lproj/GoogleSignIn.strings rename to GoogleSignIn/Sources/Strings/pl.lproj/GoogleSignIn.strings diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/pt.lproj/GoogleSignIn.strings b/GoogleSignIn/Sources/Strings/pt.lproj/GoogleSignIn.strings similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/pt.lproj/GoogleSignIn.strings rename to GoogleSignIn/Sources/Strings/pt.lproj/GoogleSignIn.strings diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/pt_BR.lproj/GoogleSignIn.strings b/GoogleSignIn/Sources/Strings/pt_BR.lproj/GoogleSignIn.strings similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/pt_BR.lproj/GoogleSignIn.strings rename to GoogleSignIn/Sources/Strings/pt_BR.lproj/GoogleSignIn.strings diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/pt_PT.lproj/GoogleSignIn.strings b/GoogleSignIn/Sources/Strings/pt_PT.lproj/GoogleSignIn.strings similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/pt_PT.lproj/GoogleSignIn.strings rename to GoogleSignIn/Sources/Strings/pt_PT.lproj/GoogleSignIn.strings diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/ro.lproj/GoogleSignIn.strings b/GoogleSignIn/Sources/Strings/ro.lproj/GoogleSignIn.strings similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/ro.lproj/GoogleSignIn.strings rename to GoogleSignIn/Sources/Strings/ro.lproj/GoogleSignIn.strings diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/ru.lproj/GoogleSignIn.strings b/GoogleSignIn/Sources/Strings/ru.lproj/GoogleSignIn.strings similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/ru.lproj/GoogleSignIn.strings rename to GoogleSignIn/Sources/Strings/ru.lproj/GoogleSignIn.strings diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/sk.lproj/GoogleSignIn.strings b/GoogleSignIn/Sources/Strings/sk.lproj/GoogleSignIn.strings similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/sk.lproj/GoogleSignIn.strings rename to GoogleSignIn/Sources/Strings/sk.lproj/GoogleSignIn.strings diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/sv.lproj/GoogleSignIn.strings b/GoogleSignIn/Sources/Strings/sv.lproj/GoogleSignIn.strings similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/sv.lproj/GoogleSignIn.strings rename to GoogleSignIn/Sources/Strings/sv.lproj/GoogleSignIn.strings diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/th.lproj/GoogleSignIn.strings b/GoogleSignIn/Sources/Strings/th.lproj/GoogleSignIn.strings similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/th.lproj/GoogleSignIn.strings rename to GoogleSignIn/Sources/Strings/th.lproj/GoogleSignIn.strings diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/tr.lproj/GoogleSignIn.strings b/GoogleSignIn/Sources/Strings/tr.lproj/GoogleSignIn.strings similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/tr.lproj/GoogleSignIn.strings rename to GoogleSignIn/Sources/Strings/tr.lproj/GoogleSignIn.strings diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/uk.lproj/GoogleSignIn.strings b/GoogleSignIn/Sources/Strings/uk.lproj/GoogleSignIn.strings similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/uk.lproj/GoogleSignIn.strings rename to GoogleSignIn/Sources/Strings/uk.lproj/GoogleSignIn.strings diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/vi.lproj/GoogleSignIn.strings b/GoogleSignIn/Sources/Strings/vi.lproj/GoogleSignIn.strings similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/vi.lproj/GoogleSignIn.strings rename to GoogleSignIn/Sources/Strings/vi.lproj/GoogleSignIn.strings diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/zh_CN.lproj/GoogleSignIn.strings b/GoogleSignIn/Sources/Strings/zh_CN.lproj/GoogleSignIn.strings similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/zh_CN.lproj/GoogleSignIn.strings rename to GoogleSignIn/Sources/Strings/zh_CN.lproj/GoogleSignIn.strings diff --git a/GoogleSignIn/Resources/GoogleSignIn.bundle/zh_TW.lproj/GoogleSignIn.strings b/GoogleSignIn/Sources/Strings/zh_TW.lproj/GoogleSignIn.strings similarity index 100% rename from GoogleSignIn/Resources/GoogleSignIn.bundle/zh_TW.lproj/GoogleSignIn.strings rename to GoogleSignIn/Sources/Strings/zh_TW.lproj/GoogleSignIn.strings diff --git a/Package.swift b/Package.swift index 5d6c05a0..e03e7848 100644 --- a/Package.swift +++ b/Package.swift @@ -21,6 +21,7 @@ let googleSignInVersion = "6.0.0" let package = Package( name: "GoogleSignIn", + defaultLocalization: "en", platforms: [.iOS(.v9)], products: [ .library( @@ -59,6 +60,10 @@ let package = Package( .product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher"), ], path: "GoogleSignIn/Sources", + resources: [ + .process("Resources"), + .process("Strings"), + ], publicHeadersPath: "Public", cSettings: [ .headerSearchPath("../../"),