From fb126760658bf940593cf3882923d6442f1d53bf Mon Sep 17 00:00:00 2001 From: Guillermo Mazzola Date: Wed, 4 Dec 2024 11:30:52 +0100 Subject: [PATCH] Added more APKs and `java-test-fixtures` (#2) --- demo/build.gradle.kts | 12 ++++++++---- .../gmazzo/gradle/aar2jar/demo/CameraHelper.kt | 11 +++++++++++ .../gmazzo/gradle/aar2jar/demo/BrowserHelper.kt | 11 +++++++++++ gradle/libs.versions.toml | 5 ++++- 4 files changed, 34 insertions(+), 5 deletions(-) create mode 100644 demo/src/test/kotlin/io/github/gmazzo/gradle/aar2jar/demo/CameraHelper.kt create mode 100644 demo/src/testFixtures/kotlin/io/github/gmazzo/gradle/aar2jar/demo/BrowserHelper.kt diff --git a/demo/build.gradle.kts b/demo/build.gradle.kts index cd3eed7..b1ccab4 100644 --- a/demo/build.gradle.kts +++ b/demo/build.gradle.kts @@ -1,16 +1,20 @@ -import java.lang.Thread.sleep - plugins { java + jacoco + `java-test-fixtures` alias(libs.plugins.kotlin.jvm) id("io.github.gmazzo.aar2jar") - jacoco } java.toolchain.languageVersion = JavaLanguageVersion.of(libs.versions.java.get()) dependencies { - implementation(libs.androidx.fragment) + compileOnly(libs.demo.android) + testFixturesApi(libs.demo.android) + + implementation(libs.demo.androidx.fragment) + testFixturesApi(libs.demo.androidx.browser) + testImplementation(libs.demo.androidx.camera) testImplementation(platform(libs.junit.bom)) testImplementation(libs.junit.params) diff --git a/demo/src/test/kotlin/io/github/gmazzo/gradle/aar2jar/demo/CameraHelper.kt b/demo/src/test/kotlin/io/github/gmazzo/gradle/aar2jar/demo/CameraHelper.kt new file mode 100644 index 0000000..4d27a9c --- /dev/null +++ b/demo/src/test/kotlin/io/github/gmazzo/gradle/aar2jar/demo/CameraHelper.kt @@ -0,0 +1,11 @@ +package io.github.gmazzo.gradle.aar2jar.demo + +import android.app.Application +import android.content.Context +import androidx.camera.view.PreviewView + +object CameraHelper { + + fun createCamera() = PreviewView(Application()) + +} diff --git a/demo/src/testFixtures/kotlin/io/github/gmazzo/gradle/aar2jar/demo/BrowserHelper.kt b/demo/src/testFixtures/kotlin/io/github/gmazzo/gradle/aar2jar/demo/BrowserHelper.kt new file mode 100644 index 0000000..cc55661 --- /dev/null +++ b/demo/src/testFixtures/kotlin/io/github/gmazzo/gradle/aar2jar/demo/BrowserHelper.kt @@ -0,0 +1,11 @@ +package io.github.gmazzo.gradle.aar2jar.demo + +import androidx.browser.browseractions.BrowserActionItem +import androidx.browser.customtabs.CustomTabsClient +import androidx.browser.customtabs.TrustedWebUtils + +object BrowserHelper { + + val utils = TrustedWebUtils::class + +} \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 52b1558..7daa917 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,7 +3,10 @@ java = "17" kotlin = "2.1.0" [libraries] -androidx-fragment = { module = "androidx.fragment:fragment", version = "1.8.5" } +demo-android = { module = "com.google.android:android", version = "4.1.1.4" } +demo-androidx-browser = { module = "androidx.browser:browser", version = "1.8.0" } +demo-androidx-camera = { module = "androidx.camera:camera-view", version = "1.4.0" } +demo-androidx-fragment = { module = "androidx.fragment:fragment", version = "1.8.5" } junit-bom = { module = "org.junit:junit-bom", version = "5.11.3" } junit-engine = { module = "org.junit.jupiter:junit-jupiter-engine" } junit-params = { module = "org.junit.jupiter:junit-jupiter-params" }