1/** 2 * A gradle init script that will attach given Jvm Args to each Test task. 3 */ 4def jvmArgs = startParameter.systemPropertiesArgs.get("androidx.room.testJvmArgs") 5taskGraph.addTaskExecutionGraphListener { graph -> 6 graph.beforeTask { task -> 7 if (task instanceof Test) { 8 if (jvmArgs != null) { 9 task.jvmArgs(jvmArgs) 10 } 11 // this environment variable is used to avoid running profiling tests 12 // unless we are in a profiling execution 13 task.environment("ANDROIDX_ROOM_ENABLE_PROFILE_TESTS", "true") 14 } 15 } 16} 17