diff --git a/build-logic/build.gradle.kts b/build-logic/build.gradle.kts index 447c701e3..d19208717 100644 --- a/build-logic/build.gradle.kts +++ b/build-logic/build.gradle.kts @@ -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 { diff --git a/classlib/build.gradle.kts b/classlib/build.gradle.kts index 9eb9ae042..a3887e5cd 100644 --- a/classlib/build.gradle.kts +++ b/classlib/build.gradle.kts @@ -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) diff --git a/samples/async/build.gradle.kts b/samples/async/build.gradle.kts index bf11d12e4..09a28b866 100644 --- a/samples/async/build.gradle.kts +++ b/samples/async/build.gradle.kts @@ -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 { diff --git a/samples/benchmark/build.gradle.kts b/samples/benchmark/build.gradle.kts index d35eb2410..43924de99 100644 --- a/samples/benchmark/build.gradle.kts +++ b/samples/benchmark/build.gradle.kts @@ -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 } } diff --git a/samples/hello/build.gradle.kts b/samples/hello/build.gradle.kts index 76f184aa5..bd02656c5 100644 --- a/samples/hello/build.gradle.kts +++ b/samples/hello/build.gradle.kts @@ -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" } diff --git a/samples/kotlin/build.gradle.kts b/samples/kotlin/build.gradle.kts index d4745ff0e..135fcf276 100644 --- a/samples/kotlin/build.gradle.kts +++ b/samples/kotlin/build.gradle.kts @@ -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" } diff --git a/samples/pi/build.gradle.kts b/samples/pi/build.gradle.kts index a5a0e1051..1944aced2 100644 --- a/samples/pi/build.gradle.kts +++ b/samples/pi/build.gradle.kts @@ -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("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" diff --git a/samples/scala/build.gradle.kts b/samples/scala/build.gradle.kts index 3ba21e7b9..ca818b6ef 100644 --- a/samples/scala/build.gradle.kts +++ b/samples/scala/build.gradle.kts @@ -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" } diff --git a/samples/settings.gradle.kts b/samples/settings.gradle.kts index 30f440da7..881a2b92f 100644 --- a/samples/settings.gradle.kts +++ b/samples/settings.gradle.kts @@ -85,7 +85,7 @@ gradle.afterProject { extensions.configure { toolVersion = extensions.getByType().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 diff --git a/samples/web-apis/build.gradle.kts b/samples/web-apis/build.gradle.kts index c077ddbe3..9d344dc9d 100644 --- a/samples/web-apis/build.gradle.kts +++ b/samples/web-apis/build.gradle.kts @@ -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" } \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts index 1e0a31474..349272eca 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -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 { diff --git a/tests/build.gradle.kts b/tests/build.gradle.kts index b0404b192..821853227 100644 --- a/tests/build.gradle.kts +++ b/tests/build.gradle.kts @@ -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() diff --git a/tools/classlib-comparison-gen/build.gradle.kts b/tools/classlib-comparison-gen/build.gradle.kts index c4303db87..690611719 100644 --- a/tools/classlib-comparison-gen/build.gradle.kts +++ b/tools/classlib-comparison-gen/build.gradle.kts @@ -33,7 +33,7 @@ val generateComparison by tasks.register("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) } diff --git a/tools/deobfuscator-js/build.gradle.kts b/tools/deobfuscator-js/build.gradle.kts index f681ba8bb..ceee4509a 100644 --- a/tools/deobfuscator-js/build.gradle.kts +++ b/tools/deobfuscator-js/build.gradle.kts @@ -35,37 +35,37 @@ dependencies { } val generateJs by tasks.register("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("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("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 } diff --git a/tools/gradle/build.gradle.kts b/tools/gradle/build.gradle.kts index 53736d5d4..c07fc25a5 100644 --- a/tools/gradle/build.gradle.kts +++ b/tools/gradle/build.gradle.kts @@ -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") } } } diff --git a/tools/ide-deps/build.gradle.kts b/tools/ide-deps/build.gradle.kts index d04874d10..50e181708 100644 --- a/tools/ide-deps/build.gradle.kts +++ b/tools/ide-deps/build.gradle.kts @@ -29,6 +29,6 @@ dependencies { } tasks.shadowJar { - archiveFileName.set("teavm.jar") + archiveFileName = "teavm.jar" mergeServiceFiles() } \ No newline at end of file diff --git a/tools/idea/build.gradle.kts b/tools/idea/build.gradle.kts index 2fdc98049..bac2eb0f7 100644 --- a/tools/idea/build.gradle.kts +++ b/tools/idea/build.gradle.kts @@ -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") } }