Skip to content
This repository was archived by the owner on Jul 27, 2023. It is now read-only.
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
64 changes: 29 additions & 35 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,65 +1,59 @@
buildscript {
repositories {
google()
jcenter()
}

dependencies {
classpath rootProject.ext.has('gradleBuildTools') ? rootProject.ext.get('gradleBuildTools') : 'com.android.tools.build:gradle:3.3.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
}
ext.isStandaloneProject = (project == rootProject)
}

apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'

def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
plugins {
id "com.android.library"
id "maven-publish"
}

android {
compileSdkVersion safeExtGet("compileSdkVersion", 28)
compileSdkVersion 30

defaultConfig {
minSdkVersion safeExtGet('minSdkVersion', 16)
targetSdkVersion safeExtGet('targetSdkVersion', 28)
versionCode 1
versionName "1.0"
minSdkVersion 21
targetSdkVersion 30
}

// Include "lib/" as sources, unfortunetely react-native link can't handle
// setting up alternative gradle modules. We still have "lib" defined as a
// standalone gradle module just to be used in AndroidNativeExample
sourceSets {
main.java.srcDirs += 'lib/src/main/java'
}

}

allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
if (project == rootProject) {
maven {
url "https://a8c-libs.s3.amazonaws.com/android/react-native-mirror"
}
if (isStandaloneProject) {
maven { url "https://a8c-libs.s3.amazonaws.com/android/react-native-mirror" }
} else {
// When building as a dep, the RN's maven repo is locally in the node_modules folder
def nodeModulesPath = "${project.buildDir}/../../node_modules/"
maven { url "${nodeModulesPath}/react-native/android" }
}

google()
jcenter()
mavenCentral()
}
}

dependencies {
if (project == rootProject) {
if (isStandaloneProject) {
// If this is the root project (e.g. Jitpack), specify a version
implementation 'com.facebook.react:react-native:0.64.0'
} else {
//noinspection GradleDynamicVersion
api "com.facebook.react:react-native:+"
}
}

afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.release
groupId = 'com.github.wordpress-mobile'
artifactId = 'react-native-gesture-handler'
}
}
}
}
23 changes: 6 additions & 17 deletions android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
# Project-wide Gradle settings.
org.gradle.jvmargs=-Xmx1536m -XX:+HeapDumpOnOutOfMemoryError
org.gradle.parallel=true
org.gradle.configureondemand=true
org.gradle.caching=true

# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.

# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
android.useAndroidX=true
android.enableJetifier=true
Binary file modified android/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Thu Jul 16 11:44:51 CEST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
18 changes: 17 additions & 1 deletion android/gradlew
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
#!/usr/bin/env sh

#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

##############################################################################
##
## Gradle start up script for UN*X
Expand Down Expand Up @@ -28,7 +44,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
Expand Down
18 changes: 17 additions & 1 deletion android/gradlew.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem http://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
Expand All @@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
Expand Down
27 changes: 15 additions & 12 deletions android/lib/build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
apply plugin: 'com.android.library'

repositories {
maven { url 'https://repo1.maven.org/maven2' }
plugins {
id "com.android.library"
}

android {
compileSdkVersion 23
buildToolsVersion '25.0.0'
compileSdkVersion 30

defaultConfig {
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
minSdkVersion 21
targetSdkVersion 30
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, is there a way to inherit these settings from android/build.gradle?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could add a property to the extension, but I think this one needs a little bit of a project structure re-work. I don't think that change would be high impact, so I am leaving it as is.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Thanks for the explanation 😄

}

buildTypes {
release {
minifyEnabled false
Expand All @@ -23,6 +19,13 @@ android {
}

dependencies {
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
if (isStandaloneProject) {
// If this is the root project (e.g. Jitpack), specify a version
implementation 'com.facebook.react:react-native:0.64.0'
} else {
//noinspection GradleDynamicVersion
api "com.facebook.react:react-native:+"
}
testImplementation 'junit:junit:4.12'
implementation "androidx.appcompat:appcompat:1.3.1"
}
1 change: 0 additions & 1 deletion android/settings.gradle

This file was deleted.

11 changes: 11 additions & 0 deletions android/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
pluginManagement {
plugins {
id("com.android.library") version "4.2.2"
}
repositories {
gradlePluginPortal()
google()
}
}

include("lib")
7 changes: 0 additions & 7 deletions jitpack.yml

This file was deleted.