How to specify classpath ordering in Gradle

后端 未结 2 2078
你的背包
你的背包 2021-01-11 15:23

I need to control the ordering of jars in the testRuntime configuration.

I must make sure that robolectric-x.x.jar comes before android.jar, or else I get the dreade

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-11 15:48

    This might work:

    configurations { robo }
    
    dependencies {
      robo ...
      testRuntime ...
    }
    
    sourceSets.test.runtimeClasspath = configurations.robo + sourceSets.test.runtimeClasspath
    

提交回复
热议问题