-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add extensions module & introduce GrantPermissionExtension to it * Remove deployment switch for Compose vs non-Compose No longer needed since the minimum AGP has been bumped to 7 globally. To work around the enforced single version per project by the Nexus Publishing plugin, bump the Compose artifact to the same 1.4.0-SNAPSHOT line as the other instrumentation artifacts, f it
- Loading branch information
1 parent
b51d126
commit 86dce59
Showing
12 changed files
with
343 additions
and
75 deletions.
There are no files selected for viewing
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
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
9 changes: 6 additions & 3 deletions
9
...rations/Core__Run_Unit_Tests__Gradle_.xml → ...s/Extensions__Run_Unit_Tests__Gradle_.xml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
public final class de/mannodermaus/junit5/extensions/GrantPermissionExtension : org/junit/jupiter/api/extension/BeforeEachCallback { | ||
public static final field Companion Lde/mannodermaus/junit5/extensions/GrantPermissionExtension$Companion; | ||
public fun beforeEach (Lorg/junit/jupiter/api/extension/ExtensionContext;)V | ||
public static final fun grant ([Ljava/lang/String;)Lde/mannodermaus/junit5/extensions/GrantPermissionExtension; | ||
} | ||
|
||
public final class de/mannodermaus/junit5/extensions/GrantPermissionExtension$Companion { | ||
public final fun grant ([Ljava/lang/String;)Lde/mannodermaus/junit5/extensions/GrantPermissionExtension; | ||
} | ||
|
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,93 @@ | ||
import libs.plugins.android | ||
import org.gradle.api.tasks.testing.logging.TestExceptionFormat | ||
import org.gradle.api.tasks.testing.logging.TestLogEvent | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
||
buildscript { | ||
repositories { | ||
google() | ||
mavenCentral() | ||
sonatypeSnapshots() | ||
} | ||
|
||
dependencies { | ||
val latest = Artifacts.Plugin.latestStableVersion | ||
classpath("de.mannodermaus.gradle.plugins:android-junit5:$latest") | ||
} | ||
} | ||
|
||
plugins { | ||
id("com.android.library") | ||
kotlin("android") | ||
id("explicit-api-mode") | ||
} | ||
|
||
apply { | ||
plugin("de.mannodermaus.android-junit5") | ||
} | ||
|
||
val javaVersion = JavaVersion.VERSION_1_8 | ||
|
||
android { | ||
compileSdk = Android.compileSdkVersion | ||
|
||
defaultConfig { | ||
minSdk = Android.testRunnerMinSdkVersion | ||
targetSdk = Android.targetSdkVersion | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility = javaVersion | ||
targetCompatibility = javaVersion | ||
} | ||
|
||
buildFeatures { | ||
buildConfig = false | ||
resValues = false | ||
} | ||
|
||
lint { | ||
// JUnit 4 refers to java.lang.management APIs, which are absent on Android. | ||
warning("InvalidPackage") | ||
} | ||
|
||
packagingOptions { | ||
resources.excludes.add("META-INF/LICENSE.md") | ||
resources.excludes.add("META-INF/LICENSE-notice.md") | ||
} | ||
|
||
testOptions { | ||
unitTests.isReturnDefaultValues = true | ||
} | ||
} | ||
|
||
tasks.withType<KotlinCompile> { | ||
kotlinOptions.jvmTarget = javaVersion.toString() | ||
} | ||
|
||
tasks.withType<Test> { | ||
failFast = true | ||
testLogging { | ||
events = setOf(TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.FAILED) | ||
exceptionFormat = TestExceptionFormat.FULL | ||
} | ||
} | ||
|
||
configurations.all { | ||
// The Instrumentation Test Runner uses the plugin, | ||
// which in turn provides the Instrumentation Test Runner again - | ||
// that's kind of deep. | ||
// To avoid conflicts, prefer using the local classes | ||
// and exclude the dependency from being pulled in externally. | ||
exclude(module = Artifacts.Instrumentation.Extensions.artifactId) | ||
} | ||
|
||
dependencies { | ||
implementation(libs.androidXTestRunner) | ||
implementation(libs.junitJupiterApi) | ||
|
||
testImplementation(project(":testutil")) | ||
testRuntimeOnly(libs.junitJupiterEngine) | ||
} | ||
|
||
project.configureDeployment(Artifacts.Instrumentation.Extensions) |
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 @@ | ||
<manifest package="de.mannodermaus.junit5.extensions"/> |
Oops, something went wrong.