Version 1.1.0, add oklch color option
- Update publish plugin
This commit is contained in:
164
build.gradle.kts
164
build.gradle.kts
@@ -1,16 +1,17 @@
|
|||||||
@file:OptIn(ExperimentalWasmDsl::class)
|
@file:OptIn(ExperimentalWasmDsl::class)
|
||||||
|
|
||||||
|
import com.vanniktech.maven.publish.SonatypeHost
|
||||||
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
|
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
kotlin("multiplatform") version "2.0.21"
|
kotlin("multiplatform") version "2.1.10"
|
||||||
`maven-publish`
|
id("com.vanniktech.maven.publish") version "0.31.0"
|
||||||
signing
|
signing
|
||||||
id("org.jetbrains.dokka") version "1.5.31"
|
id("org.jetbrains.dokka") version "2.0.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "nl.astraeus"
|
group = "nl.astraeus"
|
||||||
version = "1.0.11-SNAPSHOT"
|
version = "1.1.0"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
@@ -54,61 +55,13 @@ kotlin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extra["PUBLISH_GROUP_ID"] = group
|
|
||||||
extra["PUBLISH_VERSION"] = version
|
|
||||||
extra["PUBLISH_ARTIFACT_ID"] = name
|
|
||||||
|
|
||||||
// Stub secrets to let the project sync and build without the publication values set up
|
|
||||||
val signingKeyId: String by project
|
|
||||||
val signingPassword: String by project
|
|
||||||
val signingSecretKeyRingFile: String by project
|
|
||||||
val ossrhUsername: String by project
|
|
||||||
val ossrhPassword: String by project
|
|
||||||
|
|
||||||
extra["signing.keyId"] = signingKeyId
|
|
||||||
extra["signing.password"] = signingPassword
|
|
||||||
extra["signing.secretKeyRingFile"] = signingSecretKeyRingFile
|
|
||||||
extra["ossrhUsername"] = ossrhUsername
|
|
||||||
extra["ossrhPassword"] = ossrhPassword
|
|
||||||
|
|
||||||
val javadocJar by tasks.registering(Jar::class) {
|
val javadocJar by tasks.registering(Jar::class) {
|
||||||
archiveClassifier.set("javadoc")
|
archiveClassifier.set("javadoc")
|
||||||
}
|
}
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
repositories {
|
repositories {
|
||||||
maven {
|
mavenLocal()
|
||||||
name = "releases"
|
|
||||||
// change to point to your repo, e.g. http://my.org/repo
|
|
||||||
setUrl("https://reposilite.astraeus.nl/releases")
|
|
||||||
credentials {
|
|
||||||
val reposiliteUsername: String? by project
|
|
||||||
val reposilitePassword: String? by project
|
|
||||||
|
|
||||||
username = reposiliteUsername
|
|
||||||
password = reposilitePassword
|
|
||||||
}
|
|
||||||
}
|
|
||||||
maven {
|
|
||||||
name = "snapshots"
|
|
||||||
// change to point to your repo, e.g. http://my.org/repo
|
|
||||||
setUrl("https://reposilite.astraeus.nl/snapshots")
|
|
||||||
credentials {
|
|
||||||
val reposiliteUsername: String? by project
|
|
||||||
val reposilitePassword: String? by project
|
|
||||||
|
|
||||||
username = reposiliteUsername
|
|
||||||
password = reposilitePassword
|
|
||||||
}
|
|
||||||
}
|
|
||||||
maven {
|
|
||||||
name = "sonatype"
|
|
||||||
setUrl("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2")
|
|
||||||
credentials {
|
|
||||||
username = ossrhUsername
|
|
||||||
password = ossrhPassword
|
|
||||||
}
|
|
||||||
}
|
|
||||||
maven {
|
maven {
|
||||||
name = "gitea"
|
name = "gitea"
|
||||||
setUrl("https://gitea.astraeus.nl/api/packages/rnentjes/maven")
|
setUrl("https://gitea.astraeus.nl/api/packages/rnentjes/maven")
|
||||||
@@ -122,91 +75,44 @@ publishing {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Configure all publications
|
|
||||||
publications.withType<MavenPublication> {
|
|
||||||
// Stub javadoc.jar artifact
|
|
||||||
artifact(javadocJar.get())
|
|
||||||
|
|
||||||
// Provide artifacts information requited by Maven Central
|
|
||||||
pom {
|
|
||||||
name.set("kotlin-css-generator")
|
|
||||||
description.set("Kotlin css generator")
|
|
||||||
url.set("https://github.com/rnentjes/kotlin-css-generator")
|
|
||||||
|
|
||||||
licenses {
|
|
||||||
license {
|
|
||||||
name.set("MIT")
|
|
||||||
url.set("https://opensource.org/licenses/MIT")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
developers {
|
|
||||||
developer {
|
|
||||||
id.set("rnentjes")
|
|
||||||
name.set("Rien Nentjes")
|
|
||||||
email.set("info@nentjes.com")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
scm {
|
|
||||||
url.set("https://github.com/rnentjes/kotlin-css-generator")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
signing {
|
signing {
|
||||||
sign(publishing.publications)
|
sign(publishing.publications)
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.named<Task>("publishJsPublicationToMavenLocal") {
|
|
||||||
dependsOn(tasks.named<Task>("signJvmPublication"))
|
tasks.withType<AbstractPublishToMaven> {
|
||||||
dependsOn(tasks.named<Task>("signKotlinMultiplatformPublication"))
|
dependsOn(tasks.withType<Sign>())
|
||||||
dependsOn(tasks.named<Task>("signWasmJsPublication"))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.named<Task>("publishJvmPublicationToMavenLocal") {
|
mavenPublishing {
|
||||||
dependsOn(tasks.named<Task>("signJsPublication"))
|
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
|
||||||
dependsOn(tasks.named<Task>("signKotlinMultiplatformPublication"))
|
|
||||||
dependsOn(tasks.named<Task>("signWasmJsPublication"))
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.named<Task>("publishKotlinMultiplatformPublicationToMavenLocal") {
|
signAllPublications()
|
||||||
dependsOn(tasks.named<Task>("signJvmPublication"))
|
|
||||||
dependsOn(tasks.named<Task>("signJsPublication"))
|
|
||||||
dependsOn(tasks.named<Task>("signWasmJsPublication"))
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.named<Task>("publishWasmJsPublicationToMavenLocal") {
|
coordinates(group.toString(), name, version.toString())
|
||||||
dependsOn(tasks.named<Task>("signKotlinMultiplatformPublication"))
|
|
||||||
dependsOn(tasks.named<Task>("signJvmPublication"))
|
|
||||||
dependsOn(tasks.named<Task>("signJsPublication"))
|
|
||||||
dependsOn(tasks.named<Task>("signWasmJsPublication"))
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.named<Task>("publishJsPublicationToGiteaRepository") {
|
pom {
|
||||||
dependsOn(tasks.named<Task>("signKotlinMultiplatformPublication"))
|
name = "kotlin-css-generator"
|
||||||
dependsOn(tasks.named<Task>("signJvmPublication"))
|
description = "Kotlin css generator"
|
||||||
dependsOn(tasks.named<Task>("signJsPublication"))
|
inceptionYear = "2020"
|
||||||
dependsOn(tasks.named<Task>("signWasmJsPublication"))
|
url = "https://github.com/rnentjes/kotlin-css-generator"
|
||||||
}
|
licenses {
|
||||||
|
license {
|
||||||
tasks.named<Task>("publishJvmPublicationToGiteaRepository") {
|
name = "MIT"
|
||||||
dependsOn(tasks.named<Task>("signKotlinMultiplatformPublication"))
|
url = "https://opensource.org/licenses/MIT"
|
||||||
dependsOn(tasks.named<Task>("signJvmPublication"))
|
}
|
||||||
dependsOn(tasks.named<Task>("signJsPublication"))
|
}
|
||||||
dependsOn(tasks.named<Task>("signWasmJsPublication"))
|
developers {
|
||||||
}
|
developer {
|
||||||
|
id = "rnentjes"
|
||||||
tasks.named<Task>("publishKotlinMultiplatformPublicationToGiteaRepository") {
|
name = "Rien Nentjes"
|
||||||
dependsOn(tasks.named<Task>("signKotlinMultiplatformPublication"))
|
email = "info@nentjes.com"
|
||||||
dependsOn(tasks.named<Task>("signJvmPublication"))
|
}
|
||||||
dependsOn(tasks.named<Task>("signJsPublication"))
|
}
|
||||||
dependsOn(tasks.named<Task>("signWasmJsPublication"))
|
scm {
|
||||||
}
|
url = "https://github.com/rnentjes/kotlin-css-generator"
|
||||||
|
}
|
||||||
tasks.named<Task>("publishWasmJsPublicationToGiteaRepository") {
|
}
|
||||||
dependsOn(tasks.named<Task>("signKotlinMultiplatformPublication"))
|
|
||||||
dependsOn(tasks.named<Task>("signJvmPublication"))
|
|
||||||
dependsOn(tasks.named<Task>("signJsPublication"))
|
|
||||||
dependsOn(tasks.named<Task>("signWasmJsPublication"))
|
|
||||||
}
|
}
|
||||||
|
|||||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,5 +1,5 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|||||||
@@ -1,11 +1,20 @@
|
|||||||
pluginManagement {
|
pluginManagement {
|
||||||
repositories {
|
repositories {
|
||||||
|
google()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
gradlePluginPortal()
|
||||||
maven { setUrl("https://plugins.gradle.org/m2/") }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rootProject.name = "kotlin-css-generator"
|
dependencyResolutionManagement {
|
||||||
|
repositories {
|
||||||
|
google()
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//enableFeaturePreview("GRADLE_METADATA")
|
plugins {
|
||||||
|
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
|
||||||
|
}
|
||||||
|
|
||||||
|
rootProject.name = "kotlin-css-generator"
|
||||||
|
|||||||
@@ -585,6 +585,8 @@ fun rgb(red: Int, green: Int, blue: Int) = Color("rgb($red, $green, $blue)")
|
|||||||
fun rgba(red: Int, green: Int, blue: Int, alpha: Double) = Color("rgba($red, $green, $blue, ${formatAlpha(alpha)})")
|
fun rgba(red: Int, green: Int, blue: Int, alpha: Double) = Color("rgba($red, $green, $blue, ${formatAlpha(alpha)})")
|
||||||
fun hsl(hue: Int, saturation: Int, lightness: Int) = Color("hsl($hue, $saturation%, $lightness%)")
|
fun hsl(hue: Int, saturation: Int, lightness: Int) = Color("hsl($hue, $saturation%, $lightness%)")
|
||||||
fun hsla(hue: Int, saturation: Int, lightness: Int, alpha: Double) = Color("hsla($hue, $saturation%, $lightness%, ${formatAlpha(alpha)})")
|
fun hsla(hue: Int, saturation: Int, lightness: Int, alpha: Double) = Color("hsla($hue, $saturation%, $lightness%, ${formatAlpha(alpha)})")
|
||||||
|
fun oklch(lightness: Int, chroma: Double, hue: Double) = Color("oklch($lightness% $chroma $hue)")
|
||||||
|
fun oklch(lightness: Int, chroma: Double, hue: Double, alpha: Double) = Color("oklch($lightness% $chroma $hue / ${formatAlpha(alpha)})")
|
||||||
fun blackAlpha(alpha: Double) = Color.black.withAlpha(alpha)
|
fun blackAlpha(alpha: Double) = Color.black.withAlpha(alpha)
|
||||||
fun whiteAlpha(alpha: Double) = Color.white.withAlpha(alpha)
|
fun whiteAlpha(alpha: Double) = Color.white.withAlpha(alpha)
|
||||||
|
|
||||||
|
|||||||
20
src/commonTest/kotlin/nl/astraeus/css/ColorTest.kt
Normal file
20
src/commonTest/kotlin/nl/astraeus/css/ColorTest.kt
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
package nl.astraeus.css
|
||||||
|
|
||||||
|
import nl.astraeus.css.properties.oklch
|
||||||
|
import kotlin.test.Test
|
||||||
|
|
||||||
|
class ColorTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun testColor() {
|
||||||
|
val css = style {
|
||||||
|
select("body") {
|
||||||
|
color(oklch(100, 0.5, 0.5))
|
||||||
|
backgroundColor(oklch(100, 0.5, 0.5, 0.25))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
println(css.generateCss())
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -187,7 +187,6 @@ class TestCssBuilder {
|
|||||||
println(css2.generateCss())
|
println(css2.generateCss())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testOr() {
|
fun testOr() {
|
||||||
val css = style {
|
val css = style {
|
||||||
|
|||||||
Reference in New Issue
Block a user