Skip to content

Commit 1f938c2

Browse files
authored
Maven publishing (#40)
* try to fix build on JitPack gradle/gradle#20925 * quick fix for publish/signing task ordering warning * bump qoomon git versioning qoomon/gradle-git-versioning-plugin#76 * add some cool badges to readme
1 parent d38f503 commit 1f938c2

File tree

3 files changed

+20
-9
lines changed

3 files changed

+20
-9
lines changed

README.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
[![](https://jitpack.io/v/adamko-dev/kotlinx-serialization-typescript-generator.svg)](https://jitpack.io/#adamko-dev/kotlinx-serialization-typescript-generator)
1+
[![Status](https://img.shields.io/badge/status-proof--of--concept-blueviolet?style=flat-square)](https://github.com/adamko-dev/kotlinx-serialization-typescript-generator#status)
2+
[![GitHub license](https://img.shields.io/github/license/adamko-dev/kotlinx-serialization-typescript-generator?style=flat-square)](https://github.com/adamko-dev/kotlinx-serialization-typescript-generator/blob/main/LICENSE)
3+
[![Maven Central](https://img.shields.io/maven-central/v/dev.adamko.txstsgen/kxs-ts-gen-core?style=flat-square)](https://search.maven.org/search?q=g:dev.adamko.txstsgen)
4+
[![](https://jitpack.io/v/adamko-dev/kotlinx-serialization-typescript-generator.svg?style=flat-square)](https://jitpack.io/#adamko-dev/kotlinx-serialization-typescript-generator)
25

36
# Kotlinx Serialization TypeScript Generator
47

@@ -35,7 +38,7 @@ export interface MyClass {
3538
}
3639
```
3740

38-
Only Kotlinx Serialization
41+
Only Kotlinx Serialization
3942
[`SerialDescriptor`s](https://kotlin.github.io/kotlinx.serialization/kotlinx-serialization-core/kotlinx.serialization.descriptors/-serial-descriptor/index.html)
4043
are used to generate TypeScript. They are flexible and comprehensive enough to allow for accurate TypeScript code, without any deviation.
4144

buildSrc/src/main/kotlin/buildsrc/convention/maven-publish.gradle.kts

+14-5
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ plugins {
1212
signing
1313
}
1414

15-
val sonatypeRepositoryCredentials: Provider<Action<PasswordCredentials>> = providers
16-
.credentials(PasswordCredentials::class, "sonatypeRepository")
17-
.map { credentials ->
15+
val sonatypeRepositoryCredentials: Provider<Action<PasswordCredentials>> =
16+
providers.zip(
17+
providers.gradleProperty("sonatypeRepositoryUsername"),
18+
providers.gradleProperty("sonatypeRepositoryPassword"),
19+
) { user, pass ->
1820
Action<PasswordCredentials> {
19-
username = credentials.username
20-
password = credentials.password
21+
username = user
22+
password = pass
2123
}
2224
}
2325

@@ -60,6 +62,13 @@ tasks.matching {
6062
}
6163

6264

65+
// Gradle warns about some signing tasks using publishing task outputs without explicit
66+
// dependencies. I'm not going to go through them all and fix them, so here's a quick safety check.
67+
tasks.matching { it.name.startsWith("publish") }.configureEach {
68+
mustRunAfter(tasks.matching { it.name.startsWith("sign") })
69+
}
70+
71+
6372
publishing {
6473
if (sonatypeRepositoryCredentials.isPresent()) {
6574
repositories {

gradle/libs.versions.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ classgraph = "4.8.143"
2323

2424
gradleNodePlugin = "3.3.0"
2525

26-
#qoomonGitVersioning = "6.1.1" // bugged: https://github.com/qoomon/gradle-git-versioning-plugin/issues/76
27-
qoomonGitVersioning = "5.2.0"
26+
qoomonGitVersioning = "6.1.2"
2827

2928
[libraries]
3029

0 commit comments

Comments
 (0)