Skip to content
Merged
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
6 changes: 6 additions & 0 deletions .changeset/short-eels-join.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@react-native-documents/picker": patch
"@react-native-documents/viewer": patch
---

fix: clean up gradle files
26 changes: 26 additions & 0 deletions example/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
const path = require('path')
const root = path.resolve(__dirname, '..', 'packages')

const pickerPath = path.join(
root,
'document-picker',
require('../packages/document-picker/package.json').exports['.'].source,
)
const viewerPath = path.join(
root,
'document-viewer',
require('../packages/document-viewer/package.json').exports['.'].source,
)

module.exports = {
presets: ['module:@react-native/babel-preset'],
plugins: [
[
require.resolve('babel-plugin-module-resolver'),
{
extensions: ['.tsx', '.ts', '.jsx', '.js', '.json'],
alias: {
'@react-native-documents/picker': pickerPath,
'@react-native-documents/viewer': viewerPath,
},
},
],
],
}
8 changes: 4 additions & 4 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,7 @@ PODS:
- React-RCTFBReactNativeSpec
- ReactCommon/turbomodule/core
- ReactNativeDependencies
- react-native-document-picker (10.1.7):
- react-native-document-picker (11.0.0):
- hermes-engine
- RCTRequired
- RCTTypeSafety
Expand All @@ -1304,7 +1304,7 @@ PODS:
- ReactCommon/turbomodule/core
- ReactNativeDependencies
- Yoga
- react-native-document-viewer (1.0.3):
- react-native-document-viewer (2.0.2):
- hermes-engine
- RCTRequired
- RCTTypeSafety
Expand Down Expand Up @@ -1994,8 +1994,8 @@ SPEC CHECKSUMS:
React-logger: 7b234de35acb469ce76d6bbb0457f664d6f32f62
React-Mapbuffer: fbe1da882a187e5898bdf125e1cc6e603d27ecae
React-microtasksnativemodule: 76905804171d8ccbe69329fc84c57eb7934add7f
react-native-document-picker: a3c4ce6322b7aa9902fe8ffb8e03d5858b5d7beb
react-native-document-viewer: 6fc76b1f9f2773a39b155f10aae674cf731f21b2
react-native-document-picker: 82f4a016ec665949ac859dfed0b38fc5f4121d88
react-native-document-viewer: e88dc4e4c5b27b261628dddc07e254dace79ac68
react-native-segmented-control: bf6e0032726727498e18dd437ae88afcdbc18e99
React-NativeModulesApple: a9464983ccc0f66f45e93558671f60fc7536e438
React-oscompat: 73db7dbc80edef36a9d6ed3c6c4e1724ead4236d
Expand Down
27 changes: 0 additions & 27 deletions example/metro.config.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,8 @@
const path = require('path')

const exclusionList = require('metro-config/private/defaults/exclusionList')

const blockList = exclusionList([
/node_modules\/.*\/node_modules\/react-native\/.*/,

// This stops "react-native run-windows" from causing the metro server to
// crash if its already running
new RegExp(`${path.join(__dirname, 'windows').replace(/[/\\]+/g, '/')}.*`),

// Workaround for `EPERM: operation not permitted, lstat '~\midl-MIDLRT-cl.read.1.tlog'`
/.*\.tlog/,

// Prevent Metro from watching temporary files generated by Visual Studio
// otherwise it may crash when they are removed when closing a project.
/.*\/.vs\/.*/,

// Workaround for `EBUSY: resource busy or locked, open '~\msbuild.ProjectImports.zip'`
/.*\.ProjectImports\.zip/,
])

const config = {
projectRoot: __dirname,
watchFolders: [path.join(__dirname, '../..')],
resolver: {
blockList,
extraNodeModules: {
'@react-native-documents/picker': path.resolve(__dirname, '../../packages/document-picker'),
'@react-native-documents/viewer': path.resolve(__dirname, '../../packages/document-viewer'),
},
},
}

// Starting with react-native 0.72, we are required to provide a full config.
Expand Down
1 change: 1 addition & 0 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"@wdio/spec-reporter": "^8.36.1",
"appium": "^2.5.4",
"appium-uiautomator2-driver": "^3.1.0",
"babel-plugin-module-resolver": "^5.0.2",
"pod-install": "1.0.7",
"react-native-test-app": "^4.4.12",
"ts-node": "^10.9.2",
Expand Down
8 changes: 1 addition & 7 deletions packages/document-picker/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ if (isNewArchitectureEnabled()) {


android {
def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
if (agpVersion.tokenize('.')[0].toInteger() >= 7) {
namespace "com.reactnativedocumentpicker"
}
namespace "com.reactnativedocumentpicker"
compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')

// Used to override the NDK path/version on internal CI or by allowing
Expand Down Expand Up @@ -70,11 +67,8 @@ repositories {
mavenCentral()
}

def kotlin_version = getExtOrIntegerDefault("kotlinVersion")

dependencies {
//noinspection GradleDynamicVersion
implementation 'com.facebook.react:react-native:+' // from node_modules
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.1"
}
1 change: 1 addition & 0 deletions packages/document-picker/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DocumentPicker_kotlinVersion=2.0.21
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.reactnativedocumentpicker">
</manifest>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"/>
8 changes: 1 addition & 7 deletions packages/document-viewer/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ if (isNewArchitectureEnabled()) {


android {
def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
if (agpVersion.tokenize('.')[0].toInteger() >= 7) {
namespace "com.reactnativedocumentviewer"
}
namespace "com.reactnativedocumentviewer"
compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')

// Used to override the NDK path/version on internal CI or by allowing
Expand Down Expand Up @@ -70,10 +67,7 @@ repositories {
mavenCentral()
}

def kotlin_version = getExtOrIntegerDefault("kotlinVersion")

dependencies {
//noinspection GradleDynamicVersion
implementation 'com.facebook.react:react-native:+' // from node_modules
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}
1 change: 1 addition & 0 deletions packages/document-viewer/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DocumentPicker_kotlinVersion=2.0.21
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.reactnativedocumentviewer">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">


<application>
Expand Down
Loading
Loading