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