Skip to content

Commit 8802f5f

Browse files
authored
feat: version (#2)
* feat: 버전 확인 버튼 추가 * chore: bundle 버전 표시 * chore: iOS Staging 빌드 설정 추가 * chore: 안드로이드에 releaseStaging 빌드 설정 추가 * fix: 안드로이드 release 계열 빌드에 signingConfig 추가
1 parent 4f72b3e commit 8802f5f

7 files changed

Lines changed: 260 additions & 20 deletions

File tree

android/app/build.gradle

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,27 @@ import com.android.build.OutputFile
44

55
project.ext.react = [
66
// the name of the generated asset file containing your JS bundle
7-
bundleAssetName : "index.android.bundle",
7+
bundleAssetName : "index.android.bundle",
88

99
// the entry file for bundle generation. If none specified and
1010
// "index.android.js" exists, it will be used. Otherwise "index.js" is
1111
// default. Can be overridden with ENTRY_FILE environment variable.
12-
entryFile : "index.js",
12+
entryFile : "index.js",
1313

1414
// https://reactnative.dev/docs/performance#enable-the-ram-format
15-
bundleCommand : "ram-bundle",
15+
bundleCommand : "ram-bundle",
1616

1717
// supply additional arguments to the packager
18-
extraPackagerArgs : ["--indexed-ram-bundle"],
18+
extraPackagerArgs : ["--indexed-ram-bundle"],
1919

2020
// whether to bundle JS and assets in debug mode
21-
bundleInDebug : false,
21+
bundleInDebug : false,
22+
23+
// whether to bundle JS and assets in releaseStaging mode
24+
bundleInReleaseStaging: true,
2225

2326
// whether to bundle JS and assets in release mode
24-
bundleInRelease : true
27+
bundleInRelease : true
2528
]
2629

2730
apply from: "../../node_modules/react-native/react.gradle"
@@ -103,9 +106,22 @@ android {
103106

104107
buildTypes {
105108
debug {
109+
resValue "string", "CodePushDeploymentKey", '""'
110+
106111
signingConfig signingConfigs.debug
107112
}
113+
releaseStaging {
114+
resValue "string", "CodePushDeploymentKey", '"sBtl9UhH5-wUQn0_5gSXX-7CovzQMszgaiqbE"'
115+
116+
signingConfig signingConfigs.debug
117+
minifyEnabled enableProguardInReleaseBuilds
118+
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
119+
120+
matchingFallbacks = ['release']
121+
}
108122
release {
123+
resValue "string", "CodePushDeploymentKey", '"G0_XRJ3LeB43UMgvkGCxSsBvyfezWbVL-3Jys"'
124+
109125
signingConfig signingConfigs.debug
110126
minifyEnabled enableProguardInReleaseBuilds
111127
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"

android/app/src/main/res/values/strings.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@
33

44
<string name="appCenterCrashes_whenToSendCrashes" moduleConfig="true" translatable="false">DO_NOT_ASK_JAVASCRIPT</string>
55
<string name="appCenterAnalytics_whenToEnableAnalytics" moduleConfig="true" translatable="false">ALWAYS_SEND</string>
6-
<string name="CodePushDeploymentKey" moduleConfig="true" tools:ignore="Typos">sBtl9UhH5-wUQn0_5gSXX-7CovzQMszgaiqbE</string>
76
</resources>

ios/cafeteria.xcodeproj/project.pbxproj

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,11 @@
5353
8BBA7CC4EB632E902D13C693 /* libPods-cafeteria.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-cafeteria.a"; sourceTree = BUILT_PRODUCTS_DIR; };
5454
8EEEDD7BDAA0417C9C090692 /* Ionicons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Ionicons.ttf; path = "../node_modules/native-base/Fonts/Ionicons.ttf"; sourceTree = "<group>"; };
5555
9050012DB5C5B5DC0723DF88 /* Pods-cafeteria.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-cafeteria.debug.xcconfig"; path = "Target Support Files/Pods-cafeteria/Pods-cafeteria.debug.xcconfig"; sourceTree = "<group>"; };
56+
9AA9CD418D64F1D396067F86 /* Pods-cafeteria.staging.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-cafeteria.staging.xcconfig"; path = "Target Support Files/Pods-cafeteria/Pods-cafeteria.staging.xcconfig"; sourceTree = "<group>"; };
5657
A95AF086CCF546AD999AE023 /* FontAwesome5_Regular.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = FontAwesome5_Regular.ttf; path = "../node_modules/native-base/Fonts/FontAwesome5_Regular.ttf"; sourceTree = "<group>"; };
5758
AA5E445EF9D245029B49E62D /* MaterialIcons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = MaterialIcons.ttf; path = "../node_modules/native-base/Fonts/MaterialIcons.ttf"; sourceTree = "<group>"; };
5859
ABC37380CA194BEEB159BE09 /* rubicon-icon-font.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "rubicon-icon-font.ttf"; path = "../node_modules/native-base/Fonts/rubicon-icon-font.ttf"; sourceTree = "<group>"; };
60+
C93BBDBC58867A159694AE98 /* Pods-cafeteria-cafeteriaTests.staging.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-cafeteria-cafeteriaTests.staging.xcconfig"; path = "Target Support Files/Pods-cafeteria-cafeteriaTests/Pods-cafeteria-cafeteriaTests.staging.xcconfig"; sourceTree = "<group>"; };
5961
CC7F20A6C5A54066A835D12F /* Roboto_medium.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Roboto_medium.ttf; path = "../node_modules/native-base/Fonts/Roboto_medium.ttf"; sourceTree = "<group>"; };
6062
CDD387A3CB334336980B0FF4 /* Entypo.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Entypo.ttf; path = "../node_modules/native-base/Fonts/Entypo.ttf"; sourceTree = "<group>"; };
6163
CF9EE4389E03459DAC66FD96 /* AntDesign.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = AntDesign.ttf; path = "../node_modules/native-base/Fonts/AntDesign.ttf"; sourceTree = "<group>"; };
@@ -167,6 +169,8 @@
167169
34C44268151FDD0A2D03DCFB /* Pods-cafeteria.release.xcconfig */,
168170
E8FB1B8DCEA8F0E5B31EEC6B /* Pods-cafeteria-cafeteriaTests.debug.xcconfig */,
169171
EA18FD93CBD800377349FE4E /* Pods-cafeteria-cafeteriaTests.release.xcconfig */,
172+
9AA9CD418D64F1D396067F86 /* Pods-cafeteria.staging.xcconfig */,
173+
C93BBDBC58867A159694AE98 /* Pods-cafeteria-cafeteriaTests.staging.xcconfig */,
170174
);
171175
path = Pods;
172176
sourceTree = "<group>";
@@ -549,6 +553,118 @@
549553
};
550554
name = Release;
551555
};
556+
2AB8AA5726610E74000ADA61 /* Staging */ = {
557+
isa = XCBuildConfiguration;
558+
buildSettings = {
559+
ALWAYS_SEARCH_USER_PATHS = NO;
560+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
561+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
562+
CLANG_CXX_LIBRARY = "libc++";
563+
CLANG_ENABLE_MODULES = YES;
564+
CLANG_ENABLE_OBJC_ARC = YES;
565+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
566+
CLANG_WARN_BOOL_CONVERSION = YES;
567+
CLANG_WARN_COMMA = YES;
568+
CLANG_WARN_CONSTANT_CONVERSION = YES;
569+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
570+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
571+
CLANG_WARN_EMPTY_BODY = YES;
572+
CLANG_WARN_ENUM_CONVERSION = YES;
573+
CLANG_WARN_INFINITE_RECURSION = YES;
574+
CLANG_WARN_INT_CONVERSION = YES;
575+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
576+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
577+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
578+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
579+
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
580+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
581+
CLANG_WARN_STRICT_PROTOTYPES = YES;
582+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
583+
CLANG_WARN_UNREACHABLE_CODE = YES;
584+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
585+
CODEPUSH_KEY = Fzqu71x4FXhOaKcAiwpqXkFQddjgYl2dIUW2K;
586+
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
587+
COPY_PHASE_STRIP = YES;
588+
ENABLE_NS_ASSERTIONS = NO;
589+
ENABLE_STRICT_OBJC_MSGSEND = YES;
590+
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 ";
591+
GCC_C_LANGUAGE_STANDARD = gnu99;
592+
GCC_NO_COMMON_BLOCKS = YES;
593+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
594+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
595+
GCC_WARN_UNDECLARED_SELECTOR = YES;
596+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
597+
GCC_WARN_UNUSED_FUNCTION = YES;
598+
GCC_WARN_UNUSED_VARIABLE = YES;
599+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
600+
LD_RUNPATH_SEARCH_PATHS = (
601+
/usr/lib/swift,
602+
"$(inherited)",
603+
);
604+
LIBRARY_SEARCH_PATHS = (
605+
"\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
606+
"\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"",
607+
"\"$(inherited)\"",
608+
);
609+
MTL_ENABLE_DEBUG_INFO = NO;
610+
MULTI_DEPLOYMENT_CONFIG = "$(BUILD_DIR)/Release$(EFFECTIVE_PLATFORM_NAME)";
611+
SDKROOT = iphoneos;
612+
VALIDATE_PRODUCT = YES;
613+
};
614+
name = Staging;
615+
};
616+
2AB8AA5826610E74000ADA61 /* Staging */ = {
617+
isa = XCBuildConfiguration;
618+
baseConfigurationReference = 9AA9CD418D64F1D396067F86 /* Pods-cafeteria.staging.xcconfig */;
619+
buildSettings = {
620+
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
621+
CLANG_ENABLE_MODULES = YES;
622+
CODE_SIGN_STYLE = Manual;
623+
CURRENT_PROJECT_VERSION = 8;
624+
DEVELOPMENT_TEAM = AANGG4Q668;
625+
INFOPLIST_FILE = cafeteria/Info.plist;
626+
LD_RUNPATH_SEARCH_PATHS = (
627+
"$(inherited)",
628+
"@executable_path/Frameworks",
629+
);
630+
MARKETING_VERSION = 4.3.0;
631+
OTHER_LDFLAGS = (
632+
"$(inherited)",
633+
"-ObjC",
634+
"-lc++",
635+
);
636+
PRODUCT_BUNDLE_IDENTIFIER = "appcenter.inu.ac.kr.inu-cafeteria";
637+
PRODUCT_NAME = cafeteria;
638+
PROVISIONING_PROFILE_SPECIFIER = "Cafeteria Dev Profile for CI Setup";
639+
SWIFT_VERSION = 5.0;
640+
VERSIONING_SYSTEM = "apple-generic";
641+
};
642+
name = Staging;
643+
};
644+
2AB8AA5926610E74000ADA61 /* Staging */ = {
645+
isa = XCBuildConfiguration;
646+
baseConfigurationReference = C93BBDBC58867A159694AE98 /* Pods-cafeteria-cafeteriaTests.staging.xcconfig */;
647+
buildSettings = {
648+
BUNDLE_LOADER = "$(TEST_HOST)";
649+
COPY_PHASE_STRIP = NO;
650+
INFOPLIST_FILE = cafeteriaTests/Info.plist;
651+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
652+
LD_RUNPATH_SEARCH_PATHS = (
653+
"$(inherited)",
654+
"@executable_path/Frameworks",
655+
"@loader_path/Frameworks",
656+
);
657+
OTHER_LDFLAGS = (
658+
"-ObjC",
659+
"-lc++",
660+
"$(inherited)",
661+
);
662+
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
663+
PRODUCT_NAME = "$(TARGET_NAME)";
664+
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/cafeteria.app/cafeteria";
665+
};
666+
name = Staging;
667+
};
552668
83CBBA201A601CBA00E9B192 /* Debug */ = {
553669
isa = XCBuildConfiguration;
554670
buildSettings = {
@@ -578,6 +694,7 @@
578694
CLANG_WARN_SUSPICIOUS_MOVE = YES;
579695
CLANG_WARN_UNREACHABLE_CODE = YES;
580696
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
697+
CODEPUSH_KEY = "";
581698
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
582699
COPY_PHASE_STRIP = NO;
583700
ENABLE_STRICT_OBJC_MSGSEND = YES;
@@ -609,6 +726,7 @@
609726
"\"$(inherited)\"",
610727
);
611728
MTL_ENABLE_DEBUG_INFO = YES;
729+
MULTI_DEPLOYMENT_CONFIG = "";
612730
ONLY_ACTIVE_ARCH = YES;
613731
SDKROOT = iphoneos;
614732
};
@@ -643,6 +761,7 @@
643761
CLANG_WARN_SUSPICIOUS_MOVE = YES;
644762
CLANG_WARN_UNREACHABLE_CODE = YES;
645763
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
764+
CODEPUSH_KEY = GnyAUBEuCAPT7wKa3WNDE5hjNVabVUs2PGYV2;
646765
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
647766
COPY_PHASE_STRIP = YES;
648767
ENABLE_NS_ASSERTIONS = NO;
@@ -667,6 +786,7 @@
667786
"\"$(inherited)\"",
668787
);
669788
MTL_ENABLE_DEBUG_INFO = NO;
789+
MULTI_DEPLOYMENT_CONFIG = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
670790
SDKROOT = iphoneos;
671791
VALIDATE_PRODUCT = YES;
672792
};
@@ -680,6 +800,7 @@
680800
buildConfigurations = (
681801
00E356F61AD99517003FC87E /* Debug */,
682802
00E356F71AD99517003FC87E /* Release */,
803+
2AB8AA5926610E74000ADA61 /* Staging */,
683804
);
684805
defaultConfigurationIsVisible = 0;
685806
defaultConfigurationName = Release;
@@ -689,6 +810,7 @@
689810
buildConfigurations = (
690811
13B07F941A680F5B00A75B9A /* Debug */,
691812
13B07F951A680F5B00A75B9A /* Release */,
813+
2AB8AA5826610E74000ADA61 /* Staging */,
692814
);
693815
defaultConfigurationIsVisible = 0;
694816
defaultConfigurationName = Release;
@@ -698,6 +820,7 @@
698820
buildConfigurations = (
699821
83CBBA201A601CBA00E9B192 /* Debug */,
700822
83CBBA211A601CBA00E9B192 /* Release */,
823+
2AB8AA5726610E74000ADA61 /* Staging */,
701824
);
702825
defaultConfigurationIsVisible = 0;
703826
defaultConfigurationName = Release;

ios/cafeteria/Info.plist

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
<plist version="1.0">
44
<dict>
55
<key>CodePushDeploymentKey</key>
6-
<string>Fzqu71x4FXhOaKcAiwpqXkFQddjgYl2dIUW2K</string>
6+
<string>$(CODEPUSH_KEY)</string>
77
<key>CFBundleDevelopmentRegion</key>
8-
<string>en</string>
8+
<string>ko_KR</string>
99
<key>CFBundleDisplayName</key>
10-
<string>cafeteria</string>
10+
<string>카페테리아</string>
1111
<key>CFBundleExecutable</key>
1212
<string>$(EXECUTABLE_NAME)</string>
1313
<key>CFBundleIdentifier</key>
@@ -28,8 +28,8 @@
2828
<true/>
2929
<key>NSAppTransportSecurity</key>
3030
<dict>
31-
<key>NSAllowsArbitraryLoads</key>
32-
<true/>
31+
<key>NSAllowsArbitraryLoads</key>
32+
<true/>
3333
<key>NSExceptionDomains</key>
3434
<dict>
3535
<key>localhost</key>
@@ -38,10 +38,10 @@
3838
<true/>
3939
</dict>
4040
<key>codepush.appcenter.ms</key>
41-
<dict>
42-
<key>NSExceptionAllowsInsecureHTTPLoads</key>
43-
<true/>
44-
</dict>
41+
<dict>
42+
<key>NSExceptionAllowsInsecureHTTPLoads</key>
43+
<true/>
44+
</dict>
4545
</dict>
4646
</dict>
4747
<key>NSLocationWhenInUseUsageDescription</key>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/**
2+
* This file is part of INU Cafeteria.
3+
*
4+
* Copyright (C) 2021 INU Global App Center <potados99@gmail.com>
5+
*
6+
* INU Cafeteria is free software: you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License as published by
8+
* the Free Software Foundation, either version 3 of the License, or
9+
* (at your option) any later version.
10+
*
11+
* INU Cafeteria is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU General Public License
17+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
18+
*/
19+
20+
import alert from '../../presentation/components/utils/alert';
21+
import UseCase from './UseCase';
22+
import codePush from 'react-native-code-push';
23+
24+
class CheckForUpdates extends UseCase {
25+
async onExecute(_: void): Promise<void> {
26+
const syncStatus = await codePush.sync({
27+
updateDialog: {
28+
title: '업데이트 사용 가능',
29+
optionalUpdateMessage:
30+
'새 업데이트를 설치할까요? 오래 걸리지 않습니다.',
31+
optionalInstallButtonLabel: '설치',
32+
optionalIgnoreButtonLabel: '취소',
33+
34+
mandatoryUpdateMessage: '꼭 설치해야 하는 중요한 업데이트가 있습니다.',
35+
mandatoryContinueButtonLabel: '설치',
36+
},
37+
installMode: codePush.InstallMode.IMMEDIATE,
38+
});
39+
40+
if (syncStatus === codePush.SyncStatus.UP_TO_DATE) {
41+
alert('업데이트 없음', '최신 버전입니다.');
42+
}
43+
}
44+
}
45+
46+
export default new CheckForUpdates();

src/presentation/App.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,14 @@ function App() {
5454
);
5555
}
5656

57+
/**
58+
* By default, CodePush will check for updates on every app start.
59+
* If an update is available, it will be silently downloaded, and installed
60+
* the next time the app is restarted (either explicitly by the end user or by the OS),
61+
* which ensures the least invasive experience for your end users.
62+
* If an available update is mandatory, then it will be installed immediately,
63+
* ensuring that the end user gets it as soon as possible.
64+
*
65+
* https://docs.microsoft.com/en-us/appcenter/distribution/codepush/rn-plugin
66+
*/
5767
export default codePush(App);

0 commit comments

Comments
 (0)