Skip to content

Commit fc23baa

Browse files
committed
refactor(android): 디렉토리 구조 변경 및 파일 경로 수정
안드로이드 프로젝트의 디렉토리 구조를 변경하여 더 간결하고 일관성 있게 관리합니다. 기존의 'android/app' 디렉토리 구조를 'android'로 변경하여 불필요한 중첩을 제거하고, 관련된 모든 파일 경로를 업데이트합니다. 이로 인해 파일 경로를 참조하는 코드와 설정 파일들이 수정되었습니다. 이러한 변경은 프로젝트의 유지보수성을 높이고, 파일 경로 관리의 복잡성을 줄이기 위함입니다.
1 parent 4d0fbb0 commit fc23baa

34 files changed

Lines changed: 49 additions & 72 deletions

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,6 @@ Ankh.NoLoad
191191
Examples/testapp_rn
192192

193193
# Android debug build files (conflict ignoring #Visual Studio files)
194-
!android/app/src/debug/
194+
!android/src/debug/
195195

196-
**/*.tgz
196+
**/*.tgz

Examples/create-app.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ Requirements:
1212
sudo gem install cocoapods -n /usr/local/bin
1313
1414
Usage: node create-app.js <appName> <reactNativeVersion> <reactNativeCodePushVersion>
15-
1. node create-app.js
15+
1. node create-app.js
1616
2. node create-app.js myapp
17-
3. node create-app.js myapp react-native@0.62 react-native-code-push@6.1.0
17+
3. node create-app.js myapp react-native@0.62 react-native-code-push@6.1.0
1818
4. node create-app.js myapp react-native@latest Microsoft/react-native-code-push
1919
2020
Parameters:
@@ -245,11 +245,11 @@ function isReactNativeVersionLowerThan(version) {
245245

246246
// Configuring android applications for react-native version higher than 0.60
247247
function androidSetup() {
248-
const buildGradlePath = path.join('android', 'app', 'build.gradle');
248+
const buildGradlePath = path.join('android', 'build.gradle');
249249
const settingsGradlePath = path.join('android', 'settings.gradle');
250250
const mainApplicationType = reactNativeVersionIsLowerThanV073 ? 'java' : 'kt';
251-
const mainApplicationPath = path.join('android', 'app', 'src', 'main', 'java', 'com', appName, `MainApplication.${mainApplicationType}`);
252-
const stringsResourcesPath = path.join('android', 'app', 'src', 'main', 'res', 'values', 'strings.xml');
251+
const mainApplicationPath = path.join('android', 'src', 'main', 'java', 'com', appName, `MainApplication.${mainApplicationType}`);
252+
const stringsResourcesPath = path.join('android', 'src', 'main', 'res', 'values', 'strings.xml');
253253

254254
let stringsResourcesContent = fs.readFileSync(stringsResourcesPath, "utf8");
255255
const insertAfterString = "<resources>";

android/app/build.gradle

Lines changed: 0 additions & 48 deletions
This file was deleted.

android/build.gradle

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Top-level build file where you can add configuration options common to all sub-projects/modules.
1+
// Top-level build file for the entire project.
22

33
buildscript {
44
repositories {
@@ -7,18 +7,44 @@ buildscript {
77
}
88
dependencies {
99
classpath 'com.android.tools.build:gradle:1.3.0'
10-
11-
// NOTE: Do not place your application dependencies here; they belong
12-
// in the individual module build.gradle files
1310
}
1411
}
1512

1613
allprojects {
17-
android {
18-
namespace "com.microsoft.codepush.react"
19-
}
2014
repositories {
21-
mavenLocal()
15+
google()
2216
mavenCentral()
2317
}
2418
}
19+
20+
apply plugin: "com.android.library"
21+
22+
def isNewArchitectureEnabled() {
23+
return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
24+
}
25+
26+
def IS_NEW_ARCHITECTURE_ENABLED = isNewArchitectureEnabled()
27+
28+
android {
29+
namespace "com.microsoft.codepush.react"
30+
compileSdkVersion rootProject.hasProperty('compileSdkVersion') ? rootProject.compileSdkVersion : 33
31+
buildToolsVersion rootProject.hasProperty('buildToolsVersion') ? rootProject.buildToolsVersion : "33.0.0"
32+
33+
defaultConfig {
34+
minSdkVersion rootProject.hasProperty('minSdkVersion') ? rootProject.minSdkVersion : 21
35+
targetSdkVersion rootProject.hasProperty('targetSdkVersion') ? rootProject.targetSdkVersion : 33
36+
versionCode 1
37+
versionName "1.0"
38+
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", IS_NEW_ARCHITECTURE_ENABLED.toString()
39+
consumerProguardFiles 'proguard-rules.pro'
40+
}
41+
42+
lintOptions {
43+
abortOnError false
44+
}
45+
}
46+
47+
dependencies {
48+
implementation "com.facebook.react:react-native:+"
49+
implementation 'com.nimbusds:nimbus-jose-jwt:9.37.3'
50+
}

android/settings.gradle

Lines changed: 0 additions & 1 deletion
This file was deleted.

android/app/src/main/java/com/microsoft/codepush/react/CodePush.java renamed to android/src/main/java/com/microsoft/codepush/react/CodePush.java

File renamed without changes.

android/app/src/main/java/com/microsoft/codepush/react/CodePushBuilder.java renamed to android/src/main/java/com/microsoft/codepush/react/CodePushBuilder.java

File renamed without changes.

0 commit comments

Comments
 (0)