Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ jobs:
needs: tests
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Set Up JDK
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 11
java-version: 17
cache: gradle

- name: Grant execute permission for gradlew
Expand All @@ -38,7 +38,7 @@ jobs:
shell: bash

- name: Publish
run: ./gradlew publishAllPublicationsToMavenCentralRepository -Psigning.keyId=${{ secrets.SIGNING_KEY_ID }} -Psigning.password=${{ secrets.SIGNING_PASSWORD }} -Psigning.secretKeyRingFile=$(echo ~/.gradle/secring.gpg)
run: ./gradlew publishToMavenCentral -Psigning.keyId=${{ secrets.SIGNING_KEY_ID }} -Psigning.password=${{ secrets.SIGNING_PASSWORD }} -Psigning.secretKeyRingFile=$(echo ~/.gradle/secring.gpg)
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_TOKEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_TOKEN_PASSWORD }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_TOKEN_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_TOKEN_PASSWORD }}
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ jobs:
os: [macos-13, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: "Set Up JDK"
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 11
java-version: 17
cache: gradle

- name: "Grant execute permission for gradlew"
Expand All @@ -44,7 +44,7 @@ jobs:
run: ./gradlew cleanMacosX64Test macosX64Test --tests "com.ucasoft.kcron.*"

- name: "Tests Report"
uses: dorny/test-reporter@v1
uses: dorny/test-reporter@v2
if: success() || failure()
with:
name: jUnit Tests
Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# KCron
Cron realization for Kotlin Multiplatform

[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Scogun_kcron-common&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=Scogun_kcron-common) ![GitHub](https://img.shields.io/github/license/Scogun/kcron-common?color=blue) ![Publish workflow](https://github.com/Scogun/kcron-common/actions/workflows/publish.yml/badge.svg) [![Maven Central with version prefix filter](https://img.shields.io/maven-central/v/com.ucasoft.kcron/kcron-common/0.23.0?color=blue)](https://search.maven.org/artifact/com.ucasoft.kcron/kcron-common/0.23.0/jar)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Scogun_kcron-common&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=Scogun_kcron-common) ![GitHub](https://img.shields.io/github/license/Scogun/kcron-common?color=blue) ![Publish workflow](https://github.com/Scogun/kcron-common/actions/workflows/publish.yml/badge.svg) [![Maven Central with version prefix filter](https://img.shields.io/maven-central/v/com.ucasoft.kcron/kcron-common/0.27.4?color=blue)](https://search.maven.org/artifact/com.ucasoft.kcron/kcron-common/0.27.4/jar)

### Features
* Kotlin Multiplatform library
Expand Down Expand Up @@ -43,6 +43,10 @@ builder
* Wasm
* iOS
* Support different DateTime libraries (via DateTime Provider Abstractions)
* Provide UI builder for JVM, macOS, JavaScript and iOS on Compose UI multiplatform
* Multilanguage support (English and Russian now)
<p><img src="docs/images/CronUIBuilderEn.png" alt="KCron Compose UI" width="300"/></p>

### Usage
#### KCron-Common library as default implementation uses [Kotlinx-DateTime](https://github.com/Kotlin/kotlinx-datetime) library
***Add with Gradle***
Expand All @@ -51,7 +55,7 @@ kotlin {
sourceSets {
commonMain {
dependencies {
implementation 'com.ucasoft.kcron:kcron-common:0.23.0'
implementation 'com.ucasoft.kcron:kcron-common:0.27.4'
}
}
}
Expand Down Expand Up @@ -116,6 +120,6 @@ builder.years(2021..2025)
println(builder.expression) // 0/10 5-25 5,12 ? * SUN#5 2021-2025
```
### Current status
This library is on beta version `0.23.0`.
This library is on beta version `0.27.4`.
It is continuing to develop.
Check the news!
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
alias(libs.plugins.multiplatform) apply false
id("publish") apply false
alias(libs.plugins.maven.publish) apply false
alias(libs.plugins.kover) apply false
alias(libs.plugins.benchmark) apply false
}
Expand All @@ -9,11 +9,11 @@ allprojects {

group = "com.ucasoft.kcron"

version = "0.23.0"

repositories {
google()
mavenCentral()
}
version = "0.27.4"

tasks.withType<Test> {
reports {
Expand Down
9 changes: 9 additions & 0 deletions buildSrc/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dependencyResolutionManagement {
versionCatalogs {
create("libs") {
from(files("../gradle/libs.versions.toml"))
}
}
}

rootProject.name = "kcron"
33 changes: 28 additions & 5 deletions buildSrc/src/main/kotlin/PublishingExtension.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,30 @@
import org.gradle.api.model.ObjectFactory
import org.gradle.kotlin.dsl.property
import org.gradle.api.publish.maven.MavenPom

open class PublishingExtension(factory: ObjectFactory) {
val name = factory.property<String>()
val description = factory.property<String>()
fun configurePom(name: String, description: String, pom: MavenPom) {
pom.name.set(name)
pom.description.set(description)
pom.url.set("https://github.com/Scogun/kcron-common")
pom.licenses {
license {
this.name.set("The Apache License, Version 2.0")
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
pom.developers {
developer {
id.set("Scogun")
this.name.set("Sergey Antonov")
email.set("SAntonov@ucasoft.com")
}
developer {
id.set("Myshkouski")
this.name.set("Alexei Myshkouski")
email.set("alexeimyshkouski@gmail.com")
}
}
pom.scm {
connection.set("scm:git:git://github.com/Scogun/kcron-common.git")
developerConnection.set("scm:git:ssh://github.com:Scogun/kcron-common.git")
url.set("https://github.com/Scogun/kcron-common")
}
}
67 changes: 0 additions & 67 deletions buildSrc/src/main/kotlin/publish.gradle.kts

This file was deleted.

Binary file added docs/images/CronUiBuilderEn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
kotlin.code.style=official
org.jetbrains.compose.experimental.jscanvas.enabled=true
org.jetbrains.compose.experimental.macos.enabled=true
15 changes: 10 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
[versions]
kotlin = "2.1.0"
kotlinx-datetime = "0.6.1"
kotlin = "2.2.0"
kotlinx-datetime = "0.7.1"
kotest = "5.9.1"
kover = "0.9.0"
benchmark = "0.4.13"
kover = "0.9.1"
benchmark = "0.4.14"
compose = "1.8.2"
maven-publish = "0.34.0"

[libraries]
kotlinx-datetime = { group = "org.jetbrains.kotlinx", name = "kotlinx-datetime", version.ref = "kotlinx-datetime" }
Expand All @@ -14,4 +16,7 @@ kotest-assetions = { group = "io.kotest", name = "kotest-assertions-core", versi
[plugins]
multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }
benchmark = { id = "org.jetbrains.kotlinx.benchmark", version.ref = "benchmark" }
benchmark = { id = "org.jetbrains.kotlinx.benchmark", version.ref = "benchmark" }
compose = { id = "org.jetbrains.compose", version.ref = "compose" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
maven-publish = { id = "com.vanniktech.maven.publish", version.ref = "maven-publish" }
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
8 changes: 4 additions & 4 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions kcron-abstractions/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
alias(libs.plugins.multiplatform)
id("publish")
alias(libs.plugins.maven.publish)
}

kotlin {
Expand Down Expand Up @@ -28,7 +28,11 @@ kotlin {
}
}

libraryData {
name.set("KCron Abstractions")
description.set("Abstractions for Kotlin Multiplatform Cron realization")
mavenPublishing {
publishToMavenCentral()
signAllPublications()

pom {
configurePom("KCron Abstractions", "Abstractions for Kotlin Multiplatform Cron realization", this)
}
}
12 changes: 8 additions & 4 deletions kcron-common/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
alias(libs.plugins.multiplatform)
id("publish")
alias(libs.plugins.maven.publish)
alias(libs.plugins.kover)
}

Expand Down Expand Up @@ -40,7 +40,11 @@ kotlin {
}
}

libraryData {
name.set("KCron Common")
description.set("Cron realization for Kotlin Multiplatform with Kotlinx DateTime Provider")
mavenPublishing {
publishToMavenCentral()
signAllPublications()

pom {
configurePom("KCron Common", "Cron realization for Kotlin Multiplatform with Kotlinx DateTime Provider", this)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,20 @@ import com.ucasoft.kcron.core.settings.Version
import io.kotest.assertions.throwables.shouldThrowWithMessage
import io.kotest.matchers.nulls.shouldNotBeNull
import io.kotest.matchers.shouldBe
import kotlinx.datetime.Clock
import kotlinx.datetime.TimeZone
import kotlinx.datetime.toLocalDateTime
import kotlin.test.BeforeTest
import kotlin.test.Test
import kotlin.time.Clock
import kotlin.time.ExperimentalTime

class BuildAndParseTests {

private var currentYear : Int = 2024

private val modernCronExpression = "30 * * ? * * 2050"

@OptIn(ExperimentalTime::class)
@BeforeTest
fun setupOnce() {
currentYear = Clock.System.now().toLocalDateTime(TimeZone.currentSystemDefault()).year
Expand Down
Loading
Loading