0.11.3 #42

Merged
altavir merged 8 commits from dev into master 2022-04-12 10:53:00 +03:00
8 changed files with 85 additions and 49 deletions

21
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,21 @@
name: Gradle build
on:
push:
branches: [ dev, master ]
pull_request:
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 40
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2.5.0
with:
java-version: 11
distribution: liberica
- uses: gradle/gradle-build-action@v2
with:
arguments: build

View File

@ -8,14 +8,17 @@ on:
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 40
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: actions/setup-java@v2.5.0
- name: Run a one-line script with:
run: echo Hello, world! java-version: 11
distribution: liberica
- name: Run a multi-line script - uses: gradle/gradle-build-action@v2
run: | with:
echo Add other actions to build, arguments: |
echo test, and deploy your project. publishAllPublicationsToSpaceRepository
-Ppublishing.space.user=${{ secrets.SPACE_APP_ID }}
-Ppublishing.space.token=${{ secrets.SPACE_APP_SECRET }}

View File

@ -7,9 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [Unreleased]
### Added ### Added
- Coroutine tests as default dependency for tests
- Context receiver flag
### Changed ### Changed
- Separate release tasks for each target - Separate release tasks for each target
- Kotlin 1.6.20
- Context receivers enabled
- Ktor 2.0
### Deprecated ### Deprecated

1
gradle.properties Normal file
View File

@ -0,0 +1 @@
kotlin.code.style=official

View File

@ -1,22 +1,22 @@
[versions] [versions]
tools = "0.11.2-kotlin-1.6.10" tools = "0.11.3-kotlin-1.6.20"
kotlin = "1.6.10" kotlin = "1.6.20"
atomicfu = "0.17.1" atomicfu = "0.17.1"
binary-compatibility-validator = "0.8.0" binary-compatibility-validator = "0.8.0"
changelog = "1.3.1" changelog = "1.3.1"
dokka = "1.6.10" dokka = "1.6.10"
kotlin-jupyter = "0.11.0-62" kotlin-jupyter = "0.11.0-71"
kotlinx-benchmark = "0.4.2" kotlinx-benchmark = "0.4.2"
kotlinx-cli = "0.3.4" kotlinx-cli = "0.3.4"
kotlinx-collections-immutable = "0.3.5" kotlinx-collections-immutable = "0.3.5"
kotlinx-coroutines = "1.6.0" kotlinx-coroutines = "1.6.1"
kotlinx-datetime = "0.3.2" kotlinx-datetime = "0.3.2"
kotlinx-html = "0.7.3" kotlinx-html = "0.7.3"
kotlinx-knit = "0.3.0" kotlinx-knit = "0.3.0"
kotlinx-nodejs = "0.0.7" kotlinx-nodejs = "0.0.7"
kotlinx-serialization = "1.3.2" kotlinx-serialization = "1.3.2"
ktor = "1.6.7" ktor = "2.0.0"
xmlutil = "0.84.0" xmlutil = "0.84.1"
yamlkt = "0.10.2" yamlkt = "0.10.2"
jsBom = "0.0.1-pre.313-kotlin-1.6.10" jsBom = "0.0.1-pre.313-kotlin-1.6.10"
junit = "5.8.2" junit = "5.8.2"

View File

@ -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-7.4-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

View File

@ -166,39 +166,9 @@ public open class KScienceProjectPlugin : Plugin<Project> {
} }
} }
tasks.withType<AbstractDokkaTask> { // tasks.withType<AbstractDokkaTask> {
dependsOn(generateReadme) // dependsOn(generateReadme)
} // }
}
val releaseAll by tasks.creating {
group = RELEASE_GROUP
description = "Publish development or production release based on version suffix"
}
allprojects {
afterEvaluate {
ksciencePublish.repositoryNames.forEach { repositoryName ->
val repositoryNameCapitalized = repositoryName.capitalize()
tasks.withType<PublishToMavenRepository>()
.filter { it.name.startsWith("publish") && it.name.endsWith("To${repositoryNameCapitalized}Repository") }
.forEach {
val theName = "release${
it.name.removePrefix("publish").removeSuffix("To${repositoryNameCapitalized}Repository")
}"
val targetReleaseTask = tasks.findByName(theName) ?: tasks.create(theName) {
group = RELEASE_GROUP
description = "Publish platform release artifact"
}
releaseAll.dependsOn(targetReleaseTask)
targetReleaseTask.dependsOn(it)
}
}
}
} }
val generateReadme by tasks.creating { val generateReadme by tasks.creating {
@ -264,6 +234,39 @@ public open class KScienceProjectPlugin : Plugin<Project> {
dependsOn(generateReadme) dependsOn(generateReadme)
} }
val releaseAll by tasks.creating {
group = RELEASE_GROUP
description = "Publish development or production release based on version suffix"
dependsOn(generateReadme)
}
allprojects {
afterEvaluate {
ksciencePublish.repositoryNames.forEach { repositoryName ->
val repositoryNameCapitalized = repositoryName.capitalize()
val pattern = "publish(?<publication>.*)PublicationTo${repositoryNameCapitalized}Repository"
.toRegex()
tasks.withType<PublishToMavenRepository>().toList().forEach forEachPublication@ {
val matchResult = pattern.matchEntire(it.name) ?: return@forEachPublication
val publicationName = matchResult.groups["publication"]!!.value.capitalize()
val releaseTaskName = "release$publicationName"
val targetReleaseTask = rootProject.tasks.findByName(releaseTaskName) ?: rootProject.tasks.create(releaseTaskName) {
group = RELEASE_GROUP
description = "Publish platform release artifact for $publicationName to all repositories"
}
releaseAll.dependsOn(targetReleaseTask)
targetReleaseTask.dependsOn(it)
}
}
}
}
// Disable API validation for snapshots // Disable API validation for snapshots
if (isSnapshot()) { if (isSnapshot()) {
extensions.findByType<ApiValidationExtension>()?.apply { extensions.findByType<ApiValidationExtension>()?.apply {

View File

@ -15,7 +15,7 @@ import ru.mipt.npm.gradle.internal.applySettings
import ru.mipt.npm.gradle.internal.fromJsDependencies import ru.mipt.npm.gradle.internal.fromJsDependencies
private val defaultJvmArgs: List<String> = listOf("-Xjvm-default=all", "-Xlambdas=indy") private val defaultJvmArgs: List<String> = listOf("-Xjvm-default=all", "-Xlambdas=indy", "-Xcontext-receivers")
public fun Project.configureKScience( public fun Project.configureKScience(
kotlinVersion: KotlinVersion kotlinVersion: KotlinVersion
@ -38,6 +38,7 @@ public fun Project.configureKScience(
dependencies { dependencies {
implementation(kotlin("test-junit5")) implementation(kotlin("test-junit5"))
implementation("org.junit.jupiter:junit-jupiter:${KScienceVersions.junit}") implementation("org.junit.jupiter:junit-jupiter:${KScienceVersions.junit}")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:${KScienceVersions.coroutinesVersion}")
} }
} }
} }
@ -83,6 +84,7 @@ public fun Project.configureKScience(
sourceSets["test"].apply { sourceSets["test"].apply {
dependencies { dependencies {
implementation(kotlin("test-js")) implementation(kotlin("test-js"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:${KScienceVersions.coroutinesVersion}")
} }
} }
} }
@ -124,6 +126,7 @@ public fun Project.configureKScience(
dependencies { dependencies {
implementation(kotlin("test-common")) implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common")) implementation(kotlin("test-annotations-common"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:${KScienceVersions.coroutinesVersion}")
} }
} }
val jvmMain by getting val jvmMain by getting