Skip to content

Commit 3d84321

Browse files
authored
Merge pull request #42 from mipt-npm/dev
0.11.3
2 parents e9c6174 + 6d5a295 commit 3d84321

File tree

8 files changed

+85
-49
lines changed

8 files changed

+85
-49
lines changed

.github/workflows/build.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Gradle build
2+
3+
on:
4+
push:
5+
branches: [ dev, master ]
6+
pull_request:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 40
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
- uses: actions/setup-java@v2.5.0
16+
with:
17+
java-version: 11
18+
distribution: liberica
19+
- uses: gradle/gradle-build-action@v2
20+
with:
21+
arguments: build

.github/workflows/publish.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@ on:
88
jobs:
99
build:
1010
runs-on: ubuntu-latest
11+
timeout-minutes: 40
1112

1213
steps:
1314
- uses: actions/checkout@v2
14-
15-
- name: Run a one-line script
16-
run: echo Hello, world!
17-
18-
- name: Run a multi-line script
19-
run: |
20-
echo Add other actions to build,
21-
echo test, and deploy your project.
15+
- uses: actions/setup-java@v2.5.0
16+
with:
17+
java-version: 11
18+
distribution: liberica
19+
- uses: gradle/gradle-build-action@v2
20+
with:
21+
arguments: |
22+
publishAllPublicationsToSpaceRepository
23+
-Ppublishing.space.user=${{ secrets.SPACE_APP_ID }}
24+
-Ppublishing.space.token=${{ secrets.SPACE_APP_SECRET }}

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99
### Added
10+
- Coroutine tests as default dependency for tests
11+
- Context receiver flag
1012

1113
### Changed
1214
- Separate release tasks for each target
15+
- Kotlin 1.6.20
16+
- Context receivers enabled
17+
- Ktor 2.0
1318

1419
### Deprecated
1520

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
kotlin.code.style=official

gradle/libs.versions.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
[versions]
2-
tools = "0.11.2-kotlin-1.6.10"
3-
kotlin = "1.6.10"
2+
tools = "0.11.3-kotlin-1.6.20"
3+
kotlin = "1.6.20"
44
atomicfu = "0.17.1"
55
binary-compatibility-validator = "0.8.0"
66
changelog = "1.3.1"
77
dokka = "1.6.10"
8-
kotlin-jupyter = "0.11.0-62"
8+
kotlin-jupyter = "0.11.0-71"
99
kotlinx-benchmark = "0.4.2"
1010
kotlinx-cli = "0.3.4"
1111
kotlinx-collections-immutable = "0.3.5"
12-
kotlinx-coroutines = "1.6.0"
12+
kotlinx-coroutines = "1.6.1"
1313
kotlinx-datetime = "0.3.2"
1414
kotlinx-html = "0.7.3"
1515
kotlinx-knit = "0.3.0"
1616
kotlinx-nodejs = "0.0.7"
1717
kotlinx-serialization = "1.3.2"
18-
ktor = "1.6.7"
19-
xmlutil = "0.84.0"
18+
ktor = "2.0.0"
19+
xmlutil = "0.84.1"
2020
yamlkt = "0.10.2"
2121
jsBom = "0.0.1-pre.313-kotlin-1.6.10"
2222
junit = "5.8.2"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

src/main/kotlin/ru/mipt/npm/gradle/KScienceProjectPlugin.kt

Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -166,39 +166,9 @@ public open class KScienceProjectPlugin : Plugin<Project> {
166166
}
167167
}
168168

169-
tasks.withType<AbstractDokkaTask> {
170-
dependsOn(generateReadme)
171-
}
172-
}
173-
174-
val releaseAll by tasks.creating {
175-
group = RELEASE_GROUP
176-
description = "Publish development or production release based on version suffix"
177-
}
178-
179-
allprojects {
180-
afterEvaluate {
181-
ksciencePublish.repositoryNames.forEach { repositoryName ->
182-
val repositoryNameCapitalized = repositoryName.capitalize()
183-
184-
tasks.withType<PublishToMavenRepository>()
185-
.filter { it.name.startsWith("publish") && it.name.endsWith("To${repositoryNameCapitalized}Repository") }
186-
.forEach {
187-
val theName = "release${
188-
it.name.removePrefix("publish").removeSuffix("To${repositoryNameCapitalized}Repository")
189-
}"
190-
191-
val targetReleaseTask = tasks.findByName(theName) ?: tasks.create(theName) {
192-
group = RELEASE_GROUP
193-
description = "Publish platform release artifact"
194-
}
195-
196-
releaseAll.dependsOn(targetReleaseTask)
197-
198-
targetReleaseTask.dependsOn(it)
199-
}
200-
}
201-
}
169+
// tasks.withType<AbstractDokkaTask> {
170+
// dependsOn(generateReadme)
171+
// }
202172
}
203173

204174
val generateReadme by tasks.creating {
@@ -264,6 +234,39 @@ public open class KScienceProjectPlugin : Plugin<Project> {
264234
dependsOn(generateReadme)
265235
}
266236

237+
238+
val releaseAll by tasks.creating {
239+
group = RELEASE_GROUP
240+
description = "Publish development or production release based on version suffix"
241+
dependsOn(generateReadme)
242+
}
243+
244+
allprojects {
245+
afterEvaluate {
246+
ksciencePublish.repositoryNames.forEach { repositoryName ->
247+
val repositoryNameCapitalized = repositoryName.capitalize()
248+
249+
val pattern = "publish(?<publication>.*)PublicationTo${repositoryNameCapitalized}Repository"
250+
.toRegex()
251+
252+
tasks.withType<PublishToMavenRepository>().toList().forEach forEachPublication@ {
253+
val matchResult = pattern.matchEntire(it.name) ?: return@forEachPublication
254+
val publicationName = matchResult.groups["publication"]!!.value.capitalize()
255+
val releaseTaskName = "release$publicationName"
256+
257+
val targetReleaseTask = rootProject.tasks.findByName(releaseTaskName) ?: rootProject.tasks.create(releaseTaskName) {
258+
group = RELEASE_GROUP
259+
description = "Publish platform release artifact for $publicationName to all repositories"
260+
}
261+
262+
releaseAll.dependsOn(targetReleaseTask)
263+
264+
targetReleaseTask.dependsOn(it)
265+
}
266+
}
267+
}
268+
}
269+
267270
// Disable API validation for snapshots
268271
if (isSnapshot()) {
269272
extensions.findByType<ApiValidationExtension>()?.apply {

src/main/kotlin/ru/mipt/npm/gradle/commonConfigurations.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import ru.mipt.npm.gradle.internal.applySettings
1515
import ru.mipt.npm.gradle.internal.fromJsDependencies
1616

1717

18-
private val defaultJvmArgs: List<String> = listOf("-Xjvm-default=all", "-Xlambdas=indy")
18+
private val defaultJvmArgs: List<String> = listOf("-Xjvm-default=all", "-Xlambdas=indy", "-Xcontext-receivers")
1919

2020
public fun Project.configureKScience(
2121
kotlinVersion: KotlinVersion
@@ -38,6 +38,7 @@ public fun Project.configureKScience(
3838
dependencies {
3939
implementation(kotlin("test-junit5"))
4040
implementation("org.junit.jupiter:junit-jupiter:${KScienceVersions.junit}")
41+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:${KScienceVersions.coroutinesVersion}")
4142
}
4243
}
4344
}
@@ -83,6 +84,7 @@ public fun Project.configureKScience(
8384
sourceSets["test"].apply {
8485
dependencies {
8586
implementation(kotlin("test-js"))
87+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:${KScienceVersions.coroutinesVersion}")
8688
}
8789
}
8890
}
@@ -124,6 +126,7 @@ public fun Project.configureKScience(
124126
dependencies {
125127
implementation(kotlin("test-common"))
126128
implementation(kotlin("test-annotations-common"))
129+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:${KScienceVersions.coroutinesVersion}")
127130
}
128131
}
129132
val jvmMain by getting

0 commit comments

Comments
 (0)