-
Notifications
You must be signed in to change notification settings - Fork 55
feat: project setup and upload file #1712
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
base: s3-tm-main
Are you sure you want to change the base?
Changes from 16 commits
bc2fa0a
6895fc3
c9486f1
22243e7
dbff057
835866a
8edf604
4137873
d84516d
9d5ec07
71ea5b7
fb2417f
a193a2f
010bd4b
8a821d6
ac6c88e
32aae24
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -112,6 +112,8 @@ val projectsToIgnore = listOf( | |
| "dynamodb-mapper-ops-codegen", | ||
| "dynamodb-mapper-schema-codegen", | ||
| "dynamodb-mapper-schema-generator-plugin-test", | ||
|
|
||
| "s3-transfer-manager-codegen", // TODO: Disable publishing ? | ||
|
Comment on lines
+115
to
+116
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Comment: 👍 Yes, this is in the right place. We don't want to publish this since we have no use case for it right now. We can scratch the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't disable publication right? Just API validation and docgen |
||
| ).filter { it in subprojects.map { it.name }.toSet() } // Some projects may not be in the build depending on bootstrapping | ||
|
|
||
| apiValidation { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,12 @@ | ||
| /* | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| import org.gradle.kotlin.dsl.withType | ||
| import org.jetbrains.kotlin.gradle.dsl.JvmTarget | ||
| import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
|
||
| /* | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
|
|
@@ -48,3 +57,14 @@ publishing { | |
| } | ||
| } | ||
| } | ||
|
|
||
| java { | ||
| sourceCompatibility = JavaVersion.VERSION_1_8 | ||
| targetCompatibility = JavaVersion.VERSION_1_8 | ||
| } | ||
|
|
||
| tasks.withType<KotlinCompile> { | ||
| compilerOptions { | ||
| jvmTarget.set(JvmTarget.JVM_1_8) | ||
| } | ||
| } | ||
|
Comment on lines
+60
to
+70
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Question: Why are these additions necessary? |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,6 +23,7 @@ public data class Member( | |
| val type: Type, | ||
| val mutable: Boolean = false, | ||
| val attributes: Attributes = emptyAttributes(), | ||
| val kDocs: String? = null, | ||
| ) { | ||
| @InternalSdkApi | ||
|
Comment on lines
24
to
28
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Comment: Great job adding KDocs support. Makes it easier for me to fix #1595! |
||
| public companion object { | ||
|
|
@@ -34,6 +35,7 @@ public data class Member( | |
| name = prop.simpleName.getShortName(), | ||
| type = Type.from(prop.type), | ||
| mutable = prop.isMutable, | ||
| kDocs = prop.docString, | ||
| ) | ||
|
|
||
| return ModelParsingPlugin.transform(member, ModelParsingPlugin::postProcessMember) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| /* | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| import org.gradle.kotlin.dsl.withType | ||
| import org.jetbrains.kotlin.gradle.dsl.JvmTarget | ||
| import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
|
||
| val sdkVersion: String by project | ||
| version = sdkVersion | ||
|
|
||
| description = "S3 Transfer Manager Code Generation" | ||
| extra["displayName"] = "AWS :: SDK :: Kotlin :: HLL :: S3 Transfer Manager Codegen" | ||
| extra["moduleName"] = "aws.sdk.kotlin.hll.s3transfermanager.codegen" | ||
0marperez marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| plugins { | ||
| id(libs.plugins.kotlin.jvm.get().pluginId) | ||
| } | ||
|
|
||
| dependencies { | ||
| implementation(libs.ksp.api) | ||
| implementation(project(":hll:hll-codegen")) | ||
| implementation(project(":services:s3")) | ||
| } | ||
|
|
||
| kotlin { | ||
| explicitApi() | ||
| sourceSets.all { | ||
| listOf( | ||
| "aws.smithy.kotlin.runtime.InternalApi", | ||
| "aws.sdk.kotlin.runtime.InternalSdkApi", | ||
| "kotlin.RequiresOptIn", | ||
| ).forEach(languageSettings::optIn) | ||
| } | ||
| } | ||
|
|
||
| tasks.withType<KotlinCompile> { | ||
| compilerOptions { | ||
| jvmTarget.set(JvmTarget.JVM_1_8) | ||
| freeCompilerArgs.add("-Xjdk-release=1.8") | ||
| freeCompilerArgs.add("-opt-in=kotlin.RequiresOptIn") | ||
| } | ||
| } | ||
|
|
||
| java { | ||
| sourceCompatibility = JavaVersion.VERSION_1_8 | ||
| targetCompatibility = JavaVersion.VERSION_1_8 | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| /* | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| package aws.sdk.kotlin.hll.s3transfermanager.codegen | ||
|
|
||
| import aws.sdk.kotlin.hll.codegen.core.CodeGeneratorFactory | ||
| import aws.sdk.kotlin.hll.codegen.ksp.processors.HllKspProcessor | ||
| import aws.sdk.kotlin.hll.codegen.rendering.RenderContext | ||
| import aws.sdk.kotlin.hll.s3transfermanager.codegen.mappings.conversionMappings | ||
| import aws.sdk.kotlin.hll.s3transfermanager.codegen.mappings.ioMappings | ||
| import aws.sdk.kotlin.hll.s3transfermanager.codegen.renderers.ConversionRenderer | ||
| import aws.sdk.kotlin.hll.s3transfermanager.codegen.renderers.IORenderer | ||
| import com.google.devtools.ksp.processing.Resolver | ||
| import com.google.devtools.ksp.processing.SymbolProcessorEnvironment | ||
| import com.google.devtools.ksp.symbol.KSAnnotated | ||
|
|
||
| internal class S3TransferManagerSymbolProcessor(environment: SymbolProcessorEnvironment) : HllKspProcessor(environment) { | ||
| val rendererName = "s3-transfer-manager-code-generator" | ||
| val codeGenerator = environment.codeGenerator | ||
| val logger = environment.logger | ||
|
|
||
| override fun processImpl(resolver: Resolver): List<KSAnnotated> { | ||
| val ioMappingsContext = | ||
| RenderContext( | ||
| logger, | ||
| CodeGeneratorFactory(codeGenerator, logger), | ||
| "aws.sdk.kotlin.hll.s3transfermanager.model", | ||
| rendererName, | ||
| ) | ||
|
|
||
| ioMappings.forEach { mapping -> | ||
| IORenderer( | ||
| ioMappingsContext, | ||
| mapping.className, | ||
| mapping, | ||
| resolver, | ||
| ).render() | ||
| } | ||
|
|
||
| val conversionMappingsContext = | ||
| RenderContext( | ||
| logger, | ||
| CodeGeneratorFactory(codeGenerator, logger), | ||
| "aws.sdk.kotlin.hll.s3transfermanager.model.utils", | ||
| rendererName, | ||
| ) | ||
|
|
||
| ConversionRenderer( | ||
| conversionMappingsContext, | ||
| "Converters", | ||
| conversionMappings, | ||
| resolver, | ||
| ).render() | ||
|
|
||
| return listOf() | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| /* | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| package aws.sdk.kotlin.hll.s3transfermanager.codegen | ||
|
|
||
| import com.google.devtools.ksp.processing.SymbolProcessor | ||
| import com.google.devtools.ksp.processing.SymbolProcessorEnvironment | ||
| import com.google.devtools.ksp.processing.SymbolProcessorProvider | ||
|
|
||
| public class S3TransferManagerSymbolProcessorProvider : SymbolProcessorProvider { | ||
| override fun create(environment: SymbolProcessorEnvironment): SymbolProcessor = | ||
| S3TransferManagerSymbolProcessor(environment) | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| /* | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| package aws.sdk.kotlin.hll.s3transfermanager.codegen.mappings | ||
|
|
||
| import aws.sdk.kotlin.hll.codegen.model.TypeRef | ||
|
|
||
| /** | ||
| * Converts one type to another | ||
| */ | ||
| internal data class ConversionMapping( | ||
| val source: TypeRef, | ||
| val destination: TypeRef, | ||
| val members: Set<String>, | ||
| val additionalImports: List<TypeRef> = emptyList(), | ||
| val additionalParameters: List<String> = emptyList(), | ||
| val additionalLogic: String = "", | ||
| ) | ||
|
|
||
| /** | ||
| * High level S3 TM request/response from low level S3 operation members | ||
| */ | ||
| internal data class IOMapping( | ||
0marperez marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| val type: MappingType, | ||
| val className: String, | ||
| val sourceOperation: String, | ||
| val members: Set<String>, | ||
| ) | ||
|
|
||
| internal enum class MappingType { | ||
| /** | ||
| * Maps high level operation request members to low level request members | ||
| */ | ||
| REQUEST, | ||
|
|
||
| /** | ||
| * Maps high level operation response members to low level response members | ||
| */ | ||
| RESPONSE, | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| /* | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| package aws.sdk.kotlin.hll.s3transfermanager.codegen.mappings | ||
|
|
||
| import aws.sdk.kotlin.hll.s3transfermanager.codegen.mappings.uploadfile.uploadFileConversions | ||
| import aws.sdk.kotlin.hll.s3transfermanager.codegen.mappings.uploadfile.uploadFileIOMappings | ||
|
|
||
| internal val ioMappings = uploadFileIOMappings | ||
| internal val conversionMappings = uploadFileConversions |
Uh oh!
There was an error while loading. Please reload this page.