Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*.log
*.hprof
bin

# OSX
#
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,18 @@ npm install react-native-blob-courier
- Android Gradle Plugin >= 7
- iOS >= 10
- JDK >= 11
<<<<<<< HEAD
- React Native >= 0.66.x
=======
- React Native >= 0.64.x
>>>>>>> docs: add TurboModules documentation

_Note: you may have success with earlier versions of React Native but these are neither tested nor supported._

## TurboModules

BlobCourier has experimental support for the new React Native architecture.

## Usage

The library provides both a fluent and a more concise interface. In the examples the concise approach is applied; fluent interface is demonstrated later in this document.
Expand Down
32 changes: 25 additions & 7 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,20 @@ buildscript {
}
}

def isNewArchitectureEnabled() {
return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
}


plugins {
id "com.adarshr.test-logger" version "$test_logger_version"
}

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

dependencyLocking {
lockAllConfigurations()
if (isNewArchitectureEnabled()) {
apply plugin: 'com.facebook.react'
}

android {
Expand All @@ -30,10 +35,9 @@ android {
defaultConfig {
minSdkVersion project.ext.min_sdk_version
targetSdkVersion project.ext.target_sdk_version
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
buildConfigField "Long", "ADB_COMMAND_TIMEOUT_MILLISECONDS", ADB_COMMAND_TIMEOUT_MILLISECONDS
buildConfigField "Long", "PROMISE_TIMEOUT_MILLISECONDS", PROMISE_TIMEOUT_MILLISECONDS
}
Expand Down Expand Up @@ -69,6 +73,16 @@ android {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
}
sourceSets {
main {
if (isNewArchitectureEnabled()) {
java.srcDirs += ['src/newarch']
java.srcDirs += ['build/generated/source/codegen/java']
} else {
java.srcDirs += ['src/oldarch']
}
}
}
}

repositories {
Expand Down Expand Up @@ -161,6 +175,10 @@ dependencies {
androidTestImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutines_version"
}

dependencyLocking {
lockAllConfigurations()
if (isNewArchitectureEnabled()) {
react {
codegenJavaPackageName = "io.deckers.blob_courier"
libraryName = "blob_courier"
jsRootDir = file("../src/")
}
}
Binary file modified android/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Thu Oct 29 22:39:58 CET 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
Loading