Skip to content

Commit 303d11c

Browse files
committed
suppor new android gradle 7 version
1 parent 959fa27 commit 303d11c

File tree

3 files changed

+9
-87
lines changed

3 files changed

+9
-87
lines changed

android/build.gradle

Lines changed: 7 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,24 @@ def safeExtGet(prop, fallback) {
55
}
66

77
buildscript {
8-
// The Android Gradle plugin is only required when opening the android folder stand-alone.
9-
// This avoids unnecessary downloads and potential conflicts when the library is included as a
10-
// module dependency in an application project.
118
if (project == rootProject) {
129
repositories {
1310
google()
14-
jcenter()
11+
mavenCentral()
1512
}
1613
dependencies {
17-
classpath 'com.android.tools.build:gradle:3.7.1'
14+
classpath 'com.android.tools.build:gradle:7.0.0'
1815
}
1916
}
2017
}
2118

2219
apply plugin: 'com.android.library'
23-
apply plugin: 'maven'
20+
apply plugin: 'maven-publish'
2421

25-
26-
// Matches values in recent template from React Native 0.59 / 0.60
27-
// https://github.com/facebook/react-native/blob/0.59-stable/template/android/build.gradle#L5-L9
28-
// https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle#L5-L9
29-
def DEFAULT_COMPILE_SDK_VERSION = 29
30-
def DEFAULT_BUILD_TOOLS_VERSION = "29.0.0"
22+
def DEFAULT_COMPILE_SDK_VERSION = 31
23+
def DEFAULT_BUILD_TOOLS_VERSION = "31.0.0"
3124
def DEFAULT_MIN_SDK_VERSION = 21
32-
def DEFAULT_TARGET_SDK_VERSION = 29
25+
def DEFAULT_TARGET_SDK_VERSION = 31
3326

3427
android {
3528
compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
@@ -56,7 +49,7 @@ repositories {
5649
url "$rootDir/../node_modules/jsc-android/dist"
5750
}
5851
google()
59-
jcenter()
52+
mavenCentral()
6053
}
6154

6255
dependencies {
@@ -66,74 +59,3 @@ dependencies {
6659
implementation 'com.facebook.react:react-native:+' // From node_modules
6760
implementation 'com.getmati:mati-sdk:3.14.0'
6861
}
69-
70-
def configureReactNativePom(def pom) {
71-
def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text)
72-
73-
pom.project {
74-
name packageJson.title
75-
artifactId packageJson.name
76-
version = packageJson.version
77-
group = "com.reactlibrary"
78-
description packageJson.description
79-
url packageJson.repository.baseUrl
80-
81-
licenses {
82-
license {
83-
name packageJson.license
84-
url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename
85-
distribution 'repo'
86-
}
87-
}
88-
89-
developers {
90-
developer {
91-
id packageJson.author.username
92-
name packageJson.author.name
93-
}
94-
}
95-
}
96-
}
97-
98-
afterEvaluate { project ->
99-
// some Gradle build hooks ref:
100-
// https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html
101-
task androidJavadoc(type: Javadoc) {
102-
source = android.sourceSets.main.java.srcDirs
103-
classpath += files(android.bootClasspath)
104-
classpath += files(project.getConfigurations().getByName('compile').asList())
105-
include '**/*.java'
106-
}
107-
108-
task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) {
109-
classifier = 'javadoc'
110-
from androidJavadoc.destinationDir
111-
}
112-
113-
task androidSourcesJar(type: Jar) {
114-
classifier = 'sources'
115-
from android.sourceSets.main.java.srcDirs
116-
include '**/*.java'
117-
}
118-
119-
android.libraryVariants.all { variant ->
120-
def name = variant.name.capitalize()
121-
task "jar${name}"(type: Jar, dependsOn: variant.javaCompile) {
122-
from variant.javaCompile.destinationDir
123-
}
124-
}
125-
126-
artifacts {
127-
archives androidSourcesJar
128-
archives androidJavadocJar
129-
}
130-
131-
task installArchives(type: Upload) {
132-
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
137-
}
138-
}
139-
}

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-mati-global-id-sdk",
33
"title": "React Native Mati Global Id Sdk",
4-
"version": "3.3.10",
4+
"version": "3.4.0",
55
"description": "Mati React Native Plugin",
66
"main": "index.js",
77
"scripts": {

react-native-mati-global-id-sdk.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Pod::Spec.new do |s|
1313
s.license = "MIT"
1414
# s.license = { :type => "MIT", :file => "FILE_LICENSE" }
1515
s.authors = { "Andrey Posnov" => "andrey.posnov@mati.io" }
16-
s.platforms = { :ios => "11.4" }
16+
s.platforms = { :ios => "12.0" }
1717
s.source = { :git => "https://github.com/github_account/react-native-mati-global-id-sdk.git", :tag => "#{s.version}" }
1818

1919
s.source_files = "ios/**/*.{h,m,swift}"

0 commit comments

Comments
 (0)