-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix codestart for kotlin serialization
- Loading branch information
Showing
7 changed files
with
363 additions
and
0 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
...resources/codestarts/quarkus/buildtool/gradle-kotlin-dsl/kotlin/build.tpl.qute.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
...tarts/src/main/resources/codestarts/quarkus/buildtool/gradle/kotlin/build.tpl.qute.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
...rc/test/java/io/quarkus/devtools/codestarts/quarkus/KotlinSerializationCodestartTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package io.quarkus.devtools.codestarts.quarkus; | ||
|
||
import static io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartCatalog.Language.KOTLIN; | ||
import static io.quarkus.devtools.testing.SnapshotTesting.checkContains; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.devtools.project.BuildTool; | ||
import io.quarkus.devtools.testing.codestarts.QuarkusCodestartTest; | ||
import io.quarkus.maven.dependency.ArtifactKey; | ||
|
||
public class KotlinSerializationCodestartTest { | ||
@RegisterExtension | ||
public static QuarkusCodestartTest codestartMavenTest = QuarkusCodestartTest.builder() | ||
.extension(ArtifactKey.fromString("io.quarkus:quarkus-resteasy-reactive-kotlin-serialization")) | ||
.languages(KOTLIN) | ||
.buildTool(BuildTool.MAVEN) | ||
.build(); | ||
|
||
@RegisterExtension | ||
public static QuarkusCodestartTest codestartGradleTest = QuarkusCodestartTest.builder() | ||
.extension(ArtifactKey.fromString("io.quarkus:quarkus-resteasy-reactive-kotlin-serialization")) | ||
.languages(KOTLIN) | ||
.buildTool(BuildTool.GRADLE) | ||
.build(); | ||
|
||
@RegisterExtension | ||
public static QuarkusCodestartTest codestartGradleKotlinTest = QuarkusCodestartTest.builder() | ||
.extension(ArtifactKey.fromString("io.quarkus:quarkus-resteasy-reactive-kotlin-serialization")) | ||
.languages(KOTLIN) | ||
.buildTool(BuildTool.GRADLE_KOTLIN_DSL) | ||
.build(); | ||
|
||
@Test | ||
void testMavenContent() throws Throwable { | ||
codestartMavenTest.assertThatGeneratedFileMatchSnapshot(KOTLIN, "pom.xml") | ||
.satisfies(checkContains("<plugin>kotlinx-serialization</plugin>")) | ||
.satisfies(checkContains("<artifactId>kotlin-maven-serialization</artifactId>")); | ||
} | ||
|
||
@Test | ||
void testGradleContent() throws Throwable { | ||
codestartGradleTest.assertThatGeneratedFileMatchSnapshot(KOTLIN, "build.gradle") | ||
.satisfies(checkContains("id 'org.jetbrains.kotlin.plugin.serialization' version ")); | ||
} | ||
|
||
@Test | ||
void testGradleKotlinContent() throws Throwable { | ||
codestartGradleKotlinTest.assertThatGeneratedFileMatchSnapshot(KOTLIN, "build.gradle.kts") | ||
.satisfies(checkContains("kotlin(\"plugin.serialization\") version ")); | ||
} | ||
|
||
@Test | ||
void buildAllProjectsMaven() throws Throwable { | ||
codestartMavenTest.buildAllProjects(); | ||
} | ||
|
||
@Test | ||
void buildAllProjectsGradle() throws Throwable { | ||
codestartGradleTest.buildAllProjects(); | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
...t/resources/__snapshots__/KotlinSerializationCodestartTest/testGradleContent/build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
plugins { | ||
id 'org.jetbrains.kotlin.jvm' version "1.4.28-MOCK" | ||
id "org.jetbrains.kotlin.plugin.allopen" version "1.4.28-MOCK" | ||
id 'org.jetbrains.kotlin.plugin.serialization' version "1.4.28-MOCK" | ||
id 'io.quarkus' | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
mavenLocal() | ||
} | ||
|
||
dependencies { | ||
implementation enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}") | ||
implementation 'io.quarkus:quarkus-resteasy-reactive-kotlin-serialization' | ||
implementation 'io.quarkus:quarkus-kotlin' | ||
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8' | ||
implementation 'io.quarkus:quarkus-arc' | ||
implementation 'io.quarkus:quarkus-resteasy-reactive' | ||
testImplementation 'io.quarkus:quarkus-junit5' | ||
testImplementation 'io.rest-assured:rest-assured' | ||
} | ||
|
||
group 'org.test' | ||
version '1.0.0-codestart' | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_11 | ||
targetCompatibility = JavaVersion.VERSION_11 | ||
} | ||
|
||
test { | ||
systemProperty "java.util.logging.manager", "org.jboss.logmanager.LogManager" | ||
} | ||
allOpen { | ||
annotation("jakarta.ws.rs.Path") | ||
annotation("jakarta.enterprise.context.ApplicationScoped") | ||
annotation("io.quarkus.test.junit.QuarkusTest") | ||
} | ||
|
||
compileKotlin { | ||
kotlinOptions.jvmTarget = JavaVersion.VERSION_11 | ||
kotlinOptions.javaParameters = true | ||
} | ||
|
||
compileTestKotlin { | ||
kotlinOptions.jvmTarget = JavaVersion.VERSION_11 | ||
} |
48 changes: 48 additions & 0 deletions
48
...s/__snapshots__/KotlinSerializationCodestartTest/testGradleKotlinContent/build.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
plugins { | ||
kotlin("jvm") version "1.4.28-MOCK" | ||
kotlin("plugin.allopen") version "1.4.28-MOCK" | ||
kotlin("plugin.serialization") version "1.4.28-MOCK" | ||
id("io.quarkus") | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
mavenLocal() | ||
} | ||
|
||
val quarkusPlatformGroupId: String by project | ||
val quarkusPlatformArtifactId: String by project | ||
val quarkusPlatformVersion: String by project | ||
|
||
dependencies { | ||
implementation(enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}")) | ||
implementation("io.quarkus:quarkus-resteasy-reactive-kotlin-serialization") | ||
implementation("io.quarkus:quarkus-kotlin") | ||
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") | ||
implementation("io.quarkus:quarkus-arc") | ||
implementation("io.quarkus:quarkus-resteasy-reactive") | ||
testImplementation("io.quarkus:quarkus-junit5") | ||
testImplementation("io.rest-assured:rest-assured") | ||
} | ||
|
||
group = "org.test" | ||
version = "1.0.0-codestart" | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_11 | ||
targetCompatibility = JavaVersion.VERSION_11 | ||
} | ||
|
||
tasks.withType<Test> { | ||
systemProperty("java.util.logging.manager", "org.jboss.logmanager.LogManager") | ||
} | ||
allOpen { | ||
annotation("jakarta.ws.rs.Path") | ||
annotation("jakarta.enterprise.context.ApplicationScoped") | ||
annotation("io.quarkus.test.junit.QuarkusTest") | ||
} | ||
|
||
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> { | ||
kotlinOptions.jvmTarget = JavaVersion.VERSION_11.toString() | ||
kotlinOptions.javaParameters = true | ||
} |
Oops, something went wrong.