diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..70cd5dc0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,27 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up JDK + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'corretto' + + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + + - name: Execute Gradle build + run: ./gradlew clean build publish diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..97aa3729 --- /dev/null +++ b/.gitignore @@ -0,0 +1,32 @@ +# Eclipse +.classpath +.project +.settings/ + +# Intellij +.idea/ +*.iml +*.iws + +# Fleet +.fleet/ + +# VSCode +bin/ + +# Mac +.DS_Store + +# Maven +target/ +**/dependency-reduced-pom.xml + +# Gradle +**/.gradle +build/ +*/out/ +*/*/out/ +/wrapper + +# Smithy +.smithy.lsp.log diff --git a/.scripts/list_services b/.scripts/list_services new file mode 100755 index 00000000..5cae1076 --- /dev/null +++ b/.scripts/list_services @@ -0,0 +1,31 @@ +#!/bin/bash + + +# a script for listing out all services within a directory, and assumes a service will contain a `service/` directory. +# Was used to generate the initial version properties for all services by piping the output into update_versions: +# > .scripts/list_services . | xargs .scripts/update_versions -p gradle.properties -s + +# Check if directory is provided +if [ $# -ne 1 ]; then + echo "usage: $0 " >&2 + exit 1 +fi + +SCAN_DIR="$1" + +# Check if the directory exists +if [ ! -d "$SCAN_DIR" ]; then + echo "$0: $SCAN_DIR: No such directory" >&2 + exit 1 +fi + +# Change to the target directory +cd "$SCAN_DIR" || exit 1 + +# Iterate through all directories, find those with service subdirectory, +# and sort the output +for dir in */; do + if [ -d "${dir}service" ]; then + echo "${dir%/}" + fi +done | sort diff --git a/.scripts/update_versions b/.scripts/update_versions new file mode 100755 index 00000000..491405de --- /dev/null +++ b/.scripts/update_versions @@ -0,0 +1,87 @@ +#!/usr/bin/env python3 + +import argparse +import logging +from pathlib import Path +from typing import Set + +DEFAULT_VERSION = "1.0.0" + +logger = logging.getLogger(__name__) +logging.basicConfig( + level=logging.INFO, + format="%(asctime)s.%(msecs)03d - %(levelname)s - %(message)s", + datefmt="%Y-%m-%dT%H:%M:%S", +) + + +def main(properties_file: Path, projects: Set[str]): + if not properties_file.is_file(): + raise ValueError(f"Properties file {properties_file} does not exist") + + properties = read_properties(properties_file) + + for project in sorted(projects): + project_key = f"model.{project}.version" + if project_key not in properties: + logger.info( + f"Project ({project_key}) not found in properties file, setting to ({DEFAULT_VERSION})" + ) + properties[project_key] = DEFAULT_VERSION + else: + version = properties[project_key] + major, minor, patch = version.split(".") + patch = int(patch) + 1 + properties[project_key] = f"{major}.{minor}.{patch}" + logger.info( + f"Updated version for ({project_key}) to ({properties[project_key]})" + ) + properties[project_key] = properties[project_key] + write_properties(properties_file, properties) + + +def read_properties(properties_file: Path) -> dict: + lines = properties_file.read_text().split() + # read each line, if it is empty, skip it + properties = {} + for line in lines: + if line.isspace(): + continue + # split the line on the first '=' + key, value = line.split("=", 1) + properties[key.strip()] = value.strip() + return properties + + +def write_properties(properties_file: Path, properties: dict): + properties_text = "\n".join([f"{key}={value}" for key, value in properties.items()]) + properties_file.write_text(properties_text) + + +if __name__ == "__main__": + parser = argparse.ArgumentParser( + description="Update versions of service model packages controlled via gradle.properties" + ) + + parser.add_argument( + "--properties", + "-p", + dest="properties", + type=Path, + required=True, + help="The gradle.properties file that contains the versions.", + ) + + parser.add_argument( + "--services", + "-s", + dest="services", + type=str, + nargs="+", + required=True, + help="A list of projects to update the versions of.", + ) + + args = parser.parse_args() + + main(args.properties, set(args.services)) diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 00000000..8b116a80 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,29 @@ +plugins { + `java-platform` + `maven-publish` + alias(libs.plugins.jreleaser) + id("api-models-aws.publishing-conventions") +} + +subprojects { + afterEvaluate { + apply { + plugin("api-models-aws.model-conventions") + } + } +} + +// Configuration for the "all" package (which depends on all the subprojects) +dependencies { + constraints { + subprojects.forEach { + api(it) + } + } +} + +tasks { + build { + mustRunAfter(clean) + } +} diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts new file mode 100644 index 00000000..f666ffb8 --- /dev/null +++ b/buildSrc/build.gradle.kts @@ -0,0 +1,16 @@ +plugins { + `kotlin-dsl` +} + +repositories { + mavenCentral() + gradlePluginPortal() +} + +dependencies { + implementation(libs.smithy.gradle.base) + implementation(libs.smithy.gradle.jar) + + // https://github.com/gradle/gradle/issues/15383 + implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location)) +} \ No newline at end of file diff --git a/buildSrc/gradle.properties b/buildSrc/gradle.properties new file mode 100644 index 00000000..df8dac03 --- /dev/null +++ b/buildSrc/gradle.properties @@ -0,0 +1,2 @@ +org.gradle.parallel=true +org.gradle.jvmargs='-Dfile.encoding=UTF-8' \ No newline at end of file diff --git a/buildSrc/settings.gradle.kts b/buildSrc/settings.gradle.kts new file mode 100644 index 00000000..aed23a4e --- /dev/null +++ b/buildSrc/settings.gradle.kts @@ -0,0 +1,8 @@ +// Ensure version library is available to buildSrc plugins +dependencyResolutionManagement { + versionCatalogs { + create("libs") { + from(files("../gradle/libs.versions.toml")) + } + } +} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/api-models-aws.model-conventions.gradle.kts b/buildSrc/src/main/kotlin/api-models-aws.model-conventions.gradle.kts new file mode 100644 index 00000000..e65cf91c --- /dev/null +++ b/buildSrc/src/main/kotlin/api-models-aws.model-conventions.gradle.kts @@ -0,0 +1,46 @@ +plugins { + `java-library` + id("software.amazon.smithy.gradle.smithy-jar") + id("api-models-aws.publishing-conventions") +} + +repositories { + mavenLocal() + mavenCentral() +} + +//// Workaround per: https://github.com/gradle/gradle/issues/15383 +val Project.libs get() = the() + +dependencies { + implementation(libs.smithy.aws.cloudformation.traits) + implementation(libs.smithy.aws.endpoints) + implementation(libs.smithy.aws.iam.traits) + implementation(libs.smithy.aws.smoke.test.model) + implementation(libs.smithy.aws.traits) + implementation(libs.smithy.protocol.traits) + implementation(libs.smithy.model) + implementation(libs.smithy.rules.engine) + implementation(libs.smithy.smoke.test.traits) + implementation(libs.smithy.waiters) +} + +smithy { + format = false + smithyBuildConfigs.set(project.objects.fileCollection()) +} + +sourceSets { + main { + smithy { + srcDir(project.projectDir.path + "/service") + } + } +} + +tasks { + build { + mustRunAfter(clean) + } +} + diff --git a/buildSrc/src/main/kotlin/api-models-aws.publishing-conventions.gradle.kts b/buildSrc/src/main/kotlin/api-models-aws.publishing-conventions.gradle.kts new file mode 100644 index 00000000..57027df7 --- /dev/null +++ b/buildSrc/src/main/kotlin/api-models-aws.publishing-conventions.gradle.kts @@ -0,0 +1,26 @@ +plugins { + `maven-publish` +} + +group = "software.amazon.api.models" +version = project.property("model.${project.name}.version")!! + +publishing { + repositories { + // JReleaser's `publish` task publishes to all repositories, so only configure one. + maven { + name = "localStaging" + url = rootProject.layout.buildDirectory.dir("staging").get().asFile.toURI() + } + } + + publications { + create("maven") { + if (project != rootProject) { + from(components["java"]) + } else { + from(components["javaPlatform"]) + } + } + } +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 00000000..6510d592 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,407 @@ +model.all.version=1.0.0 +model.accessanalyzer.version=1.0.0 +model.account.version=1.0.0 +model.acm.version=1.0.0 +model.acm-pca.version=1.0.0 +model.amp.version=1.0.0 +model.amplify.version=1.0.0 +model.amplifybackend.version=1.0.0 +model.amplifyuibuilder.version=1.0.0 +model.api-gateway.version=1.0.0 +model.apigatewaymanagementapi.version=1.0.0 +model.apigatewayv2.version=1.0.0 +model.app-mesh.version=1.0.0 +model.appconfig.version=1.0.0 +model.appconfigdata.version=1.0.0 +model.appfabric.version=1.0.0 +model.appflow.version=1.0.0 +model.appintegrations.version=1.0.0 +model.application-auto-scaling.version=1.0.0 +model.application-discovery-service.version=1.0.0 +model.application-insights.version=1.0.0 +model.application-signals.version=1.0.0 +model.applicationcostprofiler.version=1.0.0 +model.apprunner.version=1.0.0 +model.appstream.version=1.0.0 +model.appsync.version=1.0.0 +model.apptest.version=1.0.0 +model.arc-zonal-shift.version=1.0.0 +model.artifact.version=1.0.0 +model.athena.version=1.0.0 +model.auditmanager.version=1.0.0 +model.auto-scaling.version=1.0.0 +model.auto-scaling-plans.version=1.0.0 +model.b2bi.version=1.0.0 +model.backup.version=1.0.0 +model.backup-gateway.version=1.0.0 +model.backupsearch.version=1.0.0 +model.batch.version=1.0.0 +model.bcm-data-exports.version=1.0.0 +model.bcm-pricing-calculator.version=1.0.0 +model.bedrock.version=1.0.0 +model.bedrock-agent.version=1.0.0 +model.bedrock-agent-runtime.version=1.0.0 +model.bedrock-data-automation.version=1.0.0 +model.bedrock-data-automation-runtime.version=1.0.0 +model.bedrock-runtime.version=1.0.0 +model.billing.version=1.0.0 +model.billingconductor.version=1.0.0 +model.braket.version=1.0.0 +model.budgets.version=1.0.0 +model.chatbot.version=1.0.0 +model.chime.version=1.0.0 +model.chime-sdk-identity.version=1.0.0 +model.chime-sdk-media-pipelines.version=1.0.0 +model.chime-sdk-meetings.version=1.0.0 +model.chime-sdk-messaging.version=1.0.0 +model.chime-sdk-voice.version=1.0.0 +model.cleanrooms.version=1.0.0 +model.cleanroomsml.version=1.0.0 +model.cloud9.version=1.0.0 +model.cloudcontrol.version=1.0.0 +model.clouddirectory.version=1.0.0 +model.cloudformation.version=1.0.0 +model.cloudfront.version=1.0.0 +model.cloudfront-keyvaluestore.version=1.0.0 +model.cloudhsm.version=1.0.0 +model.cloudhsm-v2.version=1.0.0 +model.cloudsearch.version=1.0.0 +model.cloudsearch-domain.version=1.0.0 +model.cloudtrail.version=1.0.0 +model.cloudtrail-data.version=1.0.0 +model.cloudwatch.version=1.0.0 +model.cloudwatch-events.version=1.0.0 +model.cloudwatch-logs.version=1.0.0 +model.codeartifact.version=1.0.0 +model.codebuild.version=1.0.0 +model.codecatalyst.version=1.0.0 +model.codecommit.version=1.0.0 +model.codeconnections.version=1.0.0 +model.codedeploy.version=1.0.0 +model.codeguru-reviewer.version=1.0.0 +model.codeguru-security.version=1.0.0 +model.codeguruprofiler.version=1.0.0 +model.codepipeline.version=1.0.0 +model.codestar-connections.version=1.0.0 +model.codestar-notifications.version=1.0.0 +model.cognito-identity.version=1.0.0 +model.cognito-identity-provider.version=1.0.0 +model.cognito-sync.version=1.0.0 +model.comprehend.version=1.0.0 +model.comprehendmedical.version=1.0.0 +model.compute-optimizer.version=1.0.0 +model.config-service.version=1.0.0 +model.connect.version=1.0.0 +model.connect-contact-lens.version=1.0.0 +model.connectcampaigns.version=1.0.0 +model.connectcampaignsv2.version=1.0.0 +model.connectcases.version=1.0.0 +model.connectparticipant.version=1.0.0 +model.controlcatalog.version=1.0.0 +model.controltower.version=1.0.0 +model.cost-and-usage-report-service.version=1.0.0 +model.cost-explorer.version=1.0.0 +model.cost-optimization-hub.version=1.0.0 +model.customer-profiles.version=1.0.0 +model.data-pipeline.version=1.0.0 +model.database-migration-service.version=1.0.0 +model.databrew.version=1.0.0 +model.dataexchange.version=1.0.0 +model.datasync.version=1.0.0 +model.datazone.version=1.0.0 +model.dax.version=1.0.0 +model.deadline.version=1.0.0 +model.detective.version=1.0.0 +model.device-farm.version=1.0.0 +model.devops-guru.version=1.0.0 +model.direct-connect.version=1.0.0 +model.directory-service.version=1.0.0 +model.directory-service-data.version=1.0.0 +model.dlm.version=1.0.0 +model.docdb.version=1.0.0 +model.docdb-elastic.version=1.0.0 +model.drs.version=1.0.0 +model.dsql.version=1.0.0 +model.dynamodb.version=1.0.0 +model.dynamodb-streams.version=1.0.0 +model.ebs.version=1.0.0 +model.ec2.version=1.0.0 +model.ec2-instance-connect.version=1.0.0 +model.ecr.version=1.0.0 +model.ecr-public.version=1.0.0 +model.ecs.version=1.0.0 +model.efs.version=1.0.0 +model.eks.version=1.0.0 +model.eks-auth.version=1.0.0 +model.elastic-beanstalk.version=1.0.0 +model.elastic-load-balancing.version=1.0.0 +model.elastic-load-balancing-v2.version=1.0.0 +model.elastic-transcoder.version=1.0.0 +model.elasticache.version=1.0.0 +model.elasticsearch-service.version=1.0.0 +model.emr.version=1.0.0 +model.emr-containers.version=1.0.0 +model.emr-serverless.version=1.0.0 +model.entityresolution.version=1.0.0 +model.eventbridge.version=1.0.0 +model.evidently.version=1.0.0 +model.finspace.version=1.0.0 +model.finspace-data.version=1.0.0 +model.firehose.version=1.0.0 +model.fis.version=1.0.0 +model.fms.version=1.0.0 +model.forecast.version=1.0.0 +model.forecastquery.version=1.0.0 +model.frauddetector.version=1.0.0 +model.freetier.version=1.0.0 +model.fsx.version=1.0.0 +model.gamelift.version=1.0.0 +model.gameliftstreams.version=1.0.0 +model.geo-maps.version=1.0.0 +model.geo-places.version=1.0.0 +model.geo-routes.version=1.0.0 +model.glacier.version=1.0.0 +model.global-accelerator.version=1.0.0 +model.glue.version=1.0.0 +model.grafana.version=1.0.0 +model.greengrass.version=1.0.0 +model.greengrassv2.version=1.0.0 +model.groundstation.version=1.0.0 +model.guardduty.version=1.0.0 +model.health.version=1.0.0 +model.healthlake.version=1.0.0 +model.iam.version=1.0.0 +model.identitystore.version=1.0.0 +model.imagebuilder.version=1.0.0 +model.inspector.version=1.0.0 +model.inspector-scan.version=1.0.0 +model.inspector2.version=1.0.0 +model.internetmonitor.version=1.0.0 +model.invoicing.version=1.0.0 +model.iot.version=1.0.0 +model.iot-data-plane.version=1.0.0 +model.iot-events.version=1.0.0 +model.iot-events-data.version=1.0.0 +model.iot-jobs-data-plane.version=1.0.0 +model.iot-managed-integrations.version=1.0.0 +model.iot-wireless.version=1.0.0 +model.iotanalytics.version=1.0.0 +model.iotdeviceadvisor.version=1.0.0 +model.iotfleethub.version=1.0.0 +model.iotfleetwise.version=1.0.0 +model.iotsecuretunneling.version=1.0.0 +model.iotsitewise.version=1.0.0 +model.iotthingsgraph.version=1.0.0 +model.iottwinmaker.version=1.0.0 +model.ivs.version=1.0.0 +model.ivs-realtime.version=1.0.0 +model.ivschat.version=1.0.0 +model.kafka.version=1.0.0 +model.kafkaconnect.version=1.0.0 +model.kendra.version=1.0.0 +model.kendra-ranking.version=1.0.0 +model.keyspaces.version=1.0.0 +model.kinesis.version=1.0.0 +model.kinesis-analytics.version=1.0.0 +model.kinesis-analytics-v2.version=1.0.0 +model.kinesis-video.version=1.0.0 +model.kinesis-video-archived-media.version=1.0.0 +model.kinesis-video-media.version=1.0.0 +model.kinesis-video-signaling.version=1.0.0 +model.kinesis-video-webrtc-storage.version=1.0.0 +model.kms.version=1.0.0 +model.lakeformation.version=1.0.0 +model.lambda.version=1.0.0 +model.launch-wizard.version=1.0.0 +model.lex-model-building-service.version=1.0.0 +model.lex-models-v2.version=1.0.0 +model.lex-runtime-service.version=1.0.0 +model.lex-runtime-v2.version=1.0.0 +model.license-manager.version=1.0.0 +model.license-manager-linux-subscriptions.version=1.0.0 +model.license-manager-user-subscriptions.version=1.0.0 +model.lightsail.version=1.0.0 +model.location.version=1.0.0 +model.lookoutequipment.version=1.0.0 +model.lookoutmetrics.version=1.0.0 +model.lookoutvision.version=1.0.0 +model.m2.version=1.0.0 +model.machine-learning.version=1.0.0 +model.macie2.version=1.0.0 +model.mailmanager.version=1.0.0 +model.managedblockchain.version=1.0.0 +model.managedblockchain-query.version=1.0.0 +model.marketplace-agreement.version=1.0.0 +model.marketplace-catalog.version=1.0.0 +model.marketplace-commerce-analytics.version=1.0.0 +model.marketplace-deployment.version=1.0.0 +model.marketplace-entitlement-service.version=1.0.0 +model.marketplace-metering.version=1.0.0 +model.marketplace-reporting.version=1.0.0 +model.mediaconnect.version=1.0.0 +model.mediaconvert.version=1.0.0 +model.medialive.version=1.0.0 +model.mediapackage.version=1.0.0 +model.mediapackage-vod.version=1.0.0 +model.mediapackagev2.version=1.0.0 +model.mediastore.version=1.0.0 +model.mediastore-data.version=1.0.0 +model.mediatailor.version=1.0.0 +model.medical-imaging.version=1.0.0 +model.memorydb.version=1.0.0 +model.mgn.version=1.0.0 +model.migration-hub.version=1.0.0 +model.migration-hub-refactor-spaces.version=1.0.0 +model.migrationhub-config.version=1.0.0 +model.migrationhuborchestrator.version=1.0.0 +model.migrationhubstrategy.version=1.0.0 +model.mq.version=1.0.0 +model.mturk.version=1.0.0 +model.mwaa.version=1.0.0 +model.neptune.version=1.0.0 +model.neptune-graph.version=1.0.0 +model.neptunedata.version=1.0.0 +model.network-firewall.version=1.0.0 +model.networkflowmonitor.version=1.0.0 +model.networkmanager.version=1.0.0 +model.networkmonitor.version=1.0.0 +model.notifications.version=1.0.0 +model.notificationscontacts.version=1.0.0 +model.oam.version=1.0.0 +model.observabilityadmin.version=1.0.0 +model.omics.version=1.0.0 +model.opensearch.version=1.0.0 +model.opensearchserverless.version=1.0.0 +model.opsworks.version=1.0.0 +model.opsworkscm.version=1.0.0 +model.organizations.version=1.0.0 +model.osis.version=1.0.0 +model.outposts.version=1.0.0 +model.panorama.version=1.0.0 +model.partnercentral-selling.version=1.0.0 +model.payment-cryptography.version=1.0.0 +model.payment-cryptography-data.version=1.0.0 +model.pca-connector-ad.version=1.0.0 +model.pca-connector-scep.version=1.0.0 +model.pcs.version=1.0.0 +model.personalize.version=1.0.0 +model.personalize-events.version=1.0.0 +model.personalize-runtime.version=1.0.0 +model.pi.version=1.0.0 +model.pinpoint.version=1.0.0 +model.pinpoint-email.version=1.0.0 +model.pinpoint-sms-voice.version=1.0.0 +model.pinpoint-sms-voice-v2.version=1.0.0 +model.pipes.version=1.0.0 +model.polly.version=1.0.0 +model.pricing.version=1.0.0 +model.privatenetworks.version=1.0.0 +model.proton.version=1.0.0 +model.qapps.version=1.0.0 +model.qbusiness.version=1.0.0 +model.qconnect.version=1.0.0 +model.qldb.version=1.0.0 +model.qldb-session.version=1.0.0 +model.quicksight.version=1.0.0 +model.ram.version=1.0.0 +model.rbin.version=1.0.0 +model.rds.version=1.0.0 +model.rds-data.version=1.0.0 +model.redshift.version=1.0.0 +model.redshift-data.version=1.0.0 +model.redshift-serverless.version=1.0.0 +model.rekognition.version=1.0.0 +model.repostspace.version=1.0.0 +model.resiliencehub.version=1.0.0 +model.resource-explorer-2.version=1.0.0 +model.resource-groups.version=1.0.0 +model.resource-groups-tagging-api.version=1.0.0 +model.robomaker.version=1.0.0 +model.rolesanywhere.version=1.0.0 +model.route-53.version=1.0.0 +model.route-53-domains.version=1.0.0 +model.route53-recovery-cluster.version=1.0.0 +model.route53-recovery-control-config.version=1.0.0 +model.route53-recovery-readiness.version=1.0.0 +model.route53profiles.version=1.0.0 +model.route53resolver.version=1.0.0 +model.rum.version=1.0.0 +model.s3.version=1.0.0 +model.s3-control.version=1.0.0 +model.s3outposts.version=1.0.0 +model.s3tables.version=1.0.0 +model.sagemaker.version=1.0.0 +model.sagemaker-a2i-runtime.version=1.0.0 +model.sagemaker-edge.version=1.0.0 +model.sagemaker-featurestore-runtime.version=1.0.0 +model.sagemaker-geospatial.version=1.0.0 +model.sagemaker-metrics.version=1.0.0 +model.sagemaker-runtime.version=1.0.0 +model.savingsplans.version=1.0.0 +model.scheduler.version=1.0.0 +model.schemas.version=1.0.0 +model.secrets-manager.version=1.0.0 +model.security-ir.version=1.0.0 +model.securityhub.version=1.0.0 +model.securitylake.version=1.0.0 +model.serverlessapplicationrepository.version=1.0.0 +model.service-catalog.version=1.0.0 +model.service-catalog-appregistry.version=1.0.0 +model.service-quotas.version=1.0.0 +model.servicediscovery.version=1.0.0 +model.ses.version=1.0.0 +model.sesv2.version=1.0.0 +model.sfn.version=1.0.0 +model.shield.version=1.0.0 +model.signer.version=1.0.0 +model.simspaceweaver.version=1.0.0 +model.sms.version=1.0.0 +model.snow-device-management.version=1.0.0 +model.snowball.version=1.0.0 +model.sns.version=1.0.0 +model.socialmessaging.version=1.0.0 +model.sqs.version=1.0.0 +model.ssm.version=1.0.0 +model.ssm-contacts.version=1.0.0 +model.ssm-incidents.version=1.0.0 +model.ssm-quicksetup.version=1.0.0 +model.ssm-sap.version=1.0.0 +model.sso.version=1.0.0 +model.sso-admin.version=1.0.0 +model.sso-oidc.version=1.0.0 +model.storage-gateway.version=1.0.0 +model.sts.version=1.0.0 +model.supplychain.version=1.0.0 +model.support.version=1.0.0 +model.support-app.version=1.0.0 +model.swf.version=1.0.0 +model.synthetics.version=1.0.0 +model.taxsettings.version=1.0.0 +model.textract.version=1.0.0 +model.timestream-influxdb.version=1.0.0 +model.timestream-query.version=1.0.0 +model.timestream-write.version=1.0.0 +model.tnb.version=1.0.0 +model.transcribe.version=1.0.0 +model.transcribe-streaming.version=1.0.0 +model.transfer.version=1.0.0 +model.translate.version=1.0.0 +model.trustedadvisor.version=1.0.0 +model.verifiedpermissions.version=1.0.0 +model.voice-id.version=1.0.0 +model.vpc-lattice.version=1.0.0 +model.waf.version=1.0.0 +model.waf-regional.version=1.0.0 +model.wafv2.version=1.0.0 +model.wellarchitected.version=1.0.0 +model.wisdom.version=1.0.0 +model.workdocs.version=1.0.0 +model.workmail.version=1.0.0 +model.workmailmessageflow.version=1.0.0 +model.workspaces.version=1.0.0 +model.workspaces-thin-client.version=1.0.0 +model.workspaces-web.version=1.0.0 +model.xray.version=1.0.0 +org.gradle.jvmargs=-Xmx1024m +org.gradle.parallel=true +org.gradle.logging.level=quiet diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 00000000..98cba25d --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,21 @@ +[versions] +smithy = "1.56.0" +smithy-gradle-plugins = "1.2.0" +jreleaser = "1.17.0" + +[libraries] +smithy-aws-cloudformation-traits = { module = "software.amazon.smithy:smithy-aws-cloudformation-traits", version.ref = "smithy" } +smithy-aws-endpoints = { module = "software.amazon.smithy:smithy-aws-endpoints", version.ref = "smithy" } +smithy-aws-iam-traits = { module = "software.amazon.smithy:smithy-aws-iam-traits", version.ref = "smithy" } +smithy-aws-smoke-test-model = { module = "software.amazon.smithy:smithy-aws-smoke-test-model", version.ref = "smithy" } +smithy-aws-traits = { module = "software.amazon.smithy:smithy-aws-traits", version.ref = "smithy" } +smithy-protocol-traits = { module = "software.amazon.smithy:smithy-protocol-traits", version.ref = "smithy" } +smithy-model = { module = "software.amazon.smithy:smithy-model", version.ref = "smithy" } +smithy-rules-engine = { module = "software.amazon.smithy:smithy-rules-engine", version.ref = "smithy" } +smithy-smoke-test-traits = { module = "software.amazon.smithy:smithy-smoke-test-traits", version.ref = "smithy" } +smithy-waiters = { module = "software.amazon.smithy:smithy-waiters", version.ref = "smithy" } +smithy-gradle-base = { module = "software.amazon.smithy.gradle:smithy-base", version.ref = "smithy-gradle-plugins" } +smithy-gradle-jar = { module = "software.amazon.smithy.gradle:smithy-jar", version.ref = "smithy-gradle-plugins" } + +[plugins] +jreleaser = { id = "org.jreleaser", version.ref = "jreleaser" } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000..a4b76b95 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..9355b415 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100755 index 00000000..f5feea6d --- /dev/null +++ b/gradlew @@ -0,0 +1,252 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 00000000..9b42019c --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,94 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 00000000..8b8cc3d9 --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,18 @@ +rootProject.name = "all" + +pluginManagement { + repositories { + gradlePluginPortal() + } +} + +// Dynamically create subprojects for each model defined in the properties file +settings.extra.properties.forEach { + if (it.key.startsWith("model.") && it.key.endsWith(".version")) { + val project = it.key.substring(6, it.key.length - 8) + // Skip the "all" project, it is set up in the root gradle file + if (project != "all") { + include(project) + } + } +} \ No newline at end of file