mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-31 19:40:24 +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 = File(tempDir, "build.gradle")
|
||||||
buildFile.delete()
|
buildFile.delete()
|
||||||
|
val ktVersion = "1.6.0"
|
||||||
|
val replacedMiraiVersion = "2.11.0-RC2"
|
||||||
buildFile.writeText(
|
buildFile.writeText(
|
||||||
"""
|
"""
|
||||||
plugins {
|
plugins {
|
||||||
id("org.jetbrains.kotlin.jvm") version "1.6.0"
|
id("org.jetbrains.kotlin.jvm") version "$ktVersion"
|
||||||
id("net.mamoe.mirai-console")
|
id("net.mamoe.mirai-console")
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
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