-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: Change java version to 17 for robolectric-extension tests (#83)
- adding an integration test to test with java 11
- Loading branch information
Showing
7 changed files
with
68 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
plugins { | ||
alias(libs.plugins.androidLibrary) | ||
alias(libs.plugins.kotlinAndroid) | ||
alias(libs.plugins.kotlinxKover) | ||
alias(libs.plugins.detekt) | ||
alias(libs.plugins.robolectricExtensionGradlePlugin) | ||
} | ||
|
||
android { | ||
namespace = 'tech.apter.junit.jupiter.robolectric.integration.tests.agp.groovy.dsl' | ||
compileSdk = libs.versions.androidCompileSdkJava11.get().toInteger() | ||
buildToolsVersion = libs.versions.androidBuildTools.get() | ||
|
||
defaultConfig { | ||
minSdk = libs.versions.androidMinimumSdk.get().toInteger() | ||
} | ||
|
||
testOptions { | ||
unitTests.all { Test test -> | ||
test.systemProperty('robolectric.enabledSdks', '19, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33') | ||
} | ||
} | ||
} | ||
|
||
detekt { | ||
toolVersion = libs.versions.detekt.get() | ||
autoCorrect = true | ||
} | ||
|
||
kotlin { | ||
jvmToolchain(libs.versions.jvmToolchainMin.get().toInteger()) | ||
} | ||
|
||
dependencies { | ||
detektPlugins(libs.detektFormatting) | ||
detektPlugins(libs.detektRulesLibraries) | ||
} |
18 changes: 18 additions & 0 deletions
18
...c/test/kotlin/tech/apter/junit/jupiter/robolectric/integration/tests/java11/Java11Test.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package tech.apter.junit.jupiter.robolectric.integration.tests.java11 | ||
|
||
import android.os.Build | ||
import org.junit.jupiter.api.Assertions.assertNotNull | ||
import org.junit.jupiter.api.Test | ||
import org.junit.jupiter.api.extension.ExtendWith | ||
import org.robolectric.RuntimeEnvironment | ||
import org.robolectric.annotation.Config | ||
import tech.apter.junit.jupiter.robolectric.RobolectricExtension | ||
|
||
@ExtendWith(RobolectricExtension::class) | ||
@Config(sdk = [Build.VERSION_CODES.TIRAMISU]) | ||
class Java11Test { | ||
@Test | ||
fun `Given an android project with kotlin-dsl build script when using Robolectric with JUnit5 the android app should be available`() { | ||
assertNotNull(RuntimeEnvironment.getApplication()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters