Skip to content

Commit

Permalink
fix: update outdated build tools versions
Browse files Browse the repository at this point in the history
  • Loading branch information
szymonrybczak committed Dec 30, 2024
1 parent 33d2010 commit 99250b5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 38 deletions.
35 changes: 7 additions & 28 deletions modules/background-task/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
buildscript {
// Buildscript is evaluated before everything else so we can't use getExtOrDefault
def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["ReactNativeBackgroundTask_kotlinVersion"]
ext.getExtOrDefault = {name ->
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['<%- project.name -%>_' + name]
}

repositories {
google()
mavenCentral()
}

dependencies {
classpath "com.android.tools.build:gradle:7.2.1"
classpath "com.android.tools.build:gradle:8.7.2"
// noinspection DifferentKotlinGradleVersion
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}"
}
}

Expand All @@ -30,33 +32,12 @@ if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}

def getExtOrDefault(name) {
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["ReactNativeBackgroundTask_" + name]
}

def getExtOrIntegerDefault(name) {
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["ReactNativeBackgroundTask_" + name]).toInteger()
}

def supportsNamespace() {
def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
def major = parsed[0].toInteger()
def minor = parsed[1].toInteger()

// Namespace support was added in 7.3.0
return (major == 7 && minor >= 3) || major >= 8
}

android {
if (supportsNamespace()) {
namespace "com.expensify.reactnativebackgroundtask"

sourceSets {
main {
manifest.srcFile "src/main/AndroidManifestNew.xml"
}
}
}
namespace "com.expensify.reactnativebackgroundtask"

compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")

Expand Down Expand Up @@ -110,10 +91,8 @@ repositories {
def kotlin_version = getExtOrDefault("kotlinVersion")

dependencies {
// For < 0.71, this will be from the local maven repo
// For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+"
implementation "com.facebook.react:react-android"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}

Expand Down
10 changes: 5 additions & 5 deletions modules/background-task/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ReactNativeBackgroundTask_kotlinVersion=1.7.0
ReactNativeBackgroundTask_minSdkVersion=21
ReactNativeBackgroundTask_targetSdkVersion=31
ReactNativeBackgroundTask_compileSdkVersion=31
ReactNativeBackgroundTask_ndkversion=21.4.7075529
ReactNativeBackgroundTask_kotlinVersion=1.9.24
ReactNativeBackgroundTask_minSdkVersion=23
ReactNativeBackgroundTask_targetSdkVersion=34
ReactNativeBackgroundTask_compileSdkVersion=34
ReactNativeBackgroundTask_ndkversion=26.1.10909125
4 changes: 2 additions & 2 deletions modules/background-task/android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.expensify.reactnativebackgroundtask">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
</manifest>

This file was deleted.

0 comments on commit 99250b5

Please sign in to comment.