mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-19 10:34:44 +08:00
Using a released version to run gradle tests
This commit is contained in:
parent
a1a517c03f
commit
92a5babf1c
@ -66,16 +66,44 @@ abstract class AbstractTest {
|
||||
|
||||
buildFile = File(tempDir, "build.gradle")
|
||||
buildFile.delete()
|
||||
val ktVersion = "1.6.0"
|
||||
val replacedMiraiVersion = "2.11.0-RC2"
|
||||
buildFile.writeText(
|
||||
"""
|
||||
plugins {
|
||||
id("org.jetbrains.kotlin.jvm") version "1.6.0"
|
||||
id("org.jetbrains.kotlin.jvm") version "$ktVersion"
|
||||
id("net.mamoe.mirai-console")
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
// Mirai dev versions not available in gradle test.
|
||||
// So using a released version to run tests
|
||||
({
|
||||
def modules = [
|
||||
'mirai-core-api',
|
||||
'mirai-core-api-jvm',
|
||||
'mirai-core',
|
||||
'mirai-core-jvm',
|
||||
'mirai-core-utils',
|
||||
'mirai-core-utils-jvm',
|
||||
'mirai-console',
|
||||
'mirai-console-terminal',
|
||||
'mirai-console-compiler-annotations',
|
||||
'mirai-console-compiler-common',
|
||||
];
|
||||
allprojects { configurations.all { resolutionStrategy.eachDependency { DependencyResolveDetails details ->
|
||||
if (details.requested.group == 'net.mamoe') {
|
||||
if (modules.contains(details.requested.name)) {
|
||||
details.useVersion '$replacedMiraiVersion'
|
||||
}
|
||||
}
|
||||
if (details.requested.group == 'org.jetbrains.kotlin') {
|
||||
details.useVersion '$ktVersion'
|
||||
}
|
||||
} } }
|
||||
})();
|
||||
"""
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user