mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-25 15:40:28 +08:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
1160ff2ad2
@ -14,8 +14,8 @@ import java.time.Instant
|
||||
|
||||
internal object MiraiConsoleBuildConstants { // auto-filled on build (task :mirai-console:fillBuildConstants)
|
||||
@JvmStatic
|
||||
val buildDate: Instant = Instant.ofEpochSecond(1609151969)
|
||||
const val versionConst: String = "2.0-M2"
|
||||
val buildDate: Instant = Instant.ofEpochSecond(1609213499)
|
||||
const val versionConst: String = "2.0-M2-1-dev-1"
|
||||
|
||||
@JvmStatic
|
||||
val version: SemVersion = SemVersion(versionConst)
|
||||
|
@ -97,28 +97,17 @@ internal class JvmPluginClassLoader(
|
||||
} else throw LoadingDeniedException("$name was not exported by $otherClassloader")
|
||||
}
|
||||
}
|
||||
|
||||
// If no cache...
|
||||
return kotlin.runCatching {
|
||||
// Try load this class direct....
|
||||
super.findClass(name).also { cache[name] = it }
|
||||
}.getOrElse { exception ->
|
||||
if (exception is ClassNotFoundException) {
|
||||
// Cannot load the class from this, try others.
|
||||
classLoaders.forEach { otherClassloader ->
|
||||
if (otherClassloader === this) return@forEach
|
||||
val other = kotlin.runCatching {
|
||||
otherClassloader.findClass(name, true)
|
||||
}.onFailure { err ->
|
||||
if (err is LoadingDeniedException || err !is ClassNotFoundException)
|
||||
throw err
|
||||
}.getOrNull()
|
||||
if (other != null) return other
|
||||
}
|
||||
}
|
||||
// Great, nobody known what is the class.
|
||||
throw exception
|
||||
classLoaders.forEach { otherClassloader ->
|
||||
val other = kotlin.runCatching {
|
||||
if (otherClassloader === this) super.findClass(name).also { cache[name] = it }
|
||||
else otherClassloader.findClass(name, true)
|
||||
}.onFailure { err ->
|
||||
if (err is LoadingDeniedException || err !is ClassNotFoundException)
|
||||
throw err
|
||||
}.getOrNull()
|
||||
if (other != null) return other
|
||||
}
|
||||
throw ClassNotFoundException(name)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,7 @@ import org.gradle.api.attributes.Attribute
|
||||
|
||||
object Versions {
|
||||
const val core = "2.0-M2"
|
||||
const val console = "2.0-M2"
|
||||
const val console = "2.0-M2-1-dev-1"
|
||||
const val consoleGraphical = "0.0.7"
|
||||
const val consoleTerminal = console
|
||||
|
||||
|
@ -10,6 +10,6 @@
|
||||
package net.mamoe.mirai.console.gradle
|
||||
|
||||
internal object VersionConstants {
|
||||
const val CONSOLE_VERSION = "2.0-M2" // value is written here automatically during build
|
||||
const val CONSOLE_VERSION = "2.0-M2-1-dev-1" // value is written here automatically during build
|
||||
const val CORE_VERSION = "2.0-M2" // value is written here automatically during build
|
||||
}
|
Loading…
Reference in New Issue
Block a user