kotlin 1.6, gradle tidying
This commit is contained in:
parent
b3af697636
commit
d6a9a58dc9
14 changed files with 74 additions and 295 deletions
|
|
@ -26,7 +26,7 @@ kotlin {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
val kotlinWrappersVersion = "0.0.1-pre.263-kotlin-1.5.31"
|
||||
val kotlinWrappersVersion = "0.0.1-pre.270-kotlin-1.6.0"
|
||||
implementation(
|
||||
project.dependencies.enforcedPlatform(
|
||||
"org.jetbrains.kotlin-wrappers:kotlin-wrappers-bom:${kotlinWrappersVersion}"
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ dependencies {
|
|||
testImplementation("io.kotest:kotest-assertions-core-jvm:$kotestVersion")
|
||||
testImplementation("io.kotest:kotest-property-jvm:$kotestVersion")
|
||||
testImplementation("io.kotest:kotest-assertions-json:$kotestVersion")
|
||||
|
||||
testImplementation("io.mockk:mockk:1.12.0")
|
||||
|
||||
//</editor-fold>
|
||||
|
|
@ -46,8 +47,8 @@ tasks.withType<KotlinCompile>().configureEach {
|
|||
|
||||
kotlinOptions {
|
||||
jvmTarget = "11"
|
||||
apiVersion = "1.5"
|
||||
languageVersion = "1.5"
|
||||
apiVersion = "1.6"
|
||||
languageVersion = "1.6"
|
||||
}
|
||||
|
||||
kotlinOptions.freeCompilerArgs += listOf(
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
package dev.adamko.gradle
|
||||
|
||||
import org.gradle.kotlin.dsl.`component-model-base`
|
||||
import org.gradle.kotlin.dsl.kotlin
|
||||
|
||||
|
||||
plugins {
|
||||
base
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
package dev.adamko.gradle.tstl
|
||||
|
||||
import com.github.gradle.node.NodePlugin
|
||||
import dev.adamko.gradle.tstl.tasks.TypescriptToLuaTask
|
||||
import org.gradle.api.Plugin
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.plugins.BasePlugin
|
||||
import org.gradle.kotlin.dsl.withType
|
||||
import org.gradle.language.base.plugins.LifecycleBasePlugin
|
||||
|
||||
|
||||
class TstlPlugin : Plugin<Project> {
|
||||
override fun apply(project: Project) {
|
||||
|
||||
project.plugins.withType<NodePlugin> {
|
||||
}
|
||||
|
||||
project.plugins.withType<BasePlugin> {
|
||||
project.tasks.named(LifecycleBasePlugin.ASSEMBLE_TASK_NAME) {
|
||||
dependsOn(project.tasks.withType<TypescriptToLuaTask>())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
package dev.adamko.gradle.tstl.tasks
|
||||
|
||||
import com.github.gradle.node.npm.task.*
|
||||
import org.gradle.api.file.*
|
||||
import org.gradle.api.provider.*
|
||||
import org.gradle.api.tasks.*
|
||||
import org.jetbrains.kotlin.util.parseSpaceSeparatedArgs
|
||||
import org.gradle.kotlin.dsl.*
|
||||
|
||||
abstract class TypescriptToLuaTask : NpmTask() {
|
||||
|
||||
@get:Internal
|
||||
val intermediateOutputDir: RegularFileProperty = project.objects.fileProperty()
|
||||
.convention { temporaryDir }
|
||||
|
||||
@get:Internal
|
||||
val intermediateOutputCanonicalPath: Provider<String> =
|
||||
intermediateOutputDir.map { it.asFile.canonicalPath }
|
||||
|
||||
@get:Input
|
||||
val identifier: Property<String> = project.objects.property<String>().convention(name)
|
||||
|
||||
@get:Internal
|
||||
val luaOutputDirConvention: Provider<Directory> =
|
||||
project.layout.buildDirectory.map { it.dir("typescriptToLua/${identifier.get()}") }
|
||||
|
||||
@get:OutputDirectory
|
||||
val luaOutputDir: DirectoryProperty = project.objects.directoryProperty()
|
||||
.convention(luaOutputDirConvention)
|
||||
|
||||
init {
|
||||
group = "typescriptToLua"
|
||||
|
||||
execOverrides { standardOutput = System.out }
|
||||
|
||||
super.dependsOn(project.tasks.withType<NpmSetupTask>())
|
||||
ignoreExitValue.set(false)
|
||||
}
|
||||
|
||||
@TaskAction
|
||||
fun convert() {
|
||||
args.set(parseSpaceSeparatedArgs("-- --outDir ${intermediateOutputCanonicalPath.get()}"))
|
||||
|
||||
project.delete(intermediateOutputDir.get())
|
||||
|
||||
super.exec()
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue