File tree Expand file tree Collapse file tree 1 file changed +27
-7
lines changed Expand file tree Collapse file tree 1 file changed +27
-7
lines changed Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ The hooks that enable **JUnit Foundation** test lifecycle notifications are inst
130130 <properties >
131131 <project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
132132 <maven .compiler.target>1.7</maven .compiler.target>
133- <maven .compiler.source>1.7</maven .compiler.source>
133+ <maven .compiler.source>1.7</maven .compiler.source>
134134 </properties >
135135
136136 <dependencies >
@@ -218,19 +218,39 @@ dependencies {
218218 // ...
219219 compile 'com.nordstrom.tools:junit-foundation:12.2.0'
220220}
221- ext {
222- junitFoundation = configurations.compile.resolvedConfiguration.resolvedArtifacts.find { it.name == 'junit-foundation' }
223- }
224- test.doFirst {
225- jvmArgs "-javaagent:${junitFoundation.file}"
226- }
227221test {
228222// debug true
223+ jvmArgs "-javaagent:${classpath.find { it.name.contains('junit-foundation') }.absolutePath}"
229224 // not required, but definitely useful
230225 testLogging.showStandardStreams = true
231226}
232227```
233228
229+ #### Gradle configuration (Android Studio):
230+ ``` gradle
231+ apply plugin: 'com.android.application'
232+ apply plugin: 'kotlin-android'
233+ apply plugin: 'kotlin-android-extensions'
234+
235+ android {
236+ compileSdkVersion 30
237+ buildToolsVersion "30.0.1"
238+
239+ // ...
240+
241+ testOptions {
242+ unitTests.all {
243+ jvmArgs "-javaagent:${classpath.find { it.name.contains('junit-foundation') }.absolutePath}"
244+ }
245+ }
246+ }
247+
248+ dependencies {
249+ // ...
250+ testImplementation 'com.nordstrom.tools:junit-foundation:12.2.0'
251+ }
252+ ```
253+
234254#### IDE Configuration for JUnit Foundation
235255
236256To enable notifications in the native test runner of IDEs like Eclipse or IDEA, add the ` -javaagent ` option to the JVM options of your run/debug configuration.
You can’t perform that action at this time.
0 commit comments