Skip to content

Commit d47ab3e

Browse files
authored
fix: clean up gradle files (#890)
* fix: clean up gradle files * Remove patch entry for 'react-native-documents-example' Removed patch entry for 'react-native-documents-example' from changeset.
1 parent 80c94ee commit d47ab3e

File tree

12 files changed

+174
-53
lines changed

12 files changed

+174
-53
lines changed

.changeset/short-eels-join.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@react-native-documents/picker": patch
3+
"@react-native-documents/viewer": patch
4+
---
5+
6+
fix: clean up gradle files

example/babel.config.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
const path = require('path')
2+
const root = path.resolve(__dirname, '..', 'packages')
3+
4+
const pickerPath = path.join(
5+
root,
6+
'document-picker',
7+
require('../packages/document-picker/package.json').exports['.'].source,
8+
)
9+
const viewerPath = path.join(
10+
root,
11+
'document-viewer',
12+
require('../packages/document-viewer/package.json').exports['.'].source,
13+
)
14+
115
module.exports = {
216
presets: ['module:@react-native/babel-preset'],
17+
plugins: [
18+
[
19+
require.resolve('babel-plugin-module-resolver'),
20+
{
21+
extensions: ['.tsx', '.ts', '.jsx', '.js', '.json'],
22+
alias: {
23+
'@react-native-documents/picker': pickerPath,
24+
'@react-native-documents/viewer': viewerPath,
25+
},
26+
},
27+
],
28+
],
329
}

example/ios/Podfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,7 @@ PODS:
12821282
- React-RCTFBReactNativeSpec
12831283
- ReactCommon/turbomodule/core
12841284
- ReactNativeDependencies
1285-
- react-native-document-picker (10.1.7):
1285+
- react-native-document-picker (11.0.0):
12861286
- hermes-engine
12871287
- RCTRequired
12881288
- RCTTypeSafety
@@ -1304,7 +1304,7 @@ PODS:
13041304
- ReactCommon/turbomodule/core
13051305
- ReactNativeDependencies
13061306
- Yoga
1307-
- react-native-document-viewer (1.0.3):
1307+
- react-native-document-viewer (2.0.2):
13081308
- hermes-engine
13091309
- RCTRequired
13101310
- RCTTypeSafety
@@ -1994,8 +1994,8 @@ SPEC CHECKSUMS:
19941994
React-logger: 7b234de35acb469ce76d6bbb0457f664d6f32f62
19951995
React-Mapbuffer: fbe1da882a187e5898bdf125e1cc6e603d27ecae
19961996
React-microtasksnativemodule: 76905804171d8ccbe69329fc84c57eb7934add7f
1997-
react-native-document-picker: a3c4ce6322b7aa9902fe8ffb8e03d5858b5d7beb
1998-
react-native-document-viewer: 6fc76b1f9f2773a39b155f10aae674cf731f21b2
1997+
react-native-document-picker: 82f4a016ec665949ac859dfed0b38fc5f4121d88
1998+
react-native-document-viewer: e88dc4e4c5b27b261628dddc07e254dace79ac68
19991999
react-native-segmented-control: bf6e0032726727498e18dd437ae88afcdbc18e99
20002000
React-NativeModulesApple: a9464983ccc0f66f45e93558671f60fc7536e438
20012001
React-oscompat: 73db7dbc80edef36a9d6ed3c6c4e1724ead4236d

example/metro.config.js

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,8 @@
11
const path = require('path')
22

3-
const exclusionList = require('metro-config/private/defaults/exclusionList')
4-
5-
const blockList = exclusionList([
6-
/node_modules\/.*\/node_modules\/react-native\/.*/,
7-
8-
// This stops "react-native run-windows" from causing the metro server to
9-
// crash if its already running
10-
new RegExp(`${path.join(__dirname, 'windows').replace(/[/\\]+/g, '/')}.*`),
11-
12-
// Workaround for `EPERM: operation not permitted, lstat '~\midl-MIDLRT-cl.read.1.tlog'`
13-
/.*\.tlog/,
14-
15-
// Prevent Metro from watching temporary files generated by Visual Studio
16-
// otherwise it may crash when they are removed when closing a project.
17-
/.*\/.vs\/.*/,
18-
19-
// Workaround for `EBUSY: resource busy or locked, open '~\msbuild.ProjectImports.zip'`
20-
/.*\.ProjectImports\.zip/,
21-
])
22-
233
const config = {
244
projectRoot: __dirname,
255
watchFolders: [path.join(__dirname, '../..')],
26-
resolver: {
27-
blockList,
28-
extraNodeModules: {
29-
'@react-native-documents/picker': path.resolve(__dirname, '../../packages/document-picker'),
30-
'@react-native-documents/viewer': path.resolve(__dirname, '../../packages/document-viewer'),
31-
},
32-
},
336
}
347

358
// Starting with react-native 0.72, we are required to provide a full config.

example/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"@wdio/spec-reporter": "^8.36.1",
4141
"appium": "^2.5.4",
4242
"appium-uiautomator2-driver": "^3.1.0",
43+
"babel-plugin-module-resolver": "^5.0.2",
4344
"pod-install": "1.0.7",
4445
"react-native-test-app": "^4.4.12",
4546
"ts-node": "^10.9.2",

packages/document-picker/android/build.gradle

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,7 @@ if (isNewArchitectureEnabled()) {
3434

3535

3636
android {
37-
def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
38-
if (agpVersion.tokenize('.')[0].toInteger() >= 7) {
39-
namespace "com.reactnativedocumentpicker"
40-
}
37+
namespace "com.reactnativedocumentpicker"
4138
compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
4239

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

73-
def kotlin_version = getExtOrIntegerDefault("kotlinVersion")
74-
7570
dependencies {
7671
//noinspection GradleDynamicVersion
7772
implementation 'com.facebook.react:react-native:+' // from node_modules
78-
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
7973
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.1"
8074
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DocumentPicker_kotlinVersion=2.0.21
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.reactnativedocumentpicker">
3-
</manifest>
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"/>

packages/document-viewer/android/build.gradle

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,7 @@ if (isNewArchitectureEnabled()) {
3434

3535

3636
android {
37-
def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
38-
if (agpVersion.tokenize('.')[0].toInteger() >= 7) {
39-
namespace "com.reactnativedocumentviewer"
40-
}
37+
namespace "com.reactnativedocumentviewer"
4138
compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
4239

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

73-
def kotlin_version = getExtOrIntegerDefault("kotlinVersion")
74-
7570
dependencies {
7671
//noinspection GradleDynamicVersion
7772
implementation 'com.facebook.react:react-native:+' // from node_modules
78-
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
7973
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DocumentPicker_kotlinVersion=2.0.21

0 commit comments

Comments
 (0)