mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 00:04:10 -08:00
Update gradle scripts for latest gradle version
1. Use lazy property assignment 2. Remove usages of deprecated buildDir property
This commit is contained in:
parent
2ae9c593d2
commit
ba7dcd13b5
|
@ -61,7 +61,7 @@ gradlePlugin {
|
|||
|
||||
checkstyle {
|
||||
toolVersion = libs.versions.checkstyle.get()
|
||||
configDirectory.set(project.layout.projectDirectory.dir("../config/checkstyle"))
|
||||
configDirectory = project.layout.projectDirectory.dir("../config/checkstyle")
|
||||
}
|
||||
|
||||
java {
|
||||
|
|
|
@ -37,15 +37,15 @@ dependencies {
|
|||
}
|
||||
|
||||
tasks {
|
||||
val generatedClassesDir = File(buildDir, "generated/classes/java/main")
|
||||
val generatedClassesDir = layout.buildDirectory.dir("generated/classes/java/main")
|
||||
val generateTzCache by registering(JavaExec::class) {
|
||||
val outputFile = File(generatedClassesDir, "org/teavm/classlib/impl/tz/cache")
|
||||
val outputFile = generatedClassesDir.map { it.dir( "org/teavm/classlib/impl/tz/cache") }
|
||||
classpath(sourceSets.main.get().runtimeClasspath, sourceSets.main.get().compileClasspath)
|
||||
outputs.file(outputFile)
|
||||
inputs.files(sourceSets.main.get().runtimeClasspath)
|
||||
dependsOn(compileJava)
|
||||
mainClass.set("org.teavm.classlib.impl.tz.TimeZoneCache")
|
||||
args(outputFile.absolutePath)
|
||||
mainClass = "org.teavm.classlib.impl.tz.TimeZoneCache"
|
||||
args(outputFile.get().asFile.absolutePath)
|
||||
}
|
||||
jar {
|
||||
dependsOn(generateTzCache)
|
||||
|
|
|
@ -30,8 +30,8 @@ dependencies {
|
|||
}
|
||||
|
||||
teavm.js {
|
||||
addedToWebApp.set(true)
|
||||
mainClass.set("org.teavm.samples.async.AsyncProgram")
|
||||
addedToWebApp = true
|
||||
mainClass = "org.teavm.samples.async.AsyncProgram"
|
||||
}
|
||||
|
||||
tasks.war {
|
||||
|
|
|
@ -43,18 +43,18 @@ val executableFile = File(buildDir, "dist/teavm_benchmark")
|
|||
|
||||
teavm {
|
||||
js {
|
||||
addedToWebApp.set(true)
|
||||
mainClass.set("org.teavm.samples.benchmark.teavm.BenchmarkStarter")
|
||||
debugInformation.set(true)
|
||||
addedToWebApp = true
|
||||
mainClass = "org.teavm.samples.benchmark.teavm.BenchmarkStarter"
|
||||
debugInformation = true
|
||||
}
|
||||
wasm {
|
||||
addedToWebApp.set(true)
|
||||
mainClass.set("org.teavm.samples.benchmark.teavm.WasmBenchmarkStarter")
|
||||
addedToWebApp = true
|
||||
mainClass = "org.teavm.samples.benchmark.teavm.WasmBenchmarkStarter"
|
||||
}
|
||||
c {
|
||||
mainClass.set("org.teavm.samples.benchmark.teavm.Gtk3BenchmarkStarter")
|
||||
relativePathInOutputDir.set("")
|
||||
outputDir.set(generatedCSources)
|
||||
mainClass = "org.teavm.samples.benchmark.teavm.Gtk3BenchmarkStarter"
|
||||
relativePathInOutputDir = ""
|
||||
outputDir = generatedCSources
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -26,6 +26,6 @@ dependencies {
|
|||
}
|
||||
|
||||
teavm.js {
|
||||
addedToWebApp.set(true)
|
||||
mainClass.set("org.teavm.samples.hello.Client")
|
||||
addedToWebApp = true
|
||||
mainClass = "org.teavm.samples.hello.Client"
|
||||
}
|
||||
|
|
|
@ -25,6 +25,6 @@ dependencies {
|
|||
}
|
||||
|
||||
teavm.js {
|
||||
addedToWebApp.set(true)
|
||||
mainClass.set("org.teavm.samples.kotlin.HelloKt")
|
||||
addedToWebApp = true
|
||||
mainClass = "org.teavm.samples.kotlin.HelloKt"
|
||||
}
|
||||
|
|
|
@ -30,17 +30,17 @@ dependencies {
|
|||
|
||||
teavm {
|
||||
js {
|
||||
addedToWebApp.set(true)
|
||||
addedToWebApp = true
|
||||
}
|
||||
wasm {
|
||||
addedToWebApp.set(true)
|
||||
addedToWebApp = true
|
||||
}
|
||||
wasi {
|
||||
outputDir.set(File(buildDir, "libs/wasi"))
|
||||
relativePathInOutputDir.set("")
|
||||
outputDir = layout.buildDirectory.dir("libs/wasi").get().asFile
|
||||
relativePathInOutputDir = ""
|
||||
}
|
||||
all {
|
||||
mainClass.set("org.teavm.samples.pi.PiCalculator")
|
||||
mainClass = "org.teavm.samples.pi.PiCalculator"
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,7 @@ tasks.assemble {
|
|||
val buildNativeLinux by tasks.register<Exec>("buildNativeLinux") {
|
||||
group = "build"
|
||||
dependsOn(tasks.generateC)
|
||||
inputs.dir(File(buildDir, "generated/teavm/c"))
|
||||
inputs.dir(layout.buildDirectory.dir("generated/teavm/c"))
|
||||
inputs.file(project.file("CMakeLists.txt"))
|
||||
outputs.file("build/dist/calc_pi")
|
||||
executable = "./build-native.sh"
|
||||
|
|
|
@ -26,6 +26,6 @@ dependencies {
|
|||
}
|
||||
|
||||
teavm.js {
|
||||
addedToWebApp.set(true)
|
||||
mainClass.set("org.teavm.samples.scala.Client")
|
||||
addedToWebApp = true
|
||||
mainClass = "org.teavm.samples.scala.Client"
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@ gradle.afterProject {
|
|||
extensions.configure<CheckstyleExtension> {
|
||||
toolVersion = extensions.getByType<VersionCatalogsExtension>().named("libs")
|
||||
.findVersion("checkstyle").get().requiredVersion
|
||||
configDirectory.set(File(settings.rootDir, "../config/checkstyle"))
|
||||
configDirectory = File(settings.rootDir, "../config/checkstyle")
|
||||
}
|
||||
java.sourceCompatibility = JavaVersion.VERSION_11
|
||||
java.targetCompatibility = JavaVersion.VERSION_11
|
||||
|
|
|
@ -25,6 +25,6 @@ dependencies {
|
|||
}
|
||||
|
||||
teavm.js {
|
||||
addedToWebApp.set(true)
|
||||
mainClass.set("org.teavm.samples.webapis.Main")
|
||||
addedToWebApp = true
|
||||
mainClass = "org.teavm.samples.webapis.Main"
|
||||
}
|
|
@ -95,29 +95,29 @@ gradle.afterProject {
|
|||
}
|
||||
|
||||
fun MavenPom.setupPom(project: Project) {
|
||||
name.set(project.description)
|
||||
description.set(project.description)
|
||||
name = project.description
|
||||
description = project.description
|
||||
licenses {
|
||||
license {
|
||||
name.set("The Apache Software License, Version 2.0")
|
||||
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
|
||||
distribution.set("repo")
|
||||
comments.set("A business-friendly OSS license")
|
||||
name = "The Apache Software License, Version 2.0"
|
||||
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
|
||||
distribution = "repo"
|
||||
comments = "A business-friendly OSS license"
|
||||
}
|
||||
}
|
||||
developers {
|
||||
developer {
|
||||
id.set("konsoletyper")
|
||||
name.set("Alexey Andreev")
|
||||
email.set("konsoletyper@gmail.com")
|
||||
timezone.set("Europe/Berlin")
|
||||
id = "konsoletyper"
|
||||
name = "Alexey Andreev"
|
||||
email = "konsoletyper@gmail.com"
|
||||
timezone = "Europe/Berlin"
|
||||
}
|
||||
}
|
||||
scm {
|
||||
url.set("https://github.com/konsoletyper/teavm")
|
||||
connection.set("scm:git:git@github.com:konsoletyper/teavm.git")
|
||||
url = "https://github.com/konsoletyper/teavm"
|
||||
connection = "scm:git:git@github.com:konsoletyper/teavm.git"
|
||||
}
|
||||
url.set("https://teavm.org")
|
||||
url = "https://teavm.org"
|
||||
}
|
||||
|
||||
extensions.configure<DependencyRelocationExtension> {
|
||||
|
|
|
@ -39,7 +39,7 @@ dependencies {
|
|||
}
|
||||
|
||||
tasks.test {
|
||||
systemProperty("teavm.junit.target", "${project.buildDir.absolutePath }/teavm-tests")
|
||||
systemProperty("teavm.junit.target", layout.buildDirectory.dir("teavm-tests").get().asFile.absolutePath)
|
||||
systemProperty("teavm.junit.threads", "1")
|
||||
val browser = providers.gradleProperty("teavm.tests.browser").orElse("browser-chrome").get()
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ val generateComparison by tasks.register<JavaExec>("generateComparison") {
|
|||
inputs.files(tasks["relocateJar"].outputs.files)
|
||||
outputs.dir(outputDir)
|
||||
classpath = configurations.runtimeClasspath.get() + tasks["relocateJar"].outputs.files
|
||||
mainClass.set("org.teavm.tools.classlibcomparison.JCLComparisonBuilder")
|
||||
mainClass = "org.teavm.tools.classlibcomparison.JCLComparisonBuilder"
|
||||
args("-output", outputDir.get().asFile.absolutePath)
|
||||
}
|
||||
|
||||
|
|
|
@ -35,37 +35,37 @@ dependencies {
|
|||
}
|
||||
|
||||
val generateJs by tasks.register<JavaExec>("generateJs") {
|
||||
outputs.dir(File(buildDir, "teavm"))
|
||||
outputs.dir(layout.buildDirectory.dir("teavm"))
|
||||
dependsOn(tasks.classes)
|
||||
classpath += configurations["teavmCompile"]
|
||||
classpath += java.sourceSets.main.get().output.classesDirs
|
||||
mainClass.set("org.teavm.tooling.deobfuscate.js.Compiler")
|
||||
mainClass = "org.teavm.tooling.deobfuscate.js.Compiler"
|
||||
args(
|
||||
"org.teavm.tooling.deobfuscate.js.Deobfuscator",
|
||||
"\$teavm_deobfuscator",
|
||||
File(buildDir, "teavm").absolutePath,
|
||||
layout.buildDirectory.dir("teavm").get().asFile.absolutePath,
|
||||
"deobfuscator.js"
|
||||
)
|
||||
}
|
||||
|
||||
val generateLibJs by tasks.register<JavaExec>("generateLibJs") {
|
||||
outputs.dir(File(buildDir, "teavm-lib"))
|
||||
outputs.dir(layout.buildDirectory.dir("teavm-lib"))
|
||||
dependsOn(tasks.classes)
|
||||
classpath += configurations["teavmCompile"]
|
||||
classpath += java.sourceSets.main.get().output.classesDirs
|
||||
mainClass.set("org.teavm.tooling.deobfuscate.js.Compiler")
|
||||
mainClass = "org.teavm.tooling.deobfuscate.js.Compiler"
|
||||
args(
|
||||
"org.teavm.tooling.deobfuscate.js.DeobfuscatorLib",
|
||||
"deobfuscator",
|
||||
File(buildDir, "teavm-lib").absolutePath,
|
||||
layout.buildDirectory.dir("teavm-lib").get().asFile.absolutePath,
|
||||
"deobfuscator-lib.js",
|
||||
)
|
||||
}
|
||||
|
||||
val zipWithJs by tasks.register<Jar>("zipWithJs") {
|
||||
dependsOn(generateJs, generateLibJs)
|
||||
archiveClassifier.set("js")
|
||||
from(File(buildDir, "teavm"), File(buildDir, "teavm-lib"))
|
||||
archiveClassifier = "js"
|
||||
from(layout.buildDirectory.dir("teavm"), layout.buildDirectory.dir("teavm-lib"))
|
||||
entryCompression = ZipEntryCompression.DEFLATED
|
||||
}
|
||||
|
||||
|
|
|
@ -29,22 +29,22 @@ dependencies {
|
|||
}
|
||||
|
||||
gradlePlugin {
|
||||
website.set("https://teavm.org")
|
||||
vcsUrl.set("https://github.com/konsoletyper/teavm")
|
||||
website = "https://teavm.org"
|
||||
vcsUrl = "https://github.com/konsoletyper/teavm"
|
||||
plugins {
|
||||
create("TeaVMPlugin") {
|
||||
id = "org.teavm"
|
||||
implementationClass = "org.teavm.gradle.TeaVMPlugin"
|
||||
displayName = "TeaVM application plugin"
|
||||
description = "Installs TeaVM compilation tasks, configurations and source sets"
|
||||
tags.set(listOf("teavm", "javascript", "webassembly", "compiler", "aot-compiler"))
|
||||
tags = listOf("teavm", "javascript", "webassembly", "compiler", "aot-compiler")
|
||||
}
|
||||
create("TeaVMLibraryPlugin") {
|
||||
id = "org.teavm.library"
|
||||
implementationClass = "org.teavm.gradle.TeaVMLibraryPlugin"
|
||||
displayName = "TeaVM library plugin"
|
||||
description = "Installs TeaVM DSL for consuming TeaVM libraries and running tests in a browser"
|
||||
tags.set(listOf("teavm", "javascript", "webassembly", "compiler", "aot-compiler"))
|
||||
tags = listOf("teavm", "javascript", "webassembly", "compiler", "aot-compiler")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,6 +29,6 @@ dependencies {
|
|||
}
|
||||
|
||||
tasks.shadowJar {
|
||||
archiveFileName.set("teavm.jar")
|
||||
archiveFileName = "teavm.jar"
|
||||
mergeServiceFiles()
|
||||
}
|
|
@ -20,15 +20,15 @@ plugins {
|
|||
}
|
||||
|
||||
intellij {
|
||||
version.set(libs.versions.idea.asProvider().get())
|
||||
type.set("IC")
|
||||
updateSinceUntilBuild.set(false)
|
||||
version = libs.versions.idea.asProvider().get()
|
||||
type = "IC"
|
||||
updateSinceUntilBuild = false
|
||||
|
||||
plugins.set(listOf(
|
||||
plugins = listOf(
|
||||
"java",
|
||||
"org.intellij.scala:${libs.versions.idea.scala.get()}",
|
||||
"org.jetbrains.kotlin"
|
||||
))
|
||||
)
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@ -37,13 +37,13 @@ dependencies {
|
|||
|
||||
tasks {
|
||||
instrumentedJar {
|
||||
archiveFileName.set("teavm-plugin.jar")
|
||||
archiveFileName = "teavm-plugin.jar"
|
||||
}
|
||||
buildSearchableOptions {
|
||||
enabled = false
|
||||
}
|
||||
|
||||
publishPlugin {
|
||||
token.set(providers.gradleProperty("teavm.idea.publishToken"))
|
||||
token = providers.gradleProperty("teavm.idea.publishToken")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user