smithy-rs/codegen-server/build.gradle.kts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

95 lines
2.6 KiB
Plaintext
Raw Normal View History

[POC] Basic server type serde for RestJson1 (#737) * Initial implementation of RestJson and Http ser/de Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Visitor render operation shapes from server generators Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Use a symlink for the ebs test model * Revert "Use a symlink for the ebs test model" This reverts commit 0c2adcbf12f452959252134b7fbb9c70dab154c7. * Now the model is emitted in different files * A little more general model generation Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Use a very simple model to try the service generators * Move serializer in its own folder * Initial implementation of RestJson and Http ser/de Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Visitor render operation shapes from server generators Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Use a symlink for the ebs test model * Revert "Use a symlink for the ebs test model" This reverts commit 0c2adcbf12f452959252134b7fbb9c70dab154c7. * Now the model is emitted in different files * A little more general model generation Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Use a very simple model to try the service generators * Move serializer in its own folder * Refactor RestJson to accomodate upstream changes * Refactor a little RestJson1 and add simple RFC doc * Remove inheritance from Json ser/de and refactor codegen visitor to directly use the rendering functions * Make operation.rs module public * Use the protocol ID instead of its string representation Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com>
2021-10-06 01:05:00 +08:00
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
[POC] Basic server type serde for RestJson1 (#737) * Initial implementation of RestJson and Http ser/de Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Visitor render operation shapes from server generators Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Use a symlink for the ebs test model * Revert "Use a symlink for the ebs test model" This reverts commit 0c2adcbf12f452959252134b7fbb9c70dab154c7. * Now the model is emitted in different files * A little more general model generation Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Use a very simple model to try the service generators * Move serializer in its own folder * Initial implementation of RestJson and Http ser/de Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Visitor render operation shapes from server generators Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Use a symlink for the ebs test model * Revert "Use a symlink for the ebs test model" This reverts commit 0c2adcbf12f452959252134b7fbb9c70dab154c7. * Now the model is emitted in different files * A little more general model generation Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Use a very simple model to try the service generators * Move serializer in its own folder * Refactor RestJson to accomodate upstream changes * Refactor a little RestJson1 and add simple RFC doc * Remove inheritance from Json ser/de and refactor codegen visitor to directly use the rendering functions * Make operation.rs module public * Use the protocol ID instead of its string representation Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com>
2021-10-06 01:05:00 +08:00
*/
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
[POC] Basic server type serde for RestJson1 (#737) * Initial implementation of RestJson and Http ser/de Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Visitor render operation shapes from server generators Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Use a symlink for the ebs test model * Revert "Use a symlink for the ebs test model" This reverts commit 0c2adcbf12f452959252134b7fbb9c70dab154c7. * Now the model is emitted in different files * A little more general model generation Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Use a very simple model to try the service generators * Move serializer in its own folder * Initial implementation of RestJson and Http ser/de Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Visitor render operation shapes from server generators Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Use a symlink for the ebs test model * Revert "Use a symlink for the ebs test model" This reverts commit 0c2adcbf12f452959252134b7fbb9c70dab154c7. * Now the model is emitted in different files * A little more general model generation Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Use a very simple model to try the service generators * Move serializer in its own folder * Refactor RestJson to accomodate upstream changes * Refactor a little RestJson1 and add simple RFC doc * Remove inheritance from Json ser/de and refactor codegen visitor to directly use the rendering functions * Make operation.rs module public * Use the protocol ID instead of its string representation Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com>
2021-10-06 01:05:00 +08:00
plugins {
kotlin("jvm")
`maven-publish`
}
description = "Generates Rust server-side code from Smithy models"
extra["displayName"] = "Smithy :: Rust :: Codegen :: Server"
extra["moduleName"] = "software.amazon.smithy.rust.codegen.server"
group = "software.amazon.smithy.rust.codegen.server.smithy"
version = "0.1.0"
val smithyVersion: String by project
dependencies {
implementation(project(":codegen-core"))
[POC] Basic server type serde for RestJson1 (#737) * Initial implementation of RestJson and Http ser/de Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Visitor render operation shapes from server generators Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Use a symlink for the ebs test model * Revert "Use a symlink for the ebs test model" This reverts commit 0c2adcbf12f452959252134b7fbb9c70dab154c7. * Now the model is emitted in different files * A little more general model generation Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Use a very simple model to try the service generators * Move serializer in its own folder * Initial implementation of RestJson and Http ser/de Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Visitor render operation shapes from server generators Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Use a symlink for the ebs test model * Revert "Use a symlink for the ebs test model" This reverts commit 0c2adcbf12f452959252134b7fbb9c70dab154c7. * Now the model is emitted in different files * A little more general model generation Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Use a very simple model to try the service generators * Move serializer in its own folder * Refactor RestJson to accomodate upstream changes * Refactor a little RestJson1 and add simple RFC doc * Remove inheritance from Json ser/de and refactor codegen visitor to directly use the rendering functions * Make operation.rs module public * Use the protocol ID instead of its string representation Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com>
2021-10-06 01:05:00 +08:00
implementation("software.amazon.smithy:smithy-aws-traits:$smithyVersion")
implementation("software.amazon.smithy:smithy-protocol-test-traits:$smithyVersion")
// `smithy.framework#ValidationException` is defined here, which is used in `constraints.smithy`, which is used
// in `CustomValidationExceptionWithReasonDecoratorTest`.
testImplementation("software.amazon.smithy:smithy-validation-model:$smithyVersion")
[POC] Basic server type serde for RestJson1 (#737) * Initial implementation of RestJson and Http ser/de Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Visitor render operation shapes from server generators Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Use a symlink for the ebs test model * Revert "Use a symlink for the ebs test model" This reverts commit 0c2adcbf12f452959252134b7fbb9c70dab154c7. * Now the model is emitted in different files * A little more general model generation Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Use a very simple model to try the service generators * Move serializer in its own folder * Initial implementation of RestJson and Http ser/de Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Visitor render operation shapes from server generators Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Use a symlink for the ebs test model * Revert "Use a symlink for the ebs test model" This reverts commit 0c2adcbf12f452959252134b7fbb9c70dab154c7. * Now the model is emitted in different files * A little more general model generation Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Use a very simple model to try the service generators * Move serializer in its own folder * Refactor RestJson to accomodate upstream changes * Refactor a little RestJson1 and add simple RFC doc * Remove inheritance from Json ser/de and refactor codegen visitor to directly use the rendering functions * Make operation.rs module public * Use the protocol ID instead of its string representation Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com>
2021-10-06 01:05:00 +08:00
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
tasks.compileKotlin { kotlinOptions.jvmTarget = "11" }
[POC] Basic server type serde for RestJson1 (#737) * Initial implementation of RestJson and Http ser/de Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Visitor render operation shapes from server generators Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Use a symlink for the ebs test model * Revert "Use a symlink for the ebs test model" This reverts commit 0c2adcbf12f452959252134b7fbb9c70dab154c7. * Now the model is emitted in different files * A little more general model generation Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Use a very simple model to try the service generators * Move serializer in its own folder * Initial implementation of RestJson and Http ser/de Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Visitor render operation shapes from server generators Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Use a symlink for the ebs test model * Revert "Use a symlink for the ebs test model" This reverts commit 0c2adcbf12f452959252134b7fbb9c70dab154c7. * Now the model is emitted in different files * A little more general model generation Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Use a very simple model to try the service generators * Move serializer in its own folder * Refactor RestJson to accomodate upstream changes * Refactor a little RestJson1 and add simple RFC doc * Remove inheritance from Json ser/de and refactor codegen visitor to directly use the rendering functions * Make operation.rs module public * Use the protocol ID instead of its string representation Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com>
2021-10-06 01:05:00 +08:00
// Reusable license copySpec
val licenseSpec = copySpec {
from("${project.rootDir}/LICENSE")
from("${project.rootDir}/NOTICE")
}
// Configure jars to include license related info
tasks.jar {
metaInf.with(licenseSpec)
inputs.property("moduleName", project.name)
manifest { attributes["Automatic-Module-Name"] = project.name }
}
val sourcesJar by tasks.creating(Jar::class) {
group = "publishing"
description = "Assembles Kotlin sources jar"
archiveClassifier.set("sources")
[POC] Basic server type serde for RestJson1 (#737) * Initial implementation of RestJson and Http ser/de Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Visitor render operation shapes from server generators Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Use a symlink for the ebs test model * Revert "Use a symlink for the ebs test model" This reverts commit 0c2adcbf12f452959252134b7fbb9c70dab154c7. * Now the model is emitted in different files * A little more general model generation Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Use a very simple model to try the service generators * Move serializer in its own folder * Initial implementation of RestJson and Http ser/de Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Visitor render operation shapes from server generators Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Use a symlink for the ebs test model * Revert "Use a symlink for the ebs test model" This reverts commit 0c2adcbf12f452959252134b7fbb9c70dab154c7. * Now the model is emitted in different files * A little more general model generation Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Use a very simple model to try the service generators * Move serializer in its own folder * Refactor RestJson to accomodate upstream changes * Refactor a little RestJson1 and add simple RFC doc * Remove inheritance from Json ser/de and refactor codegen visitor to directly use the rendering functions * Make operation.rs module public * Use the protocol ID instead of its string representation Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com>
2021-10-06 01:05:00 +08:00
from(sourceSets.getByName("main").allSource)
}
val isTestingEnabled: String by project
if (isTestingEnabled.toBoolean()) {
val kotestVersion: String by project
dependencies {
testImplementation("org.junit.jupiter:junit-jupiter:5.6.1")
testImplementation("io.kotest:kotest-assertions-core-jvm:$kotestVersion")
}
tasks.compileTestKotlin { kotlinOptions.jvmTarget = "11" }
tasks.test {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
exceptionFormat = TestExceptionFormat.FULL
showCauses = true
showExceptions = true
showStackTraces = true
showStandardStreams = true
}
[POC] Basic server type serde for RestJson1 (#737) * Initial implementation of RestJson and Http ser/de Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Visitor render operation shapes from server generators Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Use a symlink for the ebs test model * Revert "Use a symlink for the ebs test model" This reverts commit 0c2adcbf12f452959252134b7fbb9c70dab154c7. * Now the model is emitted in different files * A little more general model generation Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Use a very simple model to try the service generators * Move serializer in its own folder * Initial implementation of RestJson and Http ser/de Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Visitor render operation shapes from server generators Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Use a symlink for the ebs test model * Revert "Use a symlink for the ebs test model" This reverts commit 0c2adcbf12f452959252134b7fbb9c70dab154c7. * Now the model is emitted in different files * A little more general model generation Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Use a very simple model to try the service generators * Move serializer in its own folder * Refactor RestJson to accomodate upstream changes * Refactor a little RestJson1 and add simple RFC doc * Remove inheritance from Json ser/de and refactor codegen visitor to directly use the rendering functions * Make operation.rs module public * Use the protocol ID instead of its string representation Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com>
2021-10-06 01:05:00 +08:00
}
}
publishing {
publications {
create<MavenPublication>("default") {
from(components["java"])
artifact(sourcesJar)
}
}
repositories { maven { url = uri(layout.buildDirectory.dir("repository")) } }
[POC] Basic server type serde for RestJson1 (#737) * Initial implementation of RestJson and Http ser/de Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Visitor render operation shapes from server generators Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Use a symlink for the ebs test model * Revert "Use a symlink for the ebs test model" This reverts commit 0c2adcbf12f452959252134b7fbb9c70dab154c7. * Now the model is emitted in different files * A little more general model generation Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Use a very simple model to try the service generators * Move serializer in its own folder * Initial implementation of RestJson and Http ser/de Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Visitor render operation shapes from server generators Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Use a symlink for the ebs test model * Revert "Use a symlink for the ebs test model" This reverts commit 0c2adcbf12f452959252134b7fbb9c70dab154c7. * Now the model is emitted in different files * A little more general model generation Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com> * Use a very simple model to try the service generators * Move serializer in its own folder * Refactor RestJson to accomodate upstream changes * Refactor a little RestJson1 and add simple RFC doc * Remove inheritance from Json ser/de and refactor codegen visitor to directly use the rendering functions * Make operation.rs module public * Use the protocol ID instead of its string representation Signed-off-by: Bigo <1781140+crisidev@users.noreply.github.com>
2021-10-06 01:05:00 +08:00
}