- 
                Notifications
    You must be signed in to change notification settings 
- Fork 54
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
          
     Open
      
      
            0marperez
  wants to merge
  17
  commits into
  s3-tm-main
  
    
      
        
          
  
    
      Choose a base branch
      
     
    
      
        
      
      
        
          
          
        
        
          
            
              
              
              
  
           
        
        
          
            
              
              
           
        
       
     
  
        
          
            
          
            
          
        
       
    
      
from
s3-tm-dev
  
      
      
   
  
    
  
  
  
 
  
      
    base: s3-tm-main
Could not load branches
            
              
  
    Branch not found: {{ refName }}
  
            
                
      Loading
              
            Could not load tags
            
            
              Nothing to show
            
              
  
            
                
      Loading
              
            Are you sure you want to change the base?
            Some commits from the old base branch may be removed from the timeline,
            and old review comments may become outdated.
          
          
  
     Open
                    Changes from all commits
      Commits
    
    
            Show all changes
          
          
            17 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      bc2fa0a
              
                feat: s3 transfer manager client
              
              
                0marperez 6895fc3
              
                saving work - upload file
              
              
                0marperez c9486f1
              
                self review
              
              
                0marperez 22243e7
              
                pull from main
              
              
                0marperez dbff057
              
                misc: merge from main
              
              
                0marperez 835866a
              
                finish upload file
              
              
                0marperez 8edf604
              
                provide static dummy credentials to tests
              
              
                0marperez 4137873
              
                add s3 as a test dependency?
              
              
                0marperez d84516d
              
                refactor tests to be JVM only
              
              
                0marperez 9d5ec07
              
                Depend on missing 'DefaultAwsSigner'
              
              
                0marperez 71ea5b7
              
                Merge branch 'main' of github.com:aws/aws-sdk-kotlin into s3-tm-dev
              
              
                0marperez fb2417f
              
                feedback
              
              
                0marperez a193a2f
              
                feedback v2
              
              
                0marperez 010bd4b
              
                add missing KDocs and self review
              
              
                0marperez 8a821d6
              
                remove old TODO
              
              
                0marperez ac6c88e
              
                latest feedback
              
              
                0marperez 32aae24
              
                feedback v3
              
              
                0marperez File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,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" | ||
| 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. Have we decided on a package name yet? I think s3tm would be simpler, cleaner 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. I can go either way, not sure if Ian has an opinion. | ||
|  | ||
| 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 | ||
| } | ||
        
          
  
    
      
          
            59 changes: 59 additions & 0 deletions
          
          59 
        
  ...n/kotlin/aws/sdk/kotlin/hll/s3transfermanager/codegen/S3TransferManagerSymbolProcessor.kt
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or 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,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() | ||
| } | ||
| } | 
        
          
  
    
      
          
            15 changes: 15 additions & 0 deletions
          
          15 
        
  .../aws/sdk/kotlin/hll/s3transfermanager/codegen/S3TransferManagerSymbolProcessorProvider.kt
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or 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,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) | ||
| } | 
        
          
  
    
      
          
            42 changes: 42 additions & 0 deletions
          
          42 
        
  ...gen/src/main/kotlin/aws/sdk/kotlin/hll/s3transfermanager/codegen/mappings/MappingTypes.kt
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or 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,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( | ||
| 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, | ||
| } | 
        
          
  
    
      
          
            12 changes: 12 additions & 0 deletions
          
          12 
        
  ...codegen/src/main/kotlin/aws/sdk/kotlin/hll/s3transfermanager/codegen/mappings/Mappings.kt
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or 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,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 | 
      
      Oops, something went wrong.
        
    
  
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two new features
S3_TRANSFER_UPLOAD_DIRECTORYandS3_TRANSFER_DOWNLOAD_DIRECTORYwe should add here