Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Android Studio be able to run android embedding unit tests out of the box #50840

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 34 additions & 5 deletions shell/platform/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.4"
classpath "com.android.tools.build:gradle:7.4.2"
}
}

Expand All @@ -20,17 +20,46 @@ repositories {
apply plugin: "com.android.library"

android {
compileSdk 34
compileSdkVersion 34

defaultConfig {
minSdkVersion 19
}

sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs './'
java.include './io.flutter/**'
test {
java.srcDir './test'
java.include './test/io.flutter/**'
}
}
}
}

dependencies {
implementation fileTree(include: ["*.jar"], dir: "../../../../third_party/android_embedding_dependencies/lib/")
testOptions {
unitTests {
includeAndroidResources = true
}

}

dependencies {
implementation fileTree(include: ["*.jar"], dir: "../../../../third_party/android_embedding_dependencies/lib/")

// These dependencies should be kept in line with those in the ./test_runner/build.gradle
implementation "androidx.test:core:1.4.0"
implementation "com.google.android.play:core:1.8.0"
implementation "com.ibm.icu:icu4j:69.1"
implementation "org.robolectric:robolectric:4.11"
implementation "junit:junit:4.13.2"
implementation "androidx.test.ext:junit:1.1.4-alpha07"

def mockitoVersion = "4.7.0"
implementation "org.mockito:mockito-core:$mockitoVersion"
implementation "org.mockito:mockito-inline:$mockitoVersion"
implementation "org.mockito:mockito-android:$mockitoVersion"
}
}