Skip to content

Commit db37a18

Browse files
committed
Fix build.gradle to match gradle 7.0 breaking changes
1 parent 1b9906a commit db37a18

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"@react-native-async-storage/async-storage": "^1.15.8",
1414
"react": "17.0.2",
1515
"react-native": "0.65.1",
16-
"react-native-android-notification-listener": "^4.0.0"
16+
"react-native-android-notification-listener": "^4.0.2"
1717
},
1818
"devDependencies": {
1919
"@babel/core": "^7.12.9",

package/android/build.gradle

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,16 @@ buildscript {
2020
}
2121
}
2222

23+
2324
apply plugin: 'com.android.library'
24-
apply plugin: 'maven'
25+
26+
def GRADLE_VERSION = Double.parseDouble("$gradle.gradleVersion")
27+
28+
if (GRADLE_VERSION >= 7.0) {
29+
apply plugin: 'maven-publish'
30+
} else {
31+
apply plugin: 'maven'
32+
}
2533

2634
// Matches values in recent template from React Native 0.59 / 0.60
2735
// https://github.com/facebook/react-native/blob/0.59-stable/template/android/build.gradle#L5-L9
@@ -130,10 +138,13 @@ afterEvaluate { project ->
130138

131139
task installArchives(type: Upload) {
132140
configuration = configurations.archives
133-
repositories.mavenDeployer {
134-
// Deploy to react-native-event-bridge/maven, ready to publish to npm
135-
repository url: "file://${projectDir}/../android/maven"
136-
configureReactNativePom pom
141+
142+
if (GRADLE_VERSION < 7.0) {
143+
repositories.mavenDeployer {
144+
// Deploy to react-native-event-bridge/maven, ready to publish to npm
145+
repository url: "file://${projectDir}/../android/maven"
146+
configureReactNativePom pom
147+
}
137148
}
138149
}
139150
}

package/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "react-native-android-notification-listener",
33
"title": "React Native Android Notification Listener",
4-
"version": "4.0.1",
4+
"version": "4.0.2",
55
"description": "React Native Android Notification Listener - Listen for status bar notifications from all applications",
66
"main": "index.js",
77
"typings": "index.d.ts",

0 commit comments

Comments
 (0)