From 54d78926ce452bd8f0f83eeb9008c407c8227e78 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Fri, 5 May 2023 04:07:40 -0700 Subject: [PATCH] AGP to 8.0.1 (#1280) Summary: Pull Request resolved: https://github.com/facebook/yoga/pull/1280 I'm refreshing some of the dependencies of the project, here doing AGP to 8.0.1. I'm also removing the older publishing plugin as we're most likely going to use Gradle's default publishing + another plugin to manage the nexus interactions (the same we use on React Native). I'm also doing some changes on the JDK side: - Bumps the JDK version to 17 as that's required by AGP - Bumps the source/target version to JDK 8. JDK 7 is long deprecated and we're getting a lot of warnings for it on console. Users should be on JDK 11 already by now, but 8 is also good enough. Reviewed By: passy Differential Revision: D45564575 fbshipit-source-id: ffe1cc15892659923177a2cad609d5d30f8249ac --- .github/actions/setup-android/action.yml | 4 ++-- android/build.gradle | 9 +++++++-- build.gradle | 7 +++---- java/build.gradle | 9 +++++++-- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/.github/actions/setup-android/action.yml b/.github/actions/setup-android/action.yml index 967009ed8f..f138d87daa 100644 --- a/.github/actions/setup-android/action.yml +++ b/.github/actions/setup-android/action.yml @@ -6,5 +6,5 @@ runs: - name: Select Java Version uses: actions/setup-java@v2 with: - distribution: temurin - java-version: 11 + distribution: zulu + java-version: 17 diff --git a/android/build.gradle b/android/build.gradle index c971188fc8..69c2509375 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -23,6 +23,13 @@ android { targetCompatibility rootProject.targetCompatibilityVersion sourceCompatibility rootProject.sourceCompatibilityVersion } + + publishing { + multipleVariants { + withSourcesJar() + includeBuildTypeValues('debug', 'release') + } + } } dependencies { @@ -34,5 +41,3 @@ dependencies { tasks.withType(Javadoc).all { enabled = false } - -apply plugin: 'com.vanniktech.maven.publish' diff --git a/build.gradle b/build.gradle index 193a67490b..78e93eca26 100644 --- a/build.gradle +++ b/build.gradle @@ -13,8 +13,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.3.1' - classpath 'com.vanniktech:gradle-maven-publish-plugin:0.15.1' + classpath 'com.android.tools.build:gradle:8.0.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } @@ -34,8 +33,8 @@ ext { minSdkVersion = 21 compileSdkVersion = 33 targetSdkVersion = 33 - sourceCompatibilityVersion = JavaVersion.VERSION_1_7 - targetCompatibilityVersion = JavaVersion.VERSION_1_7 + sourceCompatibilityVersion = JavaVersion.VERSION_1_8 + targetCompatibilityVersion = JavaVersion.VERSION_1_8 } task clean(type: Delete) { diff --git a/java/build.gradle b/java/build.gradle index a0f633c8c5..252e48a1e0 100644 --- a/java/build.gradle +++ b/java/build.gradle @@ -45,6 +45,13 @@ android { res.srcDirs = ['res'] } } + + publishing { + multipleVariants { + withSourcesJar() + includeBuildTypeValues('debug', 'release') + } + } } dependencies { @@ -52,5 +59,3 @@ dependencies { implementation 'com.facebook.soloader:soloader:0.10.4' testImplementation 'junit:junit:4.12' } - -apply plugin: 'com.vanniktech.maven.publish'