diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml old mode 100644 new mode 100755 index 6fcd417..c7911d8 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,4 @@ -name: Build and Test +name: "Build and Test" on: pull_request: @@ -10,19 +10,27 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set Up JDK + - name: "Set Up JDK" uses: actions/setup-java@v2 with: distribution: temurin java-version: 11 cache: gradle - - name: Grant execute permission for gradlew + - name: "Grant execute permission for gradlew" run: chmod +x gradlew - - name: Build with Gradle + - name: "Build with Gradle" run: ./gradlew build shell: bash - - name: Tests - run: ./gradlew cleanJvmTest jvmTest --tests "com.ucasoft.kcron.*" \ No newline at end of file + - name: "Tests" + run: ./gradlew cleanJvmTest jvmTest --tests "com.ucasoft.kcron.*" + + - name: "Tests Report" + uses: dorny/test-reporter@v1 + if: success() || failure() + with: + name: jUnit Tests + path: '**/build/test-results/jvmTest/TEST-*.xml' + reporter: java-junit \ No newline at end of file diff --git a/README.md b/README.md old mode 100644 new mode 100755 index 7e0481a..b43fe6a --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # KCron Common 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.5.4?color=blue)](https://search.maven.org/artifact/com.ucasoft.kcron/kcron-common/0.5.4/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.6.0?color=blue)](https://search.maven.org/artifact/com.ucasoft.kcron/kcron-common/0.6.0/jar) ### Features * Kotlin Multiplatform library @@ -38,7 +38,7 @@ kotlin { sourceSets { commonMain { dependencies { - implementation 'com.ucasoft.kcron:kcron-common:0.5.4' + implementation 'com.ucasoft.kcron:kcron-common:0.6.0' } } } @@ -91,6 +91,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.5.4`. +This library is on beta version `0.6.0`. However, it will be a part of another cool library. Check the news! diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 20247a4..0000000 --- a/build.gradle +++ /dev/null @@ -1,115 +0,0 @@ -plugins { - id 'org.jetbrains.kotlin.multiplatform' version '1.7.0' - id 'maven-publish' - id 'signing' -} - -group = 'com.ucasoft.kcron' -version = '0.5.4' - -repositories { - mavenCentral() - maven { url "https://kotlin.bintray.com/kotlinx/" } -} -kotlin { - jvm { - compilations.all { - kotlinOptions.jvmTarget = '1.8' - } - } - linuxX64() - mingwX64() - macosX64() - js() - ios() - iosSimulatorArm64() - sourceSets { - commonMain { - dependencies { - implementation 'org.jetbrains.kotlinx:kotlinx-datetime:0.4.0' - } - } - commonTest { - dependencies { - implementation kotlin('test-common') - implementation kotlin('test-annotations-common') - } - } - jvmTest { - dependencies { - implementation kotlin('test-junit') - } - } - } -} - -task stubSources(type: Jar) { - classifier = 'sources' -} - -task stubJavadoc(type: Jar) { - classifier = 'javadoc' -} - -task sourceJar(type: Jar){ - classifier = 'sources' - from kotlin.sourceSets.commonMain.kotlin -} - -publishing { - publications.all { - def libraryType = it.name - switch (libraryType) { - case 'js': - case 'metadata': - it.artifactId = "${project.name}-${libraryType}" - break - case 'jvm': - it.artifactId = "${project.name}" - break - case 'kotlinMultiplatform': - it.artifactId = "${project.name}-native" - break - } - pom { - name = 'KCron Common' - description = 'Cron realization for Kotlin Multiplatform' - url = 'https://github.com/Scogun/kcron-common' - licenses { - license { - name = 'GPL-3.0 License' - url = 'https://www.gnu.org/licenses/gpl-3.0.en.html' - } - } - developers { - developer { - id = 'Scogun' - name = 'Sergey Antonov' - email = 'SAntonov@ucasoft.com' - } - } - scm { - connection = 'scm:git:git://github.com/Scogun/kcron-common.git' - developerConnection = 'scm:git:ssh://github.com:Scogun/kcron-common.git' - url = 'https://github.com/Scogun/kcron-common' - } - } - if (libraryType != 'kotlinMultiplatform') { - artifact stubJavadoc - } - } - repositories { - maven { - name = 'MavenCentral' - url = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/' - credentials { - username = System.getenv('MAVEN_USERNAME') - password = System.getenv('MAVEN_PASSWORD') - } - } - } -} - -signing { - sign publishing.publications -} diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100755 index 0000000..6381b50 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,118 @@ +plugins { + kotlin("multiplatform") version "1.8.20" + id("maven-publish") + id("signing") +} + +group = "com.ucasoft.kcron" +version = "0.6.0" + +repositories { + mavenCentral() +} +kotlin { + jvm { + compilations.all { + kotlinOptions.jvmTarget = JavaVersion.VERSION_1_8.toString() + } + } + linuxX64() + mingwX64() + macosX64() + js(IR) { + browser() + nodejs() + } + ios() + iosSimulatorArm64() + sourceSets { + commonMain { + dependencies { + implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.4.0") + } + } + commonTest { + dependencies { + implementation(kotlin("test-common")) + implementation(kotlin("test-annotations-common")) + } + } + val jsTest by getting { + dependencies { + implementation(kotlin("test-js")) + } + } + val jvmTest by getting { + dependencies { + implementation(kotlin("test-junit")) + } + } + } +} + +val stubSources by tasks.creating(Jar::class) { + archiveClassifier.set("sources") +} + +val stubJavadoc by tasks.creating(Jar::class) { + archiveClassifier.set("javadoc") +} + +val sourceJar by tasks.creating(Jar::class) { + archiveClassifier.set("sources") + from(kotlin.sourceSets.commonMain.get().kotlin) +} + +publishing { + publications.configureEach { + if (this is MavenPublication) { + val libraryType = name + artifactId = when (libraryType) { + "js", "metadata" -> "${project.name}-${libraryType}" + "jvm" -> project.name + "kotlinMultiplatform" -> "${project.name}-native" + else -> artifactId + } + if (libraryType != "kotlinMultiplatform") { + artifact(stubJavadoc) + } + pom { + name.set("KCron Common") + description.set("Cron realization for Kotlin Multiplatform") + url.set("https://github.com/Scogun/kcron-common") + licenses { + license { + name.set("GPL-3.0 License") + url.set("https://www.gnu.org/licenses/gpl-3.0.en.html") + } + } + developers { + developer { + id.set("Scogun") + name.set("Sergey Antonov") + email.set("SAntonov@ucasoft.com") + } + } + 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") + } + } + } + } + repositories { + maven { + name = "MavenCentral" + url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/") + credentials { + username = System.getenv("MAVEN_USERNAME") + password = System.getenv("MAVEN_PASSWORD") + } + } + } +} + +signing { + sign(publishing.publications) +} diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties old mode 100644 new mode 100755 index aa991fc..774fae8 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index 2f69e83..0000000 --- a/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'kcron-common' \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 0000000..f7386f7 --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,2 @@ + +rootProject.name = "kcron-common"