Skip to content

Commit 252f438

Browse files
committed
chore(android): remove non-standard app directory
1 parent 4bc6423 commit 252f438

33 files changed

Lines changed: 84 additions & 104 deletions

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ Ankh.NoLoad
194194
Examples/testapp_rn
195195

196196
# Android debug build files (conflict ignoring #Visual Studio files)
197-
!android/app/src/debug/
197+
!android/src/debug/
198198

199199
# Yarn
200200
.yarn/*

.npmignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,9 @@ test/
3838
code-push-plugin-testing-framework/
3939

4040
# Android build artifacts and Android Studio bits
41-
android/app/build
41+
android/build
4242
android/local.properties
43-
android/app/local.properties
4443
android/.gradle
45-
android/app/.gradle
4644
android/**/*.iml
4745
android/.idea
4846

android/app/build.gradle

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

android/build.gradle

Lines changed: 81 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,86 @@
1-
// Top-level build file where you can add configuration options common to all sub-projects/modules.
1+
def isNewArchitectureEnabled() {
2+
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
3+
}
4+
5+
apply plugin: "com.android.library"
6+
7+
if (isNewArchitectureEnabled()) {
8+
apply plugin: "com.facebook.react"
9+
}
10+
11+
def getExtOrDefault(name) {
12+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["CodePush_" + name]
13+
}
14+
15+
def getExtOrIntegerDefault(name) {
16+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["CodePush_" + name]).toInteger()
17+
}
18+
19+
def supportsNamespace() {
20+
def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
21+
def major = parsed[0].toInteger()
22+
def minor = parsed[1].toInteger()
23+
24+
// Namespace support was added in 7.3.0
25+
return (major == 7 && minor >= 3) || major >= 8
26+
}
27+
28+
android {
29+
if (supportsNamespace()) {
30+
namespace "com.appzung.codepush.react"
231

3-
buildscript {
4-
repositories {
5-
google()
6-
mavenCentral()
32+
sourceSets {
33+
main {
34+
manifest.srcFile "src/main/AndroidManifestNew.xml"
35+
}
736
}
8-
dependencies {
9-
classpath "com.android.tools.build:gradle:7.2.1"
37+
}
1038

11-
// NOTE: Do not place your application dependencies here; they belong
12-
// in the individual module build.gradle files
39+
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
40+
41+
defaultConfig {
42+
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
43+
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
44+
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
45+
46+
consumerProguardFiles 'proguard-rules.pro'
47+
}
48+
49+
buildFeatures {
50+
buildConfig true
51+
}
52+
53+
buildTypes {
54+
release {
55+
minifyEnabled false
1356
}
57+
}
58+
59+
lintOptions {
60+
disable "GradleCompatible"
61+
}
62+
63+
compileOptions {
64+
sourceCompatibility JavaVersion.VERSION_1_8
65+
targetCompatibility JavaVersion.VERSION_1_8
66+
}
67+
}
68+
69+
repositories {
70+
mavenCentral()
71+
google()
72+
}
73+
74+
def isInDevelopment = project.hasProperty('CodePush_development') && project.property('CodePush_development') == "true"
75+
76+
dependencies {
77+
if (isInDevelopment) {
78+
implementation("com.facebook.react:react-android:0.71.+")
79+
} else {
80+
// For < 0.71, this will be from the local maven repo
81+
// For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
82+
//noinspection GradleDynamicVersion
83+
implementation "com.facebook.react:react-native:+"
84+
}
85+
implementation "com.nimbusds:nimbus-jose-jwt:9.37.3"
1486
}

android/package.json

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

android/settings.gradle

Lines changed: 0 additions & 1 deletion
This file was deleted.
File renamed without changes.

0 commit comments

Comments
 (0)