Я пытаюсь написать тест производительности в Android Studio, используя InstrumentedTest. Я сделал отдельный модуль только для моего теста производительности. Это зависит от других модулей в проекте. Чтобы сделать мой тест производительности точным, я бы хотел, чтобы мой модуль performancetest
зависел от конфигураций release других модулей.
Например, если у меня есть три модуля в моем проекте:
- :foo
- :bar
- :performancetest
Я хочу, чтобы ExampleInstrumentedTest
в модуле :performancetest
осуществлял упражнения и измерял версии версий :foo
и :bar
.
Как мне это настроить? Я пытаюсь использовать:
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation project(path: ':foo', configuration: 'release')
implementation project(path: ':bar', configuration: 'release')
}
но когда я синхронизирую его, я получаю эту ошибку:
Execution failed for task ':performancetest:androidDependencies'.
> Could not resolve all artifacts for configuration ':performancetest:debugCompileClasspath'.
> Could not resolve project :foo.
Required by:
project :performancetest
> Project :performancetest declares a dependency from configuration 'implementation' to configuration 'release' which is not declared in the descriptor for project :foo.
но я определенно могу собрать релизную версию :foo
.
Как я могу объявить, что мой :performancetest
полагается на релиз версий :foo
и :bar
?