mirror of
https://github.com/divkit/divkit.git
synced 2026-06-06 20:07:59 +00:00
minor kotlin dsl build script fixes
commit_hash:1923efec860e2274dde1c9d141c72d44544c9aae
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("divkit.convension.publishing-project")
|
||||
id("divkit.convension.publishing-module")
|
||||
alias(libs.plugins.kotlin.jvm)
|
||||
id("divkit.convention.publishing-project")
|
||||
id("divkit.convention.publishing-module")
|
||||
}
|
||||
|
||||
kotlin {
|
||||
|
||||
@@ -11,6 +11,5 @@ kotlin {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(libs.kotlin.gradle)
|
||||
implementation(libs.nexusPublish)
|
||||
}
|
||||
|
||||
+4
@@ -3,9 +3,13 @@
|
||||
package com.yandex.divkit.gradle
|
||||
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.tasks.SourceSetContainer
|
||||
import org.gradle.internal.extensions.core.extra
|
||||
import java.util.Properties
|
||||
|
||||
val Project.sourceSets: SourceSetContainer
|
||||
get() = extensions.getByName("sourceSets") as SourceSetContainer
|
||||
|
||||
fun Project.applyProperties(from: String) {
|
||||
val propertiesFile = layout.projectDirectory.file(from)
|
||||
if (propertiesFile.asFile.exists()) {
|
||||
|
||||
+6
-6
@@ -5,13 +5,13 @@ import java.util.Date
|
||||
|
||||
private val VERSION_DATE_FORMAT = SimpleDateFormat("yyyyMMdd.HHmmss")
|
||||
|
||||
enum class PublicationType {
|
||||
enum class PublicationType(val isRelease: Boolean) {
|
||||
|
||||
dev {
|
||||
override fun getVersionSuffix() = "-dev.${VERSION_DATE_FORMAT.format(Date())}"
|
||||
snapshot(isRelease = false) {
|
||||
override fun getVersionSuffix() = "-${VERSION_DATE_FORMAT.format(Date())}-SNAPSHOT"
|
||||
},
|
||||
|
||||
release {
|
||||
release(isRelease = true) {
|
||||
override fun getVersionSuffix() = ""
|
||||
};
|
||||
|
||||
@@ -24,9 +24,9 @@ enum class PublicationType {
|
||||
return try {
|
||||
valueOf(string!!)
|
||||
} catch (ignored: IllegalArgumentException) {
|
||||
return PublicationType.dev
|
||||
return snapshot
|
||||
} catch (ignored: NullPointerException) {
|
||||
return PublicationType.dev
|
||||
return snapshot
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package divkit.convension
|
||||
package divkit.convention
|
||||
|
||||
import com.yandex.divkit.gradle.PublicationType
|
||||
import com.yandex.divkit.gradle.optProperty
|
||||
import com.yandex.divkit.gradle.sourceSets
|
||||
import java.net.URI
|
||||
|
||||
plugins {
|
||||
kotlin("jvm") apply false
|
||||
signing
|
||||
id("maven-publish")
|
||||
}
|
||||
@@ -25,8 +25,8 @@ extra.apply {
|
||||
set("signing.secretKeyRingFile", rootProject.optProperty<String>("signing.secretKeyRingFile") ?: System.getenv("SIGNING_SECRET_KEY_RING_FILE"))
|
||||
}
|
||||
|
||||
|
||||
group = "com.yandex.div"
|
||||
version = divkitVersionSuffixed
|
||||
|
||||
if (publishToMavenCentral) {
|
||||
signing {
|
||||
@@ -46,7 +46,7 @@ publishing {
|
||||
username = bucketUsername
|
||||
password = bucketPassword
|
||||
}
|
||||
url = if (publicationType == PublicationType.release) {
|
||||
url = if (publicationType.isRelease) {
|
||||
bucketReleasesUrl
|
||||
} else {
|
||||
bucketSnapshotsUrl
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package divkit.convension
|
||||
package divkit.convention
|
||||
|
||||
import com.yandex.divkit.gradle.applyProperties
|
||||
import com.yandex.divkit.gradle.optProperty
|
||||
@@ -6,7 +6,7 @@ import java.net.URI
|
||||
|
||||
plugins {
|
||||
id("io.github.gradle-nexus.publish-plugin")
|
||||
id("divkit.convension.version")
|
||||
id("divkit.convention.version")
|
||||
}
|
||||
|
||||
applyProperties(from = "$rootDir/bucket.properties")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package divkit.convension
|
||||
package divkit.convention
|
||||
|
||||
import com.yandex.divkit.gradle.PublicationType
|
||||
import com.yandex.divkit.gradle.Version
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("divkit.convension.publishing-module")
|
||||
alias(libs.plugins.kotlin.jvm)
|
||||
id("divkit.convention.publishing-module")
|
||||
}
|
||||
|
||||
kotlin {
|
||||
|
||||
@@ -7,7 +7,6 @@ jackson = "2.16.0"
|
||||
jsonAssert = "1.5.1"
|
||||
|
||||
[libraries]
|
||||
kotlin-gradle = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
|
||||
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin" }
|
||||
kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" }
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("divkit.convension.publishing-module")
|
||||
alias(libs.plugins.kotlin.jvm)
|
||||
id("divkit.convention.publishing-module")
|
||||
}
|
||||
|
||||
kotlin {
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
@Suppress("UnstableApiUsage")
|
||||
@file:Suppress("UnstableApiUsage")
|
||||
|
||||
rootProject.name = "kotlin-json-builder"
|
||||
|
||||
dependencyResolutionManagement {
|
||||
repositories {
|
||||
@@ -6,8 +8,6 @@ dependencyResolutionManagement {
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.name = "kotlin-json-builder"
|
||||
|
||||
plugins {
|
||||
id("org.gradle.toolchains.foojay-resolver-convention") version "0.10.0"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user