Skip to content

Commit

Permalink
Kotlin: Update Services Gradle build files (#5636)
Browse files Browse the repository at this point in the history
Updated gradle build files
  • Loading branch information
scmacdon authored Nov 10, 2023
1 parent 624b65b commit c3edee1
Show file tree
Hide file tree
Showing 26 changed files with 439 additions and 160 deletions.
25 changes: 19 additions & 6 deletions kotlin/services/lex/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm") version "1.7.10"
kotlin("jvm") version "1.9.0"
application
}

Expand All @@ -13,7 +13,7 @@ buildscript {
maven("https://plugins.gradle.org/m2/")
}
dependencies {
classpath("org.jlleitschuh.gradle:ktlint-gradle:10.3.0")
classpath("org.jlleitschuh.gradle:ktlint-gradle:11.5.1")
}
}

Expand All @@ -23,13 +23,26 @@ repositories {
}
apply(plugin = "org.jlleitschuh.gradle.ktlint")
dependencies {
implementation("aws.sdk.kotlin:lexruntimeservice:0.29.1-beta")
implementation("aws.sdk.kotlin:secretsmanager:0.29.1-beta")
implementation("aws.sdk.kotlin:lexruntimeservice:0.33.1-beta")
implementation("aws.sdk.kotlin:secretsmanager:0.33.1-beta")
implementation("aws.smithy.kotlin:http-client-engine-okhttp:0.28.0")
implementation("aws.smithy.kotlin:http-client-engine-crt:0.28.0")
implementation("com.google.code.gson:gson:2.10")
implementation("aws.sdk.kotlin:lexmodelbuildingservice-jvm:0.29.1-beta")
implementation("aws.sdk.kotlin:lexmodelbuildingservice-jvm:0.33.1-beta")
testImplementation("org.junit.jupiter:junit-jupiter:5.9.2")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
}
tasks.withType<KotlinCompile>() {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.jvmTarget = "17"
}

tasks.test {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}

// Define the test source set
testClassesDirs += files("build/classes/kotlin/test")
classpath += files("build/classes/kotlin/main", "build/resources/main")
}
23 changes: 18 additions & 5 deletions kotlin/services/mediaconvert/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm") version "1.7.10"
kotlin("jvm") version "1.9.0"
application
}

Expand All @@ -14,7 +14,7 @@ buildscript {
}

dependencies {
classpath("org.jlleitschuh.gradle:ktlint-gradle:10.3.0")
classpath("org.jlleitschuh.gradle:ktlint-gradle:11.5.1")
}
}

Expand All @@ -24,12 +24,25 @@ repositories {
}
apply(plugin = "org.jlleitschuh.gradle.ktlint")
dependencies {
implementation("aws.sdk.kotlin:mediaconvert:0.30.1-beta")
implementation("aws.sdk.kotlin:secretsmanager:0.30.1-beta")
implementation("aws.sdk.kotlin:mediaconvert:0.33.1-beta")
implementation("aws.sdk.kotlin:secretsmanager:0.33.1-beta")
implementation("aws.smithy.kotlin:http-client-engine-okhttp:0.28.0")
implementation("aws.smithy.kotlin:http-client-engine-crt:0.28.0")
implementation("com.google.code.gson:gson:2.10")
testImplementation("org.junit.jupiter:junit-jupiter:5.9.0")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
}
tasks.withType<KotlinCompile>() {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.jvmTarget = "17"
}

tasks.test {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}

// Define the test source set
testClassesDirs += files("build/classes/kotlin/test")
classpath += files("build/classes/kotlin/main", "build/resources/main")
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ package com.kotlin.mediaconvert

// snippet-start:[mediaconvert.kotlin.createjob.import]
import aws.sdk.kotlin.services.mediaconvert.MediaConvertClient
import aws.sdk.kotlin.services.mediaconvert.endpoints.EndpointProvider
import aws.sdk.kotlin.services.mediaconvert.endpoints.MediaConvertEndpointProvider
import aws.sdk.kotlin.services.mediaconvert.model.AacAudioDescriptionBroadcasterMix
import aws.sdk.kotlin.services.mediaconvert.model.AacCodecProfile
import aws.sdk.kotlin.services.mediaconvert.model.AacCodingMode
Expand Down Expand Up @@ -84,10 +84,10 @@ import aws.sdk.kotlin.services.mediaconvert.model.InputPsiControl
import aws.sdk.kotlin.services.mediaconvert.model.InputRotate
import aws.sdk.kotlin.services.mediaconvert.model.InputTimecodeSource
import aws.sdk.kotlin.services.mediaconvert.model.JobSettings
import aws.sdk.kotlin.services.mediaconvert.model.M3U8NielsenId3
import aws.sdk.kotlin.services.mediaconvert.model.M3U8PcrControl
import aws.sdk.kotlin.services.mediaconvert.model.M3U8Scte35Source
import aws.sdk.kotlin.services.mediaconvert.model.M3U8Settings
import aws.sdk.kotlin.services.mediaconvert.model.M3u8NielsenId3
import aws.sdk.kotlin.services.mediaconvert.model.M3u8PcrControl
import aws.sdk.kotlin.services.mediaconvert.model.M3u8Scte35Source
import aws.sdk.kotlin.services.mediaconvert.model.M3u8Settings
import aws.sdk.kotlin.services.mediaconvert.model.MediaConvertException
import aws.sdk.kotlin.services.mediaconvert.model.Output
import aws.sdk.kotlin.services.mediaconvert.model.OutputGroup
Expand All @@ -114,17 +114,18 @@ including your credentials.
For more information, see the following documentation topic:
https://docs.aws.amazon.com/sdk-for-kotlin/latest/developer-guide/setup.html
In the following example, the output of the job is placed in the same Amazon S3 bucket in a folder named out.
*/

suspend fun main(args: Array<String>) {
val usage = """
Usage
Usage
<mcRoleARN> <fileInput>
Where:
mcRoleARN - the MediaConvert Role ARN.
fileInput - the URL of an Amazon S3 bucket where the input file is located.
fileInput - the URL of an Amazon S3 bucket where the input file is located (for example s3://<bucket name>/<mp4 file name>).
"""

if (args.size != 2) {
Expand All @@ -136,7 +137,7 @@ suspend fun main(args: Array<String>) {
val fileInput = args[1]
val mcClient = MediaConvertClient { region = "us-west-2" }
val id = createMediaJob(mcClient, mcRoleARN, fileInput)
println("MediaConvert job is $id")
println("MediaConvert job $id was successfully created!")
}

// snippet-start:[mediaconvert.kotlin.createjob.main]
Expand All @@ -159,7 +160,7 @@ suspend fun createMediaJob(mcClient: MediaConvertClient, mcRoleARN: String, file
val endpointURL = res.endpoints!!.get(0).url!!
val mediaConvert = MediaConvertClient.fromEnvironment {
region = "us-west-2"
endpointProvider = EndpointProvider {
endpointProvider = MediaConvertEndpointProvider {
Endpoint(endpointURL)
}
}
Expand Down Expand Up @@ -434,17 +435,17 @@ fun createOutput(
}
containerSettings = ContainerSettings {
container = ContainerType.M3U8
this.m3U8Settings = M3U8Settings {
this.m3u8Settings = M3u8Settings {
audioFramesPerPes = 4
pcrControl = M3U8PcrControl.PcrEveryPesPacket
pcrControl = M3u8PcrControl.PcrEveryPesPacket
pmtPid = 480
privateMetadataPid = 503
programNumber = 1
patInterval = 0
pmtInterval = 0
scte35Source = M3U8Scte35Source.None
scte35Source = M3u8Scte35Source.None
scte35Pid = 500
nielsenId3 = M3U8NielsenId3.None
nielsenId3 = M3u8NielsenId3.None
timedMetadata = TimedMetadata.None
timedMetadataPid = 502
videoPid = 481
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// snippet-sourcedescription:[GetJob.kt demonstrates how to get information about a specific AWS Elemental MediaConvert job.]
// snippet-keyword:[AWS SDK for Kotlin]
// snippet-service:[AWS Elemental MediaConvert]

/*
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
Expand All @@ -11,11 +10,11 @@ package com.kotlin.mediaconvert

// snippet-start:[mediaconvert.kotlin.get_job.import]
import aws.sdk.kotlin.services.mediaconvert.MediaConvertClient
import aws.sdk.kotlin.services.mediaconvert.endpoints.EndpointProvider
import aws.smithy.kotlin.runtime.client.endpoints.Endpoint
import aws.sdk.kotlin.services.mediaconvert.endpoints.MediaConvertEndpointProvider
import aws.sdk.kotlin.services.mediaconvert.model.DescribeEndpointsRequest
import aws.sdk.kotlin.services.mediaconvert.model.GetJobRequest
import aws.sdk.kotlin.services.mediaconvert.model.GetJobResponse
import aws.smithy.kotlin.runtime.client.endpoints.Endpoint
import kotlin.system.exitProcess
// snippet-end:[mediaconvert.kotlin.get_job.import]

Expand Down Expand Up @@ -59,7 +58,7 @@ suspend fun getSpecificJob(mcClient: MediaConvertClient, jobId: String?) {
val endpointURL = res.endpoints!!.get(0).url!!
val mediaConvert = MediaConvertClient.fromEnvironment {
region = "us-west-2"
endpointProvider = EndpointProvider {
endpointProvider = MediaConvertEndpointProvider {
Endpoint(endpointURL)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ package com.kotlin.mediaconvert

// snippet-start:[mediaconvert.kotlin.list_jobs.import]
import aws.sdk.kotlin.services.mediaconvert.MediaConvertClient
import aws.sdk.kotlin.services.mediaconvert.endpoints.MediaConvertEndpointProvider
import aws.sdk.kotlin.services.mediaconvert.model.DescribeEndpointsRequest
import aws.sdk.kotlin.services.mediaconvert.model.JobStatus
import aws.sdk.kotlin.services.mediaconvert.model.ListJobsRequest
import aws.smithy.kotlin.runtime.client.endpoints.Endpoint
import aws.smithy.kotlin.runtime.client.endpoints.EndpointProvider
import kotlin.system.exitProcess
// snippet-end:[mediaconvert.kotlin.list_jobs.import]

Expand Down Expand Up @@ -45,7 +45,7 @@ suspend fun listCompleteJobs(mcClient: MediaConvertClient) {
val endpointURL = res.endpoints!![0].url!!
val mediaConvert = MediaConvertClient.fromEnvironment {
region = "us-west-2"
endpointProvider = EndpointProvider {
endpointProvider = MediaConvertEndpointProvider {
Endpoint(endpointURL)
}
}
Expand Down
21 changes: 16 additions & 5 deletions kotlin/services/mediastore/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm") version "1.7.10"
kotlin("jvm") version "1.9.0"
application
}
group = "me.scmacdon"
Expand All @@ -12,20 +12,31 @@ buildscript {
maven("https://plugins.gradle.org/m2/")
}
dependencies {
classpath("org.jlleitschuh.gradle:ktlint-gradle:10.3.0")
classpath("org.jlleitschuh.gradle:ktlint-gradle:11.5.1")
}
}

repositories {
mavenCentral()
jcenter()
}
apply(plugin = "org.jlleitschuh.gradle.ktlint")
dependencies {
implementation("aws.sdk.kotlin:mediastore:0.30.1-beta")
implementation("aws.sdk.kotlin:mediastore:0.33.1-beta")
implementation("aws.smithy.kotlin:http-client-engine-okhttp:0.28.0")
implementation("aws.smithy.kotlin:http-client-engine-crt:0.28.0")
testImplementation("org.junit.jupiter:junit-jupiter:5.9.0")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
}
tasks.withType<KotlinCompile>() {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.jvmTarget = "17"
}
tasks.test {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}

// Define the test source set
testClassesDirs += files("build/classes/kotlin/test")
classpath += files("build/classes/kotlin/main", "build/resources/main")
}
21 changes: 16 additions & 5 deletions kotlin/services/opensearch/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm") version "1.7.10"
kotlin("jvm") version "1.9.0"
application
}

Expand All @@ -13,22 +13,33 @@ buildscript {
maven("https://plugins.gradle.org/m2/")
}
dependencies {
classpath("org.jlleitschuh.gradle:ktlint-gradle:10.3.0")
classpath("org.jlleitschuh.gradle:ktlint-gradle:11.5.1")
}
}

repositories {
mavenCentral()
jcenter()
}
apply(plugin = "org.jlleitschuh.gradle.ktlint")
dependencies {
implementation("aws.sdk.kotlin:opensearch:0.30.1-beta")
implementation("aws.sdk.kotlin:opensearch:0.33.1-beta")
implementation("aws.smithy.kotlin:http-client-engine-okhttp:0.28.0")
implementation("aws.smithy.kotlin:http-client-engine-crt:0.28.0")
testImplementation("org.junit.jupiter:junit-jupiter:5.9.2")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
implementation("com.fasterxml.jackson.core:jackson-databind:2.14.2")
}

tasks.withType<KotlinCompile>() {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.jvmTarget = "17"
}
tasks.test {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}

// Define the test source set
testClassesDirs += files("build/classes/kotlin/test")
classpath += files("build/classes/kotlin/main", "build/resources/main")
}
25 changes: 18 additions & 7 deletions kotlin/services/personalize/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm") version "1.7.10"
kotlin("jvm") version "1.9.0"
application
}

Expand All @@ -13,23 +13,34 @@ buildscript {
maven("https://plugins.gradle.org/m2/")
}
dependencies {
classpath("org.jlleitschuh.gradle:ktlint-gradle:10.3.0")
classpath("org.jlleitschuh.gradle:ktlint-gradle:11.5.1")
}
}

repositories {
mavenCentral()
jcenter()
}
apply(plugin = "org.jlleitschuh.gradle.ktlint")
dependencies {
implementation("aws.sdk.kotlin:personalize:0.30.1-beta")
implementation("aws.sdk.kotlin:secretsmanager:0.30.1-beta")
implementation("aws.sdk.kotlin:personalizeruntime:0.30.1-beta")
implementation("aws.sdk.kotlin:personalize:0.33.1-beta")
implementation("aws.sdk.kotlin:secretsmanager:0.33.1-beta")
implementation("aws.sdk.kotlin:personalizeruntime:0.33.1-beta")
implementation("aws.smithy.kotlin:http-client-engine-okhttp:0.28.0")
implementation("aws.smithy.kotlin:http-client-engine-crt:0.28.0")
implementation("com.google.code.gson:gson:2.10")
testImplementation("org.junit.jupiter:junit-jupiter:5.9.2")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
}
tasks.withType<KotlinCompile>() {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.jvmTarget = "17"
}
tasks.test {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}

// Define the test source set
testClassesDirs += files("build/classes/kotlin/test")
classpath += files("build/classes/kotlin/main", "build/resources/main")
}
Loading

0 comments on commit c3edee1

Please sign in to comment.