Skip to content

Commit 6378035

Browse files
authored
Merge pull request #1 from cipolleschi/feat/add_js_specs
[FEAT] Add Flow specs - New Arch Migration 1/n
2 parents f515ccc + bb23f10 commit 6378035

File tree

190 files changed

+4769
-26660
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

190 files changed

+4769
-26660
lines changed

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ codecov.yml
2727
# Example
2828
img/
2929
example/
30+
examples/
3031
app.json
3132

3233
# Android

android.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
// Use of this source code is governed by a MIT-style license that can be
33
// found in the LICENSE file.
44

5-
import { NativeModules, Platform } from 'react-native';
6-
7-
const ReactNativeBlobUtil = NativeModules.ReactNativeBlobUtil;
5+
import { Platform } from 'react-native';
6+
import ReactNativeBlobUtil from './codegenSpecs/NativeBlobUtils';
87

98
/**
109
* Send an intent to open the file.

android/build.gradle

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,19 @@ buildscript {
3030
mavenCentral()
3131
}
3232
dependencies {
33-
classpath 'com.android.tools.build:gradle:4.1.3'
33+
classpath 'com.android.tools.build:gradle:7.2.1'
3434
}
3535
}
3636
}
3737

38+
def isNewArchitectureEnabled() {
39+
return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
40+
}
41+
42+
if (isNewArchitectureEnabled()) {
43+
apply plugin: 'com.facebook.react'
44+
}
45+
3846
android {
3947
compileSdkVersion safeExtGet('compileSdkVersion', 30)
4048
buildToolsVersion safeExtGet('buildToolsVersion', '28.0.3')
@@ -43,6 +51,7 @@ android {
4351
targetSdkVersion safeExtGet('targetSdkVersion', 30)
4452
versionCode 1
4553
versionName "1.0"
54+
buildConfigField("boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString())
4655
}
4756
buildTypes {
4857
release {
@@ -55,6 +64,15 @@ android {
5564
}
5665
productFlavors {
5766
}
67+
sourceSets {
68+
main {
69+
if (isNewArchitectureEnabled()) {
70+
java.srcDirs += ['src/newarch']
71+
} else {
72+
java.srcDirs += ['src/oldarch']
73+
}
74+
}
75+
}
5876
}
5977

6078
dependencies {

android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip

android/gradlew

100644100755
File mode changed.

0 commit comments

Comments
 (0)