Skip to content

Commit

Permalink
Removed Java 17 compileOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-saia-datadog committed Oct 8, 2024
1 parent ff1b34a commit 9fcb46a
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 24 deletions.
17 changes: 11 additions & 6 deletions packages/core/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -98,22 +98,27 @@ def getExtOrIntegerDefault(name) {
android {
compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
buildToolsVersion getExtOrDefault('buildToolsVersion')

def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION

if (agpVersion.tokenize('.')[0].toInteger() >= 7) {
namespace = "com.datadog.reactnative"
}

if (agpVersion.tokenize('.')[0].toInteger() >= 8) {
buildFeatures {
buildConfig = true
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.majorVersion
if (agpVersion.tokenize('.')[0].toInteger() < 8) {
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.majorVersion
}
}

defaultConfig {
Expand Down
18 changes: 11 additions & 7 deletions packages/internal-testing-tools/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -93,23 +93,27 @@ def getExtOrIntegerDefault(name) {
android {
compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
buildToolsVersion getExtOrDefault('buildToolsVersion')

def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION

if (agpVersion.tokenize('.')[0].toInteger() >= 7) {
namespace = "com.datadog.reactnative.internaltesting"
}

if (agpVersion.tokenize('.')[0].toInteger() >= 8) {
buildFeatures {
buildConfig = true
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.majorVersion
if (agpVersion.tokenize('.')[0].toInteger() < 8) {
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.majorVersion
}
}

defaultConfig {
Expand Down
22 changes: 11 additions & 11 deletions packages/react-native-session-replay/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -96,23 +96,27 @@ def getExtOrIntegerDefault(name) {
android {
compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
buildToolsVersion getExtOrDefault('buildToolsVersion')

def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION

if (agpVersion.tokenize('.')[0].toInteger() >= 7) {
namespace = "com.datadog.reactnative.sessionreplay"
}

if (agpVersion.tokenize('.')[0].toInteger() >= 8) {
buildFeatures {
buildConfig = true
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.majorVersion
if (agpVersion.tokenize('.')[0].toInteger() < 8) {
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.majorVersion
}
}

defaultConfig {
Expand Down Expand Up @@ -150,10 +154,6 @@ android {
lintOptions {
disable 'GradleCompatible'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}

repositories {
Expand Down

0 comments on commit 9fcb46a

Please sign in to comment.