From f7f0839f1f6f194ff3f98a88b0dcac87b8ee7265 Mon Sep 17 00:00:00 2001 From: Rui Ying Date: Fri, 12 Apr 2019 21:56:08 +0800 Subject: [PATCH] Separate staging and release build types --- android/app/build.gradle | 10 ++ android/app/src/debug/res/values/strings.xml | 3 + .../io/robertying/learnx/MainApplication.java | 2 +- android/app/src/main/res/values/strings.xml | 1 - ios/learnX.xcodeproj/project.pbxproj | 94 ++++++++++++++++++- ios/learnX/Info.plist | 4 +- ios/learnX/en.lproj/LaunchScreen.xib | 35 +++++++ package.json | 1 + 8 files changed, 144 insertions(+), 6 deletions(-) create mode 100644 android/app/src/debug/res/values/strings.xml create mode 100644 ios/learnX/en.lproj/LaunchScreen.xib diff --git a/android/app/build.gradle b/android/app/build.gradle index f9c992b4..c4ee17ad 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -154,12 +154,22 @@ android { buildTypes { debug { manifestPlaceholders = [isDebug: true] + applicationIdSuffix ".debug" + buildConfigField "String", "CODEPUSH_KEY", '""' + } + releaseStaging { + manifestPlaceholders = [isDebug: false] + minifyEnabled enableProguardInReleaseBuilds + proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" + signingConfig signingConfigs.release + buildConfigField "String", "CODEPUSH_KEY", '"85HbNLH52a6R9ukGlaQ2IU9BhaujBy9a1NntV"' } release { manifestPlaceholders = [isDebug: false] minifyEnabled enableProguardInReleaseBuilds proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" signingConfig signingConfigs.release + buildConfigField "String", "CODEPUSH_KEY", '"Ims62DStmtYSRrADmEal4lQKU4g8Hy5ak4nYV"' } } // applicationVariants are e.g. debug, release diff --git a/android/app/src/debug/res/values/strings.xml b/android/app/src/debug/res/values/strings.xml new file mode 100644 index 00000000..05ae5b68 --- /dev/null +++ b/android/app/src/debug/res/values/strings.xml @@ -0,0 +1,3 @@ + + learnX-Debug + diff --git a/android/app/src/main/java/io/robertying/learnx/MainApplication.java b/android/app/src/main/java/io/robertying/learnx/MainApplication.java index a97d58a5..b67de90f 100644 --- a/android/app/src/main/java/io/robertying/learnx/MainApplication.java +++ b/android/app/src/main/java/io/robertying/learnx/MainApplication.java @@ -60,7 +60,7 @@ public boolean getUseDeveloperSupport() { protected List getPackages() { return Arrays.asList( new MainReactPackage(), - new CodePush(getResources().getString(R.string.reactNativeCodePush_androidDeploymentKey), getApplicationContext(), BuildConfig.DEBUG), + new CodePush(BuildConfig.CODEPUSH_KEY, getApplicationContext(), BuildConfig.DEBUG), new BlurViewPackage(), new LinearGradientPackage(), new RNFetchBlobPackage(), diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml index 7cf443f2..79935014 100644 --- a/android/app/src/main/res/values/strings.xml +++ b/android/app/src/main/res/values/strings.xml @@ -1,4 +1,3 @@ - 85HbNLH52a6R9ukGlaQ2IU9BhaujBy9a1NntV learnX diff --git a/ios/learnX.xcodeproj/project.pbxproj b/ios/learnX.xcodeproj/project.pbxproj index aad66d31..ed64c97f 100644 --- a/ios/learnX.xcodeproj/project.pbxproj +++ b/ios/learnX.xcodeproj/project.pbxproj @@ -31,6 +31,7 @@ 3FC8248E3E74486EA6818941 /* FontAwesome5_Regular.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = FontAwesome5_Regular.ttf; path = "../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Regular.ttf"; sourceTree = ""; }; 443FA5B275874ED871E76062 /* Pods-learnXTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-learnXTests.debug.xcconfig"; path = "Target Support Files/Pods-learnXTests/Pods-learnXTests.debug.xcconfig"; sourceTree = ""; }; 490051384AF4472F8A9F7980 /* Octicons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Octicons.ttf; path = "../node_modules/react-native-vector-icons/Fonts/Octicons.ttf"; sourceTree = ""; }; + 59F216114CA3551F20AC00A2 /* Pods-learnX.staging.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-learnX.staging.xcconfig"; path = "Target Support Files/Pods-learnX/Pods-learnX.staging.xcconfig"; sourceTree = ""; }; 5C2616418AE84CAE8A6D5327 /* Entypo.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Entypo.ttf; path = "../node_modules/react-native-vector-icons/Fonts/Entypo.ttf"; sourceTree = ""; }; 787DF3BC90244716AAA883EF /* Foundation.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Foundation.ttf; path = "../node_modules/react-native-vector-icons/Fonts/Foundation.ttf"; sourceTree = ""; }; 813616FCFA4B470283F47A5A /* FontAwesome.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = FontAwesome.ttf; path = "../node_modules/react-native-vector-icons/Fonts/FontAwesome.ttf"; sourceTree = ""; }; @@ -40,7 +41,8 @@ C46F3667AE2D5E49A2253C9E /* Pods-learnX.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-learnX.debug.xcconfig"; path = "Target Support Files/Pods-learnX/Pods-learnX.debug.xcconfig"; sourceTree = ""; }; C904C302C1D466306290CFB2 /* Pods-learnX.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-learnX.release.xcconfig"; path = "Target Support Files/Pods-learnX/Pods-learnX.release.xcconfig"; sourceTree = ""; }; CE248A3AEAD54031B5620049 /* FontAwesome5_Solid.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = FontAwesome5_Solid.ttf; path = "../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Solid.ttf"; sourceTree = ""; }; - D437877C2260C2780097D821 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = "zh-Hans"; path = "zh-Hans.lproj/LaunchScreen.xib"; sourceTree = ""; }; + D4DD7ADF2260CFB100F221AF /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/LaunchScreen.xib; sourceTree = ""; }; + D4DD7AE02260CFBC00F221AF /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = "zh-Hans"; path = "zh-Hans.lproj/LaunchScreen.xib"; sourceTree = ""; }; E0D27A9FD4944305A002F34D /* EvilIcons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = EvilIcons.ttf; path = "../node_modules/react-native-vector-icons/Fonts/EvilIcons.ttf"; sourceTree = ""; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; ED2971642150620600B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.0.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; }; @@ -93,6 +95,7 @@ C904C302C1D466306290CFB2 /* Pods-learnX.release.xcconfig */, 443FA5B275874ED871E76062 /* Pods-learnXTests.debug.xcconfig */, BA0F45B70E76EA4C96EFCFEF /* Pods-learnXTests.release.xcconfig */, + 59F216114CA3551F20AC00A2 /* Pods-learnX.staging.xcconfig */, ); path = Pods; sourceTree = ""; @@ -188,6 +191,7 @@ hasScannedForEncodings = 0; knownRegions = ( Base, + en, "zh-Hans", ); mainGroup = 83CBB9F61A601CBA00E9B192; @@ -355,7 +359,8 @@ isa = PBXVariantGroup; children = ( 13B07FB21A68108700A75B9A /* Base */, - D437877C2260C2780097D821 /* zh-Hans */, + D4DD7ADF2260CFB100F221AF /* en */, + D4DD7AE02260CFBC00F221AF /* zh-Hans */, ); name = LaunchScreen.xib; path = learnX; @@ -424,6 +429,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -447,6 +453,7 @@ CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODEPUSH_KEY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -478,6 +485,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -501,6 +509,7 @@ CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODEPUSH_KEY = Qp1abaOFYSc091n4hT0OdzFXpXUISykcJE3YV; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; ENABLE_NS_ASSERTIONS = NO; @@ -521,6 +530,85 @@ }; name = Release; }; + D437877D2260CDA90097D821 /* Staging */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = 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_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + 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_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODEPUSH_KEY = "7NdRqz1VWpbZBJ8NZPrD8QWpPh_YSk-Jcy43tV"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/Release$(EFFECTIVE_PLATFORM_NAME)"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Staging; + }; + D437877E2260CDA90097D821 /* Staging */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 59F216114CA3551F20AC00A2 /* Pods-learnX.staging.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "iPhone Developer"; + CODE_SIGN_STYLE = Manual; + CURRENT_PROJECT_VERSION = 15; + DEVELOPMENT_TEAM = QX9PZ6H89F; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)/../node_modules/react-native-cookies/ios/RNCookieManagerIOS", + ); + INFOPLIST_FILE = learnX/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + OTHER_LDFLAGS = ( + "$(inherited)", + "-ObjC", + "-lc++", + ); + PRODUCT_BUNDLE_IDENTIFIER = io.robertying.learnX; + PRODUCT_NAME = learnX; + PROVISIONING_PROFILE_SPECIFIER = "match Development io.robertying.learnX"; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Staging; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -529,6 +617,7 @@ buildConfigurations = ( 13B07F941A680F5B00A75B9A /* Debug */, 13B07F951A680F5B00A75B9A /* Release */, + D437877E2260CDA90097D821 /* Staging */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -538,6 +627,7 @@ buildConfigurations = ( 83CBBA201A601CBA00E9B192 /* Debug */, 83CBBA211A601CBA00E9B192 /* Release */, + D437877D2260CDA90097D821 /* Staging */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/ios/learnX/Info.plist b/ios/learnX/Info.plist index d37fb071..602c119c 100644 --- a/ios/learnX/Info.plist +++ b/ios/learnX/Info.plist @@ -23,7 +23,7 @@ CFBundleVersion 15 CodePushDeploymentKey - 7NdRqz1VWpbZBJ8NZPrD8QWpPh_YSk-Jcy43tV + $(CODEPUSH_KEY) Fabric APIKey @@ -68,7 +68,7 @@ NSMicrophoneUsageDescription Allow learnX to access your microphone NSMotionUsageDescription - Allow learnX to access your device's accelerometer + Allow learnX to access your device's accelerometer NSPhotoLibraryAddUsageDescription Give learnX periences permission to save photos NSPhotoLibraryUsageDescription diff --git a/ios/learnX/en.lproj/LaunchScreen.xib b/ios/learnX/en.lproj/LaunchScreen.xib new file mode 100644 index 00000000..8e19b673 --- /dev/null +++ b/ios/learnX/en.lproj/LaunchScreen.xib @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/package.json b/package.json index 57aad3cc..9f37c1cb 100644 --- a/package.json +++ b/package.json @@ -1,4 +1,5 @@ { + "name": "learnX", "scripts": { "android": "react-native run-android", "android:beta": "bundle exec fastlane android beta",