Skip to content
This repository was archived by the owner on Oct 18, 2024. It is now read-only.

Commit 312395b

Browse files
committed
tests(tooling-api): update minimum supported Gradle version for latest AGP version tests
1 parent d5762bd commit 312395b

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

build-info/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
1616
*/
1717

18+
import com.android.SdkConstants
1819
import com.itsaky.androidide.build.config.AGP_VERSION_MINIMUM
1920
import com.itsaky.androidide.build.config.BuildConfig
2021
import com.itsaky.androidide.build.config.CI
@@ -74,6 +75,7 @@ tasks.create("generateBuildInfo") {
7475

7576
"AGP_VERSION_MININUM" to AGP_VERSION_MINIMUM,
7677
"AGP_VERSION_LATEST" to libs.versions.agp.tooling.get(),
78+
"AGP_VERSION_GRADLE_LATEST" to SdkConstants.GRADLE_LATEST_VERSION,
7779

7880
"SNAPSHOTS_REPOSITORY" to VersionUtils.SONATYPE_SNAPSHOTS_REPO,
7981
"PUBLIC_REPOSITORY" to VersionUtils.SONATYPE_PUBLIC_REPO,

build-info/src/main/java/com/itsaky/androidide/buildinfo/BuildInfo.java.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public class BuildInfo {
2828
// ---------- Tooling version info --------------
2929
public static final String AGP_VERSION_MININUM = "@@AGP_VERSION_MININUM@@";
3030
public static final String AGP_VERSION_LATEST = "@@AGP_VERSION_LATEST@@";
31+
public static final String AGP_VERSION_GRADLE_LATEST = "@@AGP_VERSION_GRADLE_LATEST@@";
3132

3233
// ---------- Maven version info ----------------
3334

subprojects/tooling-api-impl/src/test/java/com/itsaky/androidide/tooling/impl/CIOnlyToolingApiTests.kt

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ class CIOnlyToolingApiTests {
4848
// Test the minimum supported and the latest AGP version
4949
val versions = listOf(
5050
// AGP to Gradle
51-
BuildInfo.AGP_VERSION_MININUM to "7.3.3", BuildInfo.AGP_VERSION_LATEST to "8.2")
51+
BuildInfo.AGP_VERSION_MININUM to "7.3.3",
52+
BuildInfo.AGP_VERSION_LATEST to BuildInfo.AGP_VERSION_GRADLE_LATEST
53+
)
5254

5355
val client = ToolingApiTestLauncher.MultiVersionTestClient()
5456
for ((agpVersion, gradleVersion) in versions) {
@@ -69,9 +71,21 @@ class CIOnlyToolingApiTests {
6971

7072
val client = ToolingApiTestLauncher.MultiVersionTestClient(
7173
agpVersion = agpVersion.toStringSimple(),
72-
gradleVersion = "${agpVersion.major}.${agpVersion.minor}", log = log)
73-
ToolingApiTestLauncher.launchServer(client = client, log = log, sysProps = mapOf(
74-
ToolingProps.TESTING_LATEST_AGP_VERSION to ToolingApiTestLauncher.MultiVersionTestClient.DEFAULT_AGP_VERSION)) {
74+
gradleVersion = BuildInfo.AGP_VERSION_GRADLE_LATEST,
75+
log = log
76+
)
77+
78+
ToolingApiTestLauncher.launchServer(
79+
client = client,
80+
log = log,
81+
82+
// Version of Android Gradle Plugin that the tooling API should recognize
83+
// as the latest one
84+
sysProps = mapOf(
85+
ToolingProps.TESTING_LATEST_AGP_VERSION
86+
to ToolingApiTestLauncher.MultiVersionTestClient.DEFAULT_AGP_VERSION
87+
)
88+
) {
7589
val output = log.toString()
7690

7791
if (result?.isSuccessful != true) {

0 commit comments

Comments
 (0)