Skip to content
This repository was archived by the owner on Mar 7, 2025. It is now read-only.

Commit 4f4aa06

Browse files
authored
Merge pull request #4 from wordpress-mobile/upgrade-to-gradle-7.1.1
Upgrade to gradle 7.1.1
2 parents 1e482d8 + 5cfc32c commit 4f4aa06

9 files changed

Lines changed: 68 additions & 146 deletions

File tree

android/build.gradle

Lines changed: 19 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,32 @@
1-
def safeExtGet(prop, fallback) {
2-
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
1+
plugins {
2+
id "com.android.library"
3+
id "maven-publish"
34
}
45

5-
buildscript {
6-
// The Android Gradle plugin is only required when opening the android folder stand-alone.
7-
// This avoids unnecessary downloads and potential conflicts when the library is included as a
8-
// module dependency in an application project.
9-
repositories {
10-
google()
11-
jcenter()
12-
}
13-
dependencies {
14-
//noinspection GradleDependency
15-
classpath rootProject.ext.has('gradleBuildTools') ? rootProject.ext.get('gradleBuildTools') : 'com.android.tools.build:gradle:3.3.0'
16-
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
17-
}
18-
}
19-
20-
apply plugin: 'com.android.library'
21-
apply plugin: 'maven'
22-
apply plugin: 'com.github.dcendents.android-maven'
23-
246
android {
25-
compileSdkVersion safeExtGet('compileSdkVersion', 28)
26-
buildToolsVersion safeExtGet('buildToolsVersion', '28.0.3')
7+
compileSdkVersion 30
8+
279
defaultConfig {
28-
minSdkVersion safeExtGet('minSdkVersion', 16)
29-
targetSdkVersion safeExtGet('targetSdkVersion', 28)
30-
versionCode 1
31-
versionName "1.0"
10+
minSdkVersion 21
11+
targetSdkVersion 30
3212
}
3313
lintOptions {
3414
abortOnError false
3515
}
3616
}
3717

3818
repositories {
39-
mavenLocal()
40-
maven {
41-
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
42-
url "$rootDir/../node_modules/react-native/android"
43-
}
44-
maven {
45-
// Android JSC is installed from npm
46-
url "$rootDir/../node_modules/jsc-android/dist"
47-
}
48-
google()
49-
jcenter()
5019
if (project == rootProject) {
51-
maven {
52-
url "https://a8c-libs.s3.amazonaws.com/android/react-native-mirror"
53-
}
20+
maven { url "https://a8c-libs.s3.amazonaws.com/android/react-native-mirror" }
5421
} else {
5522
// When building as a dep, the RN's maven repo is locally in the node_modules folder
5623
def nodeModulesPath = "${project.buildDir}/../../node_modules/"
5724
maven { url "${nodeModulesPath}/react-native/android" }
5825
}
26+
27+
google()
28+
jcenter()
29+
mavenCentral()
5930
}
6031

6132
dependencies {
@@ -69,80 +40,14 @@ dependencies {
6940
implementation "androidx.transition:transition:1.1.0"
7041
}
7142

72-
def configureReactNativePom(def pom) {
73-
def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text)
74-
75-
pom.project {
76-
name packageJson.title
77-
artifactId packageJson.name
78-
version = packageJson.version
79-
group = "com.swmansion.reanimated"
80-
description packageJson.description
81-
url packageJson.repository.baseUrl
82-
83-
licenses {
84-
license {
85-
name packageJson.license
86-
url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename
87-
distribution 'repo'
88-
}
89-
}
90-
91-
developers {
92-
developer {
93-
id packageJson.author.username
94-
name packageJson.author.name
43+
afterEvaluate {
44+
publishing {
45+
publications {
46+
release(MavenPublication) {
47+
from components.release
48+
groupId = 'com.github.wordpress-mobile'
49+
artifactId = 'react-native-reanimated'
9550
}
9651
}
9752
}
9853
}
99-
100-
afterEvaluate { project ->
101-
102-
task androidJavadoc(type: Javadoc) {
103-
source = android.sourceSets.main.java.srcDirs
104-
classpath += files(android.bootClasspath)
105-
classpath += files(project.getConfigurations().getByName('compile').asList())
106-
include '**/*.java'
107-
}
108-
109-
task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) {
110-
classifier = 'javadoc'
111-
from androidJavadoc.destinationDir
112-
}
113-
114-
task androidSourcesJar(type: Jar) {
115-
classifier = 'sources'
116-
from android.sourceSets.main.java.srcDirs
117-
include '**/*.java'
118-
}
119-
120-
android.libraryVariants.all { variant ->
121-
def compileTask
122-
if (variant.hasProperty('javaCompileProvider')){
123-
compileTask = variant.javaCompileProvider.get()
124-
}else{
125-
compileTask = variant.javaCompile
126-
}
127-
128-
def name = variant.name.capitalize()
129-
task "jar${name}"(type: Jar, dependsOn: compileTask) {
130-
from compileTask.destinationDir
131-
}
132-
}
133-
134-
artifacts {
135-
archives androidSourcesJar
136-
archives androidJavadocJar
137-
}
138-
139-
task installArchives(type: Upload) {
140-
configuration = configurations.archives
141-
repositories.mavenDeployer {
142-
// Deploy to react-native-event-bridge/maven, ready to publish to npm
143-
repository url: "file://${projectDir}/../android/maven"
144-
145-
configureReactNativePom pom
146-
}
147-
}
148-
}

android/gradle.properties

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,7 @@
1-
# Project-wide Gradle settings.
2-
3-
# IDE (e.g. Android Studio) users:
4-
# Gradle settings configured through the IDE *will override*
5-
# any settings specified in this file.
6-
7-
# For more details on how to configure your build environment visit
8-
# http://www.gradle.org/docs/current/userguide/build_environment.html
9-
10-
# Specifies the JVM arguments used for the daemon process.
11-
# The setting is particularly useful for tweaking memory settings.
12-
# Default value: -Xmx10248m -XX:MaxPermSize=256m
13-
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14-
15-
# When configured, Gradle will run in incubating parallel mode.
16-
# This option should only be used with decoupled projects. More details, visit
17-
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18-
# org.gradle.parallel=true
1+
org.gradle.jvmargs=-Xmx1536m -XX:+HeapDumpOnOutOfMemoryError
2+
org.gradle.parallel=true
3+
org.gradle.configureondemand=true
4+
org.gradle.caching=true
195

206
android.useAndroidX=true
21-
android.enableJetifier=true
7+
android.enableJetifier=true
1.26 KB
Binary file not shown.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Thu Jul 16 13:24:34 CEST 2020
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip

android/gradlew

100644100755
Lines changed: 17 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

android/gradlew.bat

Lines changed: 17 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

android/settings.gradle

Lines changed: 0 additions & 1 deletion
This file was deleted.

android/settings.gradle.kts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
pluginManagement {
2+
plugins {
3+
id("com.android.library") version "4.2.2"
4+
}
5+
repositories {
6+
gradlePluginPortal()
7+
google()
8+
}
9+
}

jitpack.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)