2121 nodeProjectDir.set(layout.buildDirectory.dir(" node" ))
2222}
2323
24- val tzdbVersion: String by rootProject.properties
24+ val tzdbVersion = rootProject.property( " tzdbVersion " ) as String
2525version = " $tzdbVersion -spi.$version "
2626
2727val tzdbMetainformationDir =
@@ -32,14 +32,14 @@ val tzdbDirectory = File(project.projectDir, "tzdb")
3232
3333val copiedTzdbDirectory = project.layout.buildDirectory.dir(" jvmResources" )
3434
35- val timeTzdbInstall by tasks.creating( NpmTask :: class ) {
35+ val timeTzdbInstall = tasks.register< NpmTask >( " timeTzdbInstall " ) {
3636 args.addAll(
3737 " install" ,
3838 " @tubular/time-tzdb" ,
3939 )
4040}
4141
42- val tzdbDownloadAndCompile by tasks.creating( NpxTask :: class ) {
42+ tasks.register< NpxTask >( " tzdbDownloadAndCompile " ) {
4343 dependsOn(timeTzdbInstall)
4444 command.set(" @tubular/time-tzdb" )
4545 args.addAll(" -b" , " --large" )
@@ -49,36 +49,32 @@ val tzdbDownloadAndCompile by tasks.creating(NpxTask::class) {
4949 args.add(tzdbDirectory.toString())
5050}
5151
52- val tzdbCopyToJvmResources by tasks.creating( Copy :: class ) {
52+ val tzdbCopyToJvmResources = tasks.register< Copy >( " tzdbCopyToJvmResources " ) {
5353 val outputDir = copiedTzdbDirectory.map { it.dir(" tzdb" ) }
5454 inputs.dir(tzdbDirectory)
5555 outputs.dir(outputDir)
5656 from(tzdbDirectory)
5757 into(outputDir)
5858}
5959
60- val generateTzdataAsKotlinFiles by tasks.registering {
60+ val generateTzdataAsKotlinFiles = tasks.register( " generateTzdataAsKotlinFiles " ) {
6161 inputs.dir(tzdbDirectory)
6262 outputs.dir(tzdataAsKotlinFilesDir)
6363 doLast {
6464 generateZoneInfosResources(tzdbDirectory, tzdataAsKotlinFilesDir.get(), tzdbVersion)
6565 }
6666}
6767
68- val generateTzdbMetainformation by tasks.registering {
68+ val generateTzdbMetainformation = tasks.register( " generateTzdbMetainformation " ) {
6969 inputs.dir(tzdbDirectory)
7070 outputs.dir(tzdbMetainformationDir)
7171 doLast {
7272 generateTzdbMetainformation(tzdbDirectory, tzdbMetainformationDir.get(), tzdbVersion)
7373 }
7474}
7575
76- val mainJavaToolchainVersion: String by project
77- val modularJavaToolchainVersion: String by project
78- val serializationVersion: String by project
79-
8076java {
81- toolchain { languageVersion.set(JavaLanguageVersion .of(mainJavaToolchainVersion)) }
77+ toolchain { languageVersion.set(JavaLanguageVersion .of(project.property( " mainJavaToolchainVersion" ) as String )) }
8278}
8379
8480kotlin {
@@ -144,30 +140,34 @@ kotlin {
144140
145141 // Tiers are in accordance with <https://kotlinlang.org/docs/native-target-support.html>
146142 // Tier 1
147- macosX64()
148143 macosArm64()
149144 iosSimulatorArm64()
150- iosX64()
151145 iosArm64()
152146 // Tier 2
153147 linuxX64()
154148 linuxArm64()
155149 watchosSimulatorArm64()
156- watchosX64()
157150 watchosArm32()
158151 watchosArm64()
159152 tvosSimulatorArm64()
160- tvosX64()
161153 tvosArm64()
162154 // Tier 3
163155 androidNativeArm32()
164156 androidNativeArm64()
165157 androidNativeX86()
166158 androidNativeX64()
159+ iosX64()
167160 mingwX64()
168161 watchosDeviceArm64()
169- // Deprecated
162+ // Deprecated, preserved for KT-58864
170163 @Suppress(" DEPRECATION" ) linuxArm32Hfp()
164+ // Deprecated for removal: KT-78660
165+ @Suppress(" DEPRECATION" , " DEPRECATION_ERROR" )
166+ run {
167+ macosX64()
168+ watchosX64()
169+ tvosX64()
170+ }
171171
172172 sourceSets.all {
173173 val suffixIndex = name.indexOfLast { it.isUpperCase() }
@@ -185,11 +185,11 @@ kotlin {
185185 kotlin.srcDir(generateTzdbMetainformation)
186186 }
187187
188- val commonWithoutResourcesMain by getting {
188+ named( " commonWithoutResourcesMain" ) {
189189 kotlin.srcDir(generateTzdataAsKotlinFiles)
190190 }
191191
192- val commonTest by getting {
192+ commonTest {
193193 dependencies {
194194 runtimeOnly(project(" :kotlinx-datetime" ))
195195 implementation(kotlin(" test" ))
@@ -200,7 +200,7 @@ kotlin {
200200 resources.srcDir(copiedTzdbDirectory)
201201 }
202202
203- val wasmWasiMain by getting {
203+ wasmWasiMain {
204204 languageSettings.optIn(" kotlinx.datetime.internal.InternalDateTimeApi" )
205205 }
206206 }
@@ -213,14 +213,16 @@ tasks {
213213
214214 // Copy-pasted from core/build.gradle.kts. TODO: unify in buildSrc/.
215215
216- val compileJavaModuleInfo by registering( JavaCompile :: class ) {
216+ val compileJavaModuleInfo = register< JavaCompile >( " compileJavaModuleInfo " ) {
217217 val moduleName = " kotlinx.datetime.zoneinfo" // this module's name
218- val compileKotlinJvm by getting( KotlinCompile :: class )
218+ val compileKotlinJvm = getByName< KotlinCompile >( " compileKotlinJvm " )
219219 val sourceDir = file(" jvm/java9/" )
220220 val targetDir = compileKotlinJvm.destinationDirectory.map { it.dir(" ../java9/" ) }
221221
222222 // Use a Java 11 compiler for the module info.
223- javaCompiler.set(project.javaToolchains.compilerFor { languageVersion.set(JavaLanguageVersion .of(modularJavaToolchainVersion)) })
223+ javaCompiler.set(project.javaToolchains.compilerFor {
224+ languageVersion.set(JavaLanguageVersion .of(project.property(" modularJavaToolchainVersion" ) as String ))
225+ })
224226
225227 // Always compile kotlin classes before the module descriptor.
226228 dependsOn(compileKotlinJvm)
@@ -267,7 +269,7 @@ tasks {
267269 options.javaModuleVersion.set(project.version.toString().takeUnless { it == Project .DEFAULT_VERSION })
268270 }
269271
270- val jvmJar by existing( Jar :: class ) {
272+ named< Jar >( " jvmJar " ) {
271273 manifest {
272274 attributes(
273275 " Multi-Release" to true ,
0 commit comments