Unverified Commit 60f30a65 authored by Bartek Pacia's avatar Bartek Pacia Committed by GitHub

Migrate integration_test plugin to Gradle Kotlin DSL (#142008)

We already have a simple app in this repo that fully uses Gradle Kotlin DSL (see #141541). The next small step is to have at least one plugin that also uses Gradle Kotlin DSL. Let's use `integration_test` for that, since it's versioned with Flutter SDK.
parent 445b0868
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
group 'dev.flutter.plugins.integration_test' group = "dev.flutter.plugins.integration_test"
version '1.0-SNAPSHOT' version = "1.0-SNAPSHOT"
buildscript { buildscript {
repositories { repositories {
...@@ -12,10 +12,14 @@ buildscript { ...@@ -12,10 +12,14 @@ buildscript {
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:7.3.1' classpath("com.android.tools.build:gradle:7.3.1")
} }
} }
plugins {
id("com.android.library")
}
rootProject.allprojects { rootProject.allprojects {
repositories { repositories {
google() google()
...@@ -23,42 +27,37 @@ rootProject.allprojects { ...@@ -23,42 +27,37 @@ rootProject.allprojects {
} }
} }
// project.getTasks().withType(JavaCompile){
// options.compilerArgs << "-Xlint:all" << "-Werror"
// }
apply plugin: 'com.android.library'
android { android {
// Conditional for compatibility with AGP <4.2. // Conditional for compatibility with AGP <4.2.
if (project.android.hasProperty("namespace")) { if (project.findProject("android")?.hasProperty("namespace") == true) {
namespace 'dev.flutter.integration_test' namespace = "dev.flutter.integration_test"
} }
compileSdk 34 namespace = "dev.flutter.integration_test"
compileSdk = 34
compileOptions { compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8 sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8
} }
defaultConfig { defaultConfig {
minSdkVersion 21 minSdk = 21
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles 'lib-proguard-rules.txt' consumerProguardFiles("lib-proguard-rules.txt")
} }
dependencies { dependencies {
// TODO(egarciad): These dependencies should not be added to release builds. // TODO(egarciad): These dependencies should not be added to release builds.
// https://github.com/flutter/flutter/issues/56591 // https://github.com/flutter/flutter/issues/56591
testImplementation 'junit:junit:4.12' testImplementation("junit:junit:4.12")
testImplementation 'org.mockito:mockito-inline:5.0.0' testImplementation("org.mockito:mockito-inline:5.0.0")
// https://developer.android.com/jetpack/androidx/releases/test/#1.2.0 // https://developer.android.com/jetpack/androidx/releases/test/#1.2.0
api 'androidx.test:runner:1.2.0' api("androidx.test:runner:1.2.0")
api 'androidx.test:rules:1.2.0' api("androidx.test:rules:1.2.0")
api 'androidx.test.espresso:espresso-core:3.2.0' api("androidx.test.espresso:espresso-core:3.2.0")
implementation 'com.google.guava:guava:28.1-android' implementation("com.google.guava:guava:28.1-android")
} }
} }
...@@ -2,4 +2,4 @@ ...@@ -2,4 +2,4 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
rootProject.name = 'integrationTest' rootProject.name = "integrationTest"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment