Upgrade to Gradle 8.10, Kotlin 2.0.20, reduce warnings
This commit is contained in:
@@ -90,7 +90,6 @@ fun GltfFile.buildSceneNodes(): GltfSceneData {
|
||||
|
||||
val localBuffer = buffers[localBufferView.buffer].contents(this@buildSceneNodes)
|
||||
require(localBufferView.byteOffset != null)
|
||||
require(localBufferView.byteLength != null)
|
||||
localBuffer.position(localBufferView.byteOffset)
|
||||
localBuffer.limit(localBufferView.byteOffset + localBufferView.byteLength)
|
||||
|
||||
@@ -321,7 +320,6 @@ fun GltfFile.buildSceneNodes(): GltfSceneData {
|
||||
val scenes = scenes.map { scene ->
|
||||
scene.nodes.map { node ->
|
||||
val gltfNode = nodes.getOrNull(node) ?: error("node not found: $node")
|
||||
require(gltfNode != null)
|
||||
val sceneNode = gltfNode.createSceneNode()
|
||||
sceneNode
|
||||
}
|
||||
|
||||
@@ -19,12 +19,12 @@ fun Mesh.collapse() {
|
||||
}
|
||||
|
||||
grouped.map {
|
||||
val vertexCount = it.value.sumBy { primitive ->
|
||||
val vertexCount = it.value.sumOf { primitive ->
|
||||
primitive.geometry.vertexCount
|
||||
}
|
||||
|
||||
val indexCount = if (it.key.hasIndexBuffer)
|
||||
it.value.sumBy { primitive ->
|
||||
it.value.sumOf { primitive ->
|
||||
primitive.geometry.indexBuffer?.indexCount ?: 0
|
||||
}
|
||||
else 0
|
||||
|
||||
@@ -5,7 +5,9 @@ plugins {
|
||||
}
|
||||
|
||||
tasks.withType<KotlinCompile> {
|
||||
kotlinOptions.freeCompilerArgs = listOf("-opt-in=kotlin.RequiresOptIn")
|
||||
compilerOptions {
|
||||
freeCompilerArgs.add("-opt-in=kotlin.RequiresOptIn")
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
@@ -5,7 +5,9 @@ plugins {
|
||||
}
|
||||
|
||||
tasks.withType<KotlinCompile> {
|
||||
kotlinOptions.freeCompilerArgs = listOf("-opt-in=kotlin.RequiresOptIn")
|
||||
compilerOptions {
|
||||
freeCompilerArgs.add("-opt-in=kotlin.RequiresOptIn")
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
@@ -11,7 +11,9 @@ tasks.generateGrammarSource {
|
||||
}
|
||||
|
||||
tasks.withType<KotlinCompile> {
|
||||
kotlinOptions.freeCompilerArgs = listOf("-opt-in=kotlin.RequiresOptIn")
|
||||
compilerOptions {
|
||||
freeCompilerArgs.add("-opt-in=kotlin.RequiresOptIn")
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
@@ -5,7 +5,9 @@ plugins {
|
||||
}
|
||||
|
||||
tasks.withType<KotlinCompile> {
|
||||
kotlinOptions.freeCompilerArgs = listOf("-opt-in=kotlin.RequiresOptIn")
|
||||
compilerOptions {
|
||||
freeCompilerArgs.add("-opt-in=kotlin.RequiresOptIn")
|
||||
}
|
||||
}
|
||||
|
||||
tasks.test {
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.io.File
|
||||
import java.io.InputStream
|
||||
import java.io.Reader
|
||||
import java.net.MalformedURLException
|
||||
import java.net.URI
|
||||
import java.net.URL
|
||||
import javax.script.ScriptEngineManager
|
||||
|
||||
|
||||
@@ -5,7 +5,9 @@ plugins {
|
||||
}
|
||||
|
||||
tasks.withType<KotlinCompile> {
|
||||
kotlinOptions.freeCompilerArgs = listOf("-opt-in=kotlin.RequiresOptIn")
|
||||
compilerOptions {
|
||||
freeCompilerArgs.add("-opt-in=kotlin.RequiresOptIn")
|
||||
}
|
||||
}
|
||||
|
||||
tasks.test {
|
||||
|
||||
@@ -88,7 +88,7 @@ fun Element.div(vararg classes: String, init: Div.() -> Unit): Div {
|
||||
}
|
||||
|
||||
inline fun <reified T : TextElement> Element.textElement(classes: Array<out String>, init: T.() -> String): T {
|
||||
val te = T::class.java.newInstance()
|
||||
@Suppress("DEPRECATION") val te = T::class.java.newInstance()
|
||||
te.classes.addAll(classes.map { ElementClass(it) })
|
||||
te.text(te.init())
|
||||
append(te)
|
||||
|
||||
@@ -7,7 +7,7 @@ import kotlin.reflect.full.declaredMemberProperties
|
||||
fun watchHash(toHash: Any): Int {
|
||||
var hash = 0
|
||||
for (property in toHash::class.declaredMemberProperties) {
|
||||
val v = ((property as KProperty1<Any, Any?>).getter).invoke(toHash)
|
||||
@Suppress("UNCHECKED_CAST") val v = ((property as KProperty1<Any, Any?>).getter).invoke(toHash)
|
||||
if (v is KProperty0<*>) {
|
||||
val pv = v.get()
|
||||
hash = 31 * hash + (pv?.hashCode() ?: 0)
|
||||
|
||||
Reference in New Issue
Block a user