Skip to content

Version bumps #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 12, 2022
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![Status](https://img.shields.io/badge/status-proof--of--concept-blueviolet?style=flat-square)](https://github.com/adamko-dev/kotlinx-serialization-typescript-generator#status)
[![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)
[![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.kxstsgen)
[![Maven Central](https://img.shields.io/maven-central/v/dev.adamko.kxstsgen/kxs-ts-gen-core?color=%234c1&style=flat-square)](https://search.maven.org/search?q=g:dev.adamko.kxstsgen)
[![](https://jitpack.io/v/adamko-dev/kotlinx-serialization-typescript-generator.svg?style=flat-square)](https://jitpack.io/#adamko-dev/kotlinx-serialization-typescript-generator)

# Kotlinx Serialization TypeScript Generator
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import buildsrc.config.excludeGeneratedGradleDsl

plugins {
base
idea
id("me.qoomon.git-versioning")
id("org.jetbrains.kotlinx.kover")
Expand All @@ -27,6 +26,7 @@ tasks.wrapper {
distributionType = Wrapper.DistributionType.ALL
}


idea {
module {
isDownloadSources = true
Expand Down
10 changes: 10 additions & 0 deletions buildSrc/repositories.settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ dependencyResolutionManagement {
metadataSources { artifact() }
content { includeModule("com.yarnpkg", "yarn") }
}

sonatypeSnapshots()
}

pluginManagement {
Expand All @@ -28,6 +30,7 @@ dependencyResolutionManagement {
jitpack()
gradlePluginPortal()
mavenCentral()
sonatypeSnapshots()
}
}
}
Expand All @@ -38,6 +41,13 @@ fun RepositoryHandler.jitpack() {
}


fun RepositoryHandler.sonatypeSnapshots() {
maven("https://oss.sonatype.org/content/repositories/snapshots") {
mavenContent { snapshotsOnly() }
}
}


fun RepositoryHandler.myMavenLocal(enabled: Boolean = false) {
if (enabled) {
logger.lifecycle("Maven local is enabled")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dependencies {

kotlin {
jvmToolchain {
(this as JavaToolchainSpec).languageVersion.set(JavaLanguageVersion.of(11))
languageVersion.set(JavaLanguageVersion.of(11))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,41 @@ val signingSecretKeyRingFile: Provider<String> =
providers.gradleProperty("signing.secretKeyRingFile")


val javadocJarStub by tasks.registering(Jar::class) {
group = JavaBasePlugin.DOCUMENTATION_GROUP
description = "Stub javadoc.jar artifact (required by Maven Central)"
archiveClassifier.set("javadoc")
}


tasks.withType<AbstractPublishToMaven>().configureEach {
// Gradle warns about some signing tasks using publishing task outputs without explicit
// dependencies. I'm not going to go through them all and fix them, so here's a quick fix.
dependsOn(tasks.withType<Sign>())

doLast {
logger.lifecycle("[${this.name}] ${project.group}:${project.name}:${project.version}")
}
}


signing {
if (sonatypeRepositoryCredentials.isPresent()) {
dependsOn(javadocJarStub)
if (signingKeyId.isPresent() && signingKey.isPresent() && signingPassword.isPresent()) {
useInMemoryPgpKeys(signingKeyId.get(), signingKey.get(), signingPassword.get())
} else {
useGpgCmd()
}
}
}

doLast {
logger.lifecycle("[${this.name}] ${project.group}:${project.name}:${project.version}")

afterEvaluate {
// Register signatures afterEvaluate, otherwise the signing plugin creates the signing tasks
// too early, before all the publications are added.
// Use .all { }, not .configureEach { }, otherwise the signing plugin doesn't create the tasks
// soon enough.
publishing.publications.withType<MavenPublication>().all {
signing.sign(this)
logger.lifecycle("configuring signature for publication ${this.name}")
}
}

val javadocJarStub = javadocStubTask()

publishing {
if (sonatypeRepositoryCredentials.isPresent()) {
Expand All @@ -65,11 +79,10 @@ publishing {
name = "sonatype"
credentials(sonatypeRepositoryCredentials.get())
}
// publish to local dir, for testing
// maven {
// name = "maven-internal"
// url = uri(rootProject.layout.buildDirectory.dir("maven-internal"))
// }
// // publish to local dir, for testing
// maven(rootProject.layout.buildDirectory.dir("maven-internal")) {
// name = "maven-internal"
// }
}
publications.withType<MavenPublication>().configureEach {
createKxsTsGenPom()
Expand All @@ -79,29 +92,14 @@ publishing {
}


signing {
if (sonatypeRepositoryCredentials.isPresent()) {
if (signingKeyId.isPresent() && signingKey.isPresent() && signingPassword.isPresent()) {
useInMemoryPgpKeys(signingKeyId.get(), signingKey.get(), signingPassword.get())
} else {
useGpgCmd()
}

// sign all publications
sign(publishing.publications)
sign(javadocJarStub.get())
}
}


plugins.withType(KotlinMultiplatformPlugin::class).configureEach {
plugins.withType<KotlinMultiplatformPlugin>().configureEach {
publishing.publications.withType<MavenPublication>().configureEach {
artifact(javadocJarStub)
// artifact(javadocJarStub)
}
}


plugins.withType(JavaPlugin::class).configureEach {
plugins.withType<JavaPlugin>().configureEach {
afterEvaluate {
if (!isKotlinMultiplatformJavaEnabled()) {
publishing.publications.create<MavenPublication>("mavenJava") {
Expand All @@ -113,8 +111,30 @@ plugins.withType(JavaPlugin::class).configureEach {
}


plugins.withType(JavaPlatformPlugin::class).configureEach {
plugins.withType<JavaPlatformPlugin>().configureEach {
// val javadocJarStub = javadocStubTask()
publishing.publications.create<MavenPublication>("mavenJavaPlatform") {
from(components["javaPlatform"])
// artifact(javadocJarStub)
}
}


fun Project.javadocStubTask(): Jar {

// use creating, not registering, because the signing plugin sucks
val javadocJarStub by tasks.creating(Jar::class) {
group = JavaBasePlugin.DOCUMENTATION_GROUP
description = "Stub javadoc.jar artifact (required by Maven Central)"
archiveClassifier.set("javadoc")
}

val signingTasks = signing.sign(javadocJarStub)

tasks.withType<AbstractPublishToMaven>().all {
dependsOn(javadocJarStub)
signingTasks.forEach { dependsOn(it) }
}

return javadocJarStub
}
14 changes: 7 additions & 7 deletions docs/code/test/PolymorphismTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -110,21 +110,21 @@ class PolymorphismTest : FunSpec({
|
|export namespace Project {
| export enum Type {
| OProj = "OProj",
| DeprecatedProject = "dev.adamko.kxstsgen.example.examplePolymorphicSealedClass01.DeprecatedProject",
| }
|
| export interface OProj {
| type: Project.Type.OProj;
| name: string;
| owner: string;
| OProj = "OProj",
| }
|
| export interface DeprecatedProject {
| type: Project.Type.DeprecatedProject;
| name: string;
| reason: string;
| }
|
| export interface OProj {
| type: Project.Type.OProj;
| name: string;
| owner: string;
| }
|}
""".trimMargin()
.normalize()
Expand Down
14 changes: 7 additions & 7 deletions docs/polymorphism.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,21 +169,21 @@ export type Project =

export namespace Project {
export enum Type {
OProj = "OProj",
DeprecatedProject = "dev.adamko.kxstsgen.example.examplePolymorphicSealedClass01.DeprecatedProject",
}

export interface OProj {
type: Project.Type.OProj;
name: string;
owner: string;
OProj = "OProj",
}

export interface DeprecatedProject {
type: Project.Type.DeprecatedProject;
name: string;
reason: string;
}

export interface OProj {
type: Project.Type.OProj;
name: string;
owner: string;
}
}
```

Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ org.gradle.caching=true
org.gradle.unsafe.configuration-cache=true
org.gradle.unsafe.configuration-cache-problems=warn

# https://github.com/gradle/gradle/issues/20416
org.gradle.kotlin.dsl.precompiled.accessors.strict=true
66 changes: 33 additions & 33 deletions gradle/kotlin-js-store/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ chalk@^4.1.0:
ansi-styles "^4.1.0"
supports-color "^7.1.0"

chokidar@3.5.2:
version "3.5.2"
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75"
integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==
chokidar@3.5.3:
version "3.5.3"
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd"
integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==
dependencies:
anymatch "~3.1.2"
braces "~3.0.2"
Expand Down Expand Up @@ -126,10 +126,10 @@ concat-map@0.0.1:
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=

debug@4.3.2:
version "4.3.2"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b"
integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==
debug@4.3.3:
version "4.3.3"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664"
integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==
dependencies:
ms "2.1.2"

Expand Down Expand Up @@ -205,10 +205,10 @@ glob-parent@~5.1.2:
dependencies:
is-glob "^4.0.1"

glob@7.1.7:
version "7.1.7"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90"
integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==
glob@7.2.0:
version "7.2.0"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023"
integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==
dependencies:
fs.realpath "^1.0.0"
inflight "^1.0.4"
Expand Down Expand Up @@ -325,32 +325,32 @@ minimatch@^3.0.4:
dependencies:
brace-expansion "^1.1.7"

mocha@9.1.2:
version "9.1.2"
resolved "https://registry.yarnpkg.com/mocha/-/mocha-9.1.2.tgz#93f53175b0f0dc4014bd2d612218fccfcf3534d3"
integrity sha512-ta3LtJ+63RIBP03VBjMGtSqbe6cWXRejF9SyM9Zyli1CKZJZ+vfCTj3oW24V7wAphMJdpOFLoMI3hjJ1LWbs0w==
mocha@9.2.1:
version "9.2.1"
resolved "https://registry.yarnpkg.com/mocha/-/mocha-9.2.1.tgz#a1abb675aa9a8490798503af57e8782a78f1338e"
integrity sha512-T7uscqjJVS46Pq1XDXyo9Uvey9gd3huT/DD9cYBb4K2Xc/vbKRPUWK067bxDQRK0yIz6Jxk73IrnimvASzBNAQ==
dependencies:
"@ungap/promise-all-settled" "1.1.2"
ansi-colors "4.1.1"
browser-stdout "1.3.1"
chokidar "3.5.2"
debug "4.3.2"
chokidar "3.5.3"
debug "4.3.3"
diff "5.0.0"
escape-string-regexp "4.0.0"
find-up "5.0.0"
glob "7.1.7"
glob "7.2.0"
growl "1.10.5"
he "1.2.0"
js-yaml "4.1.0"
log-symbols "4.1.0"
minimatch "3.0.4"
ms "2.1.3"
nanoid "3.1.25"
nanoid "3.2.0"
serialize-javascript "6.0.0"
strip-json-comments "3.1.1"
supports-color "8.1.1"
which "2.0.2"
workerpool "6.1.5"
workerpool "6.2.0"
yargs "16.2.0"
yargs-parser "20.2.4"
yargs-unparser "2.0.0"
Expand All @@ -365,10 +365,10 @@ ms@2.1.3:
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"
integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==

nanoid@3.1.25:
version "3.1.25"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.25.tgz#09ca32747c0e543f0e1814b7d3793477f9c8e152"
integrity sha512-rdwtIXaXCLFAQbnfqDRnI6jaRHp9fTcYBjtFKE8eezcZ7LuLjhUaQGNeMXf1HmRoCH32CLz6XwX0TtxEOS/A3Q==
nanoid@3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.2.0.tgz#62667522da6673971cca916a6d3eff3f415ff80c"
integrity sha512-fmsZYa9lpn69Ad5eDn7FMcnnSR+8R34W9qJEijxYhTbfOWzr22n1QxCMzXLK+ODyW2973V3Fux959iQoUxzUIA==

normalize-path@^3.0.0, normalize-path@~3.0.0:
version "3.0.0"
Expand Down Expand Up @@ -442,10 +442,10 @@ serialize-javascript@6.0.0:
dependencies:
randombytes "^2.1.0"

source-map-support@0.5.20:
version "0.5.20"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.20.tgz#12166089f8f5e5e8c56926b377633392dd2cb6c9"
integrity sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw==
source-map-support@0.5.21:
version "0.5.21"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f"
integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==
dependencies:
buffer-from "^1.0.0"
source-map "^0.6.0"
Expand Down Expand Up @@ -504,10 +504,10 @@ which@2.0.2:
dependencies:
isexe "^2.0.0"

workerpool@6.1.5:
version "6.1.5"
resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.1.5.tgz#0f7cf076b6215fd7e1da903ff6f22ddd1886b581"
integrity sha512-XdKkCK0Zqc6w3iTxLckiuJ81tiD/o5rBE/m+nXpRCB+/Sq4DqkfXZ/x0jW02DG1tGsfUGXbTJyZDP+eu67haSw==
workerpool@6.2.0:
version "6.2.0"
resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.0.tgz#827d93c9ba23ee2019c3ffaff5c27fccea289e8b"
integrity sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A==

wrap-ansi@^7.0.0:
version "7.0.0"
Expand Down
Loading