diff --git a/build.gradle.kts b/build.gradle.kts index b8783c3..b9bd464 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,9 @@ +import space.kscience.gradle.isInDevelopment +import space.kscience.gradle.useApache2Licence +import space.kscience.gradle.useSPCTeam + plugins { - base + id("space.kscience.gradle.project") } val ktorVersion by extra("2.0.3") @@ -9,81 +13,29 @@ allprojects { version = "0.1.0-SNAPSHOT" } -tasks.create("version") { - group = "publishing" - val versionFile = project.buildDir.resolve("project-version.txt") - outputs.file(versionFile) - doLast { - versionFile.createNewFile() - versionFile.writeText(project.version.toString()) - println(project.version) +ksciencePublish{ + pom("https://github.com/SciProgCentre/maps-kt") { + useApache2Licence() + useSPCTeam() } + github("maps-kt", "SciProgCentre") + space( + if (isInDevelopment) { + "https://maven.pkg.jetbrains.space/mipt-npm/p/sci/dev" + } else { + "https://maven.pkg.jetbrains.space/mipt-npm/p/sci/release" + } + ) + sonatype() } subprojects { repositories { google() mavenCentral() + maven("https://repo.kotlin.link") maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") } - - plugins.withId("maven-publish") { - - configure { - val vcs = "https://github.com/mipt-npm/maps-kt" - - // Process each publication we have in this project - publications { - withType { - pom { - name.set(project.name) - description.set(project.description) - url.set(vcs) - - licenses { - license { - name.set("The Apache Software License, Version 2.0") - url.set("https://www.apache.org/licenses/LICENSE-2.0.txt") - distribution.set("repo") - } - } - - developers { - developer { - id.set("SPC") - name.set("Scientific programming centre") - organization.set("MIPT") - organizationUrl.set("https://sciprog.center/") - } - } - - scm { - url.set(vcs) - tag.set(project.version.toString()) - } - } - } - } - - val spaceRepo = "https://maven.pkg.jetbrains.space/mipt-npm/p/sci/maven" - val spaceUser: String? = project.findProperty("publishing.space.user") as? String - val spaceToken: String? = project.findProperty("publishing.space.token") as? String - - if (spaceUser != null && spaceToken != null) { - project.logger.info("Adding mipt-npm Space publishing to project [${project.name}]") - - repositories.maven { - name = "space" - url = uri(spaceRepo) - - credentials { - username = spaceUser - password = spaceToken - } - } - } - } - } } diff --git a/gradle.properties b/gradle.properties index 0802053..2991b97 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,9 @@ kotlin.code.style=official kotlin.version=1.6.10 -compose.version=1.1.1 + +compose.version=1.2.0-alpha01-dev774 + agp.version=4.2.2 android.useAndroidX=true + +toolsVersion=0.13.0-kotlin-1.7.10 \ No newline at end of file diff --git a/maps-kt-core/build.gradle.kts b/maps-kt-core/build.gradle.kts index 7924005..1c891d6 100644 --- a/maps-kt-core/build.gradle.kts +++ b/maps-kt-core/build.gradle.kts @@ -1,26 +1,4 @@ plugins { - kotlin("multiplatform") + id("space.kscience.gradle.mpp") `maven-publish` -} - -val ktorVersion: String by rootProject.extra - -kotlin { - explicitApi = org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode.Warning - jvm { - compilations.all { - kotlinOptions.jvmTarget = "11" - } - } - js(IR) { - browser() - } - - sourceSets{ - commonTest{ - dependencies{ - implementation(kotlin("test")) - } - } - } } \ No newline at end of file diff --git a/maps-kt-core/src/commonTest/kotlin/center/sciprog/maps/coordinates/DistanceTest.kt b/maps-kt-core/src/commonTest/kotlin/center/sciprog/maps/coordinates/DistanceTest.kt index 3cd6714..590d615 100644 --- a/maps-kt-core/src/commonTest/kotlin/center/sciprog/maps/coordinates/DistanceTest.kt +++ b/maps-kt-core/src/commonTest/kotlin/center/sciprog/maps/coordinates/DistanceTest.kt @@ -1,13 +1,12 @@ package center.sciprog.maps.coordinates -import kotlin.test.Ignore import kotlin.test.Test import kotlin.test.assertEquals internal class DistanceTest { companion object { - val moscow = GMC.ofDegrees(55.76058287719673, 37.60358622841869) - val spb = GMC.ofDegrees(59.926686023580444, 30.36038109122013) + val moscow = Gmc.ofDegrees(55.76058287719673, 37.60358622841869) + val spb = Gmc.ofDegrees(59.926686023580444, 30.36038109122013) } @Test diff --git a/maps-kt-scheme/build.gradle.kts b/maps-kt-scheme/build.gradle.kts index 203422e..d5206ec 100644 --- a/maps-kt-scheme/build.gradle.kts +++ b/maps-kt-scheme/build.gradle.kts @@ -11,7 +11,6 @@ kotlin { compilations.all { kotlinOptions.jvmTarget = "11" } - withJava() } sourceSets { commonMain { @@ -25,6 +24,5 @@ kotlin { api(compose.desktop.currentOs) } } - val jvmTest by getting } } diff --git a/settings.gradle.kts b/settings.gradle.kts index dfcd2d1..665ae67 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,12 +1,17 @@ rootProject.name = "maps-kt" enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") +enableFeaturePreview("VERSION_CATALOGS") pluginManagement { + + val toolsVersion: String by extra + repositories { google() gradlePluginPortal() mavenCentral() + maven("https://repo.kotlin.link") maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") } @@ -16,9 +21,31 @@ pluginManagement { id("com.android.application").version(extra["agp.version"] as String) id("com.android.library").version(extra["agp.version"] as String) id("org.jetbrains.compose").version(extra["compose.version"] as String) + id("space.kscience.gradle.project") version toolsVersion + id("space.kscience.gradle.mpp") version toolsVersion + id("space.kscience.gradle.jvm") version toolsVersion + id("space.kscience.gradle.js") version toolsVersion } } +dependencyResolutionManagement { + val toolsVersion: String by extra + + repositories { + mavenLocal() + maven("https://repo.kotlin.link") + mavenCentral() + gradlePluginPortal() + } + + versionCatalogs { + create("spclibs") { + from("space.kscience:version-catalog:$toolsVersion") + } + } +} + + include( ":maps-kt-core",