From 93a2e5bb2553e96a0f78e8fee312c47841ed9af9 Mon Sep 17 00:00:00 2001 From: Josh Elkins Date: Wed, 30 Aug 2023 15:48:14 -0500 Subject: [PATCH] chore: Update Smithy doc & smithy-swift references (#1093) --- .github/workflows/continuous-integration.yml | 8 +- .github/workflows/model-integration.yml | 4 +- .../Commands/PrepareRelease.swift | 21 +- .../Models/ReleaseNotesBuilder.swift | 3 +- .../Resources/Package.Base.swift | 2 +- .../Commands/PrepareReleaseTests.swift | 1 + Package.swift | 2 +- THIRD-PARTY-LICENSES | 4 +- .../aws/swift/codegen/AWSServiceUtils.kt | 6 +- scripts/buildswiftsdk.sh | 348 ------------------ scripts/updateReleaseToLocalDev.sh | 88 ----- 11 files changed, 36 insertions(+), 451 deletions(-) delete mode 100755 scripts/buildswiftsdk.sh delete mode 100755 scripts/updateReleaseToLocalDev.sh diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 23e24360473..f5fa205ced1 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -46,12 +46,12 @@ jobs: - name: Select smithy-swift branch run: | ORIGINAL_REPO_HEAD_REF="$GITHUB_HEAD_REF" \ - DEPENDENCY_REPO_URL="https://github.com/awslabs/smithy-swift.git" \ + DEPENDENCY_REPO_URL="https://github.com/smithy-lang/smithy-swift.git" \ ./scripts/ci_steps/select_dependency_branch.sh - name: Checkout smithy-swift uses: actions/checkout@v3 with: - repository: awslabs/smithy-swift + repository: smithy-lang/smithy-swift ref: ${{ env.DEPENDENCY_REPO_SHA }} path: smithy-swift - name: Move smithy-swift into place @@ -113,12 +113,12 @@ jobs: - name: Select smithy-swift branch run: | ORIGINAL_REPO_HEAD_REF="${GITHUB_HEAD_REF:-${GITHUB_REF_NAME:-main}}" \ - DEPENDENCY_REPO_URL="https://github.com/awslabs/smithy-swift.git" \ + DEPENDENCY_REPO_URL="https://github.com/smithy-lang/smithy-swift.git" \ ./scripts/ci_steps/select_dependency_branch.sh - name: Checkout smithy-swift uses: actions/checkout@v3 with: - repository: awslabs/smithy-swift + repository: smithy-lang/smithy-swift ref: ${{ env.DEPENDENCY_REPO_SHA }} path: smithy-swift - name: Move smithy-swift into place diff --git a/.github/workflows/model-integration.yml b/.github/workflows/model-integration.yml index 525eabad893..7ee77af2578 100644 --- a/.github/workflows/model-integration.yml +++ b/.github/workflows/model-integration.yml @@ -28,12 +28,12 @@ jobs: - name: Select smithy-swift branch run: | ORIGINAL_REPO_HEAD_REF="${GITHUB_HEAD_REF:-${GITHUB_REF_NAME:-main}}" \ - DEPENDENCY_REPO_URL="https://github.com/awslabs/smithy-swift.git" \ + DEPENDENCY_REPO_URL="https://github.com/smithy-lang/smithy-swift.git" \ ./scripts/ci_steps/select_dependency_branch.sh - name: Checkout smithy-swift uses: actions/checkout@v3 with: - repository: awslabs/smithy-swift + repository: smithy-lang/smithy-swift ref: ${{ env.DEPENDENCY_REPO_SHA }} path: smithy-swift - name: Move smithy-swift into place diff --git a/AWSSDKSwiftCLI/Sources/AWSSDKSwiftCLI/Commands/PrepareRelease.swift b/AWSSDKSwiftCLI/Sources/AWSSDKSwiftCLI/Commands/PrepareRelease.swift index f65df9d38c0..9eceeae30f0 100644 --- a/AWSSDKSwiftCLI/Sources/AWSSDKSwiftCLI/Commands/PrepareRelease.swift +++ b/AWSSDKSwiftCLI/Sources/AWSSDKSwiftCLI/Commands/PrepareRelease.swift @@ -20,7 +20,7 @@ struct PrepareReleaseCommand: ParsableCommand { @Argument(help: "The repository type to release. sdk or smithy-swift") var repoType: PrepareRelease.Repo - + @Argument(help: "The path to the git repository.") var repoPath: String @@ -28,8 +28,16 @@ struct PrepareReleaseCommand: ParsableCommand { var sourceCodeArtifactId: String func run() throws { + let repoOrg: PrepareRelease.Org + switch repoType { + case .awsSdkSwift: + repoOrg = .awslabs + case .smithySwift: + repoOrg = .smithyLang + } let prepareRelease = PrepareRelease.standard( repoType: repoType, + repoOrg: repoOrg, repoPath: repoPath, sourceCodeArtifactId: sourceCodeArtifactId ) @@ -45,10 +53,18 @@ struct PrepareRelease { case awsSdkSwift = "aws-sdk-swift" case smithySwift = "smithy-swift" } + + enum Org: String, ExpressibleByArgument { + case awslabs = "awslabs" + case smithyLang = "smithy-lang" + } /// The repository type to prepare the release /// This dictates which files are staged for commit let repoType: Repo + + /// The GitHub org that the repo belongs to + let repoOrg: Org /// The path to the package repository let repoPath: String @@ -174,6 +190,7 @@ struct PrepareRelease { let releaseNotes = ReleaseNotesBuilder( previousVersion: previousVersion, newVersion: newVersion, + repoOrg: repoOrg, repoType: repoType, commits: commits ).build() @@ -208,11 +225,13 @@ extension PrepareRelease { /// - Returns: The standard release preparer static func standard( repoType: Repo, + repoOrg: Org, repoPath: String, sourceCodeArtifactId: String ) -> Self { PrepareRelease( repoType: repoType, + repoOrg: repoOrg, repoPath: repoPath, sourceCodeArtifactId: sourceCodeArtifactId ) { branch, version in diff --git a/AWSSDKSwiftCLI/Sources/AWSSDKSwiftCLI/Models/ReleaseNotesBuilder.swift b/AWSSDKSwiftCLI/Sources/AWSSDKSwiftCLI/Models/ReleaseNotesBuilder.swift index 4f25ac3c0e0..e35ab256e14 100644 --- a/AWSSDKSwiftCLI/Sources/AWSSDKSwiftCLI/Models/ReleaseNotesBuilder.swift +++ b/AWSSDKSwiftCLI/Sources/AWSSDKSwiftCLI/Models/ReleaseNotesBuilder.swift @@ -12,6 +12,7 @@ import PackageDescription struct ReleaseNotesBuilder { let previousVersion: Version let newVersion: Version + let repoOrg: PrepareRelease.Org let repoType: PrepareRelease.Repo let commits: [String] @@ -22,7 +23,7 @@ struct ReleaseNotesBuilder { "## What's Changed", buildCommits(), .newline, - "**Full Changelog**: https://github.com/awslabs/\(repoType.rawValue)/compare/\(previousVersion)...\(newVersion)" + "**Full Changelog**: https://github.com/\(repoOrg.rawValue)/\(repoType.rawValue)/compare/\(previousVersion)...\(newVersion)" ] return contents.joined(separator: .newline) } diff --git a/AWSSDKSwiftCLI/Sources/AWSSDKSwiftCLI/Resources/Package.Base.swift b/AWSSDKSwiftCLI/Sources/AWSSDKSwiftCLI/Resources/Package.Base.swift index bd074f66c44..0fcd014b4b0 100644 --- a/AWSSDKSwiftCLI/Sources/AWSSDKSwiftCLI/Resources/Package.Base.swift +++ b/AWSSDKSwiftCLI/Sources/AWSSDKSwiftCLI/Resources/Package.Base.swift @@ -56,7 +56,7 @@ func addDependencies(clientRuntimeVersion: Version, crtVersion: Version) { } func addClientRuntimeDependency(_ version: Version) { - let smithySwiftURL = "https://github.com/awslabs/smithy-swift" + let smithySwiftURL = "https://github.com/smithy-lang/smithy-swift" let useLocalDeps = ProcessInfo.processInfo.environment["AWS_SWIFT_SDK_USE_LOCAL_DEPS"] != nil let useMainDeps = ProcessInfo.processInfo.environment["AWS_SWIFT_SDK_USE_MAIN_DEPS"] != nil switch (useLocalDeps, useMainDeps) { diff --git a/AWSSDKSwiftCLI/Tests/AWSSDKSwiftCLITests/Commands/PrepareReleaseTests.swift b/AWSSDKSwiftCLI/Tests/AWSSDKSwiftCLITests/Commands/PrepareReleaseTests.swift index 86422f86593..0194adde89f 100644 --- a/AWSSDKSwiftCLI/Tests/AWSSDKSwiftCLITests/Commands/PrepareReleaseTests.swift +++ b/AWSSDKSwiftCLI/Tests/AWSSDKSwiftCLITests/Commands/PrepareReleaseTests.swift @@ -130,6 +130,7 @@ extension PrepareRelease { ) -> Self { PrepareRelease( repoType: repoType, + repoOrg: .awslabs, repoPath: repoPath, sourceCodeArtifactId: sourceCodeArtifactId, diffChecker: diffChecker diff --git a/Package.swift b/Package.swift index da9efce0cfe..50e7606f801 100644 --- a/Package.swift +++ b/Package.swift @@ -56,7 +56,7 @@ func addDependencies(clientRuntimeVersion: Version, crtVersion: Version) { } func addClientRuntimeDependency(_ version: Version) { - let smithySwiftURL = "https://github.com/awslabs/smithy-swift" + let smithySwiftURL = "https://github.com/smithy-lang/smithy-swift" let useLocalDeps = ProcessInfo.processInfo.environment["AWS_SWIFT_SDK_USE_LOCAL_DEPS"] != nil let useMainDeps = ProcessInfo.processInfo.environment["AWS_SWIFT_SDK_USE_MAIN_DEPS"] != nil switch (useLocalDeps, useMainDeps) { diff --git a/THIRD-PARTY-LICENSES b/THIRD-PARTY-LICENSES index 75fa0998315..94288d78179 100644 --- a/THIRD-PARTY-LICENSES +++ b/THIRD-PARTY-LICENSES @@ -216,9 +216,9 @@ Licensed under Apache License v2.0 with Runtime Library Exception ------ -** aws-crt-swift; version 0.2.2 -- https://github.com/awslabs/aws-crt-swift +** aws-crt-swift -- https://github.com/awslabs/aws-crt-swift Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -** smithy-swift; version 0.2.4 -- https://github.com/awslabs/smithy-swift +** smithy-swift -- https://github.com/smithy-lang/smithy-swift Smithy Swift Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/AWSServiceUtils.kt b/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/AWSServiceUtils.kt index a194acc0d38..a0c6997d0f9 100644 --- a/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/AWSServiceUtils.kt +++ b/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/AWSServiceUtils.kt @@ -10,20 +10,20 @@ import software.amazon.smithy.model.shapes.ServiceShape import software.amazon.smithy.swift.codegen.model.expectTrait /** - * Get the [sdkId](https://awslabs.github.io/smithy/1.0/spec/aws/aws-core.html#sdkid) from the (AWS) service shape + * Get the [sdkId](https://smithy.io/2.0/aws/aws-core.html#sdkid) from the (AWS) service shape */ val ServiceShape.sdkId: String get() = expectTrait().sdkId /** - * Get the [arnNamespace](https://awslabs.github.io/smithy/1.0/spec/aws/aws-core.html#service-arn-namespace) + * Get the [arnNamespace](https://smithy.io/2.0/aws/aws-core.html#arnnamespace) * from the (AWS) service shape */ val ServiceShape.arnNamespace: String get() = expectTrait().arnNamespace /** - * Get the [endpointPrefix](https://awslabs.github.io/smithy/1.0/spec/aws/aws-core.html#endpointprefix) + * Get the [endpointPrefix](https://smithy.io/2.0/aws/aws-core.html#endpointprefix) * from the (AWS) service shape */ val ServiceShape.endpointPrefix: String diff --git a/scripts/buildswiftsdk.sh b/scripts/buildswiftsdk.sh deleted file mode 100755 index 7a08304d81a..00000000000 --- a/scripts/buildswiftsdk.sh +++ /dev/null @@ -1,348 +0,0 @@ -#!/bin/bash - -# Pre-requisite: -# - Clone the following github repositories to a __single directory__: -# mkdir ~/Projects/SwiftSDK -# cd ~/Projects/SwiftSDK -# git clone git@github.com:awslabs/aws-sdk-swift.git -# git clone git@github.com:awslabs/smithy-swift.git -# git clone --recurse-submodules git@github.com:awslabs/aws-crt-swift.git -# -# Setup Instructions: -# 1. Ensure buildswiftsdk.sh is in your PATH -# 2. Export the environment variable BUILDSWIFTSDK_DIR to point to where you cloned aws-sdk-swift -# For example: -# emacs ~/.bashrc -# export BUILDSWIFTSDK_DIR=/path/to/aws-sdk-swift -# -# Run: -# buildswiftsdk.sh -# -# Suggestion: -# You may want to create an alias for this script -# For example: -# alias bss=buildswiftsdk.sh -# - -usage() { - echo "Usage:" - echo " buildswiftsdk " -} - -pushdir() { - if [[ ! -d "${1}" ]]; then - echo "Error: pushdir: invalid directory: ${1}" - exit 1 - fi - pushd "${1}" > /dev/null 2>&1 -} - -popdir() { - popd > /dev/null 2>&1 -} - -RETURNVAL= -dereference() { - local VAR=$1 - if [[ $IS_ZSH -eq 1 ]]; then - RETURNVAL="${(P)VAR}" - else - RETURNVAL="${!VAR}" - fi -} - -setupPaths() { - pushdir "${AWS_SDK_SWIFT_DIR_REL}" - AWS_SDK_SWIFT_DIR="${PWD}" - SMITHY_SWIFT_DIR_REL="${PWD}/../smithy-swift" - if [[ -d "${SMITHY_SWIFT_DIR_REL}" ]]; then - pushdir "${SMITHY_SWIFT_DIR_REL}" - SMITHY_SWIFT_DIR="${PWD}" - popdir - fi - CLIENT_RUNTIME_DIR="${SMITHY_SWIFT_DIR}/Packages" - AWS_CLIENT_RUNTIME_DIR="${AWS_SDK_SWIFT_DIR}/AWSClientRuntime" - popdir - BASEPCG="${AWS_SDK_SWIFT_DIR}/codegen/protocol-test-codegen/build/smithyprojections/protocol-test-codegen" - BASEPCGL="${AWS_SDK_SWIFT_DIR}/codegen/protocol-test-codegen-local/build/smithyprojections/protocol-test-codegen-local" - REST_JSON="${BASEPCG}/aws-restjson/swift-codegen" - AWSJSON10="${BASEPCG}/aws-json-10/swift-codegen" - AWSJSON11="${BASEPCG}/aws-json-11/swift-codegen" - REST_XML="${BASEPCG}/rest-xml/swift-codegen" - AWSQUERY="${BASEPCG}/aws-query/swift-codegen" - EC2QUERY="${BASEPCG}/ec2-query/swift-codegen" -} - -checkPaths() { - error=0 - if [[ ! -d "${SMITHY_SWIFT_DIR}" ]]; then - echo "Was unable to detect smithy-swift" - error=1 - fi - if [[ ! -d "${AWS_SDK_SWIFT_DIR}" ]]; then - echo "Was unable to detect where aws-sdk-swift" - error=1 - fi - if [[ ${error} -eq 1 ]]; then - exit 1 - fi -} -SWIFTLINT= -swiftlintSetup() { - SWIFTLINT=`which swiftlint` -} - -AWS_SDK_SWIFT_DIR="" -SMITHY_SWIFT_DIR="" -BASEPCG="" -if [[ -z "${BUILDSWIFTSDK_DIR}" ]]; then - AWS_SDK_SWIFT_DIR_REL=`dirname ${0}`/../ -else - AWS_SDK_SWIFT_DIR_REL="${BUILDSWIFTSDK_DIR}" -fi -setupPaths -checkPaths -swiftlintSetup - - -checkReturn() { - if [ $1 -ne 0 ]; then - echo "" - echo $2 - exit 1 - fi -} - -buildall() { - cd "${SMITHY_SWIFT_DIR}" && ./gradlew build - checkReturn $? "Failed on: ./gradlew build in ${SMITHY_SWIFT_DIR}" - cd "${SMITHY_SWIFT_DIR}/Packages" && swift test - checkReturn $? "Failed on: swift test in ${SMITHY_SWIFT_DIR}/Packages" - cd "${AWS_SDK_SWIFT_DIR}" && ./gradlew build - checkReturn $? "Failed on: ./gradlew build in ${AWS_SDK_SWIFT_DIR}" - cd "${CLIENT_RUNTIME_DIR}" && swift test - checkReturn $? "Failed on: swift test in ${CLIENT_RUNTIME_DIR}" - cd "${AWS_CLIENT_RUNTIME_DIR}" && swift test - checkReturn $? "Failed on: swift test in ${AWS_CLIENT_RUNTIME_DIR}" - cd "${AWS_SDK_SWIFT_DIR}/codegen" && swift test - checkReturn $? "Failed on: swift test in codegen" -} - - -pcg() { - cd "${SMITHY_SWIFT_DIR}" && \ - ./gradlew -p smithy-swift-codegen assemble && \ - cd "${AWS_SDK_SWIFT_DIR}" && \ - ./gradlew -p codegen/protocol-test-codegen clean &&\ - ./gradlew -p codegen/protocol-test-codegen-local clean &&\ - ./gradlew -p codegen/protocol-test-codegen build && - ./gradlew -p codegen/protocol-test-codegen-local build - echo "Generated files should be in both:" - echo "${BASEPCG}" - echo "${BASEPCGL}" -} - -rpcg() { - if [ -z $1 ]; then - RUNDIRS="${AWS_SDK_SWIFT_DIR}/codegen" - elif [ x$1 == x"rj" ]; then - RUNDIRS="${REST_JSON}" - elif [ x$1 == x"10" ]; then - RUNDIRS="${AWSJSON10}" - elif [ x$1 == x"11" ]; then - RUNDIRS="${AWSJSON11}" - elif [ x$1 == x"rx" ]; then - RUNDIRS="${REST_XML}" - elif [ x$1 == x"aq" ]; then - RUNDIRS="${AWSQUERY}" - elif [ x$1 == x"e2" ]; then - RUNDIRS="${EC2QUERY}" - fi - - FAILEDDIRS="" - for codegendir in ${RUNDIRS}; do - echo "entering: ${codegendir}" - cd ${codegendir} && swift test - RETVAL=$? - if [ $RETVAL -ne 0 ]; then - temp="${FAILEDDIRS} ${codegendir}" - FAILEDDIRS="${temp}" - fi - done - - ATTEMPTED_DISPLAYDIRS_ABS=`echo ${RUNDIRS}|tr ' ' '\n'` - ATTEMPTED_DISPLAYDIRS=`echo ${RUNDIRS}|tr ' ' '\n' |sed "s/.*protocol-test-codegen\/\(.*\)\/swift-codegen/\1/g"` - FAILED_DISPLAYDIRS=`echo ${FAILEDDIRS}|tr ' ' '\n' |sed "s/.*protocol-test-codegen\/\(.*\)\/swift-codegen/\1/g"` - - echo "" - echo "" - echo "SUMMARY:" - echo "" - echo "Attempted (Absolute Path):" - echo "${ATTEMPTED_DISPLAYDIRS_ABS}" - echo "" - echo "Attempted (friendly names):" - echo "${ATTEMPTED_DISPLAYDIRS}" - echo "" - if [[ x"${FAILEDDIRS}" != x"" ]]; then - echo "FAILED for:" - echo "${FAILED_DISPLAYDIRS}" - else - echo "SUCCESS!" - fi -} - -SDK_cognito=cognito-identity.2014-06-30 -SDK_lambda=lambda.2015-03-31 -SDK_s3=s3.2006-03-01 -SDK_swf=swf.2012-01-25 -SDK_ssm=ssm-incidents.2018-05-10 -sdk() { - SDKREF=$1 - SDK_POINTER="SDK_${SDKREF}" - dereference "${SDK_POINTER}" - SDK_ONLY="${RETURNVAL}" - - if [[ ! -z "${SDK_ONLY}" ]]; then - PROPFILE=${AWS_SDK_SWIFT_DIR}/local.properties - cat "${PROPFILE}" | grep -e "^onlyIncludeModels" | tail -1 | grep -e "^onlyIncludeModels=${SDK_ONLY}" > /dev/null 2>&1 - if [ $? -ne 0 ]; then - cat "${PROPFILE}" | grep -e "^onlyIncludeModels" > /dev/null 2>&1 - HAS_INCLUDE_MODELS=$? - LOCAL_PROPS_FILE="${AWS_SDK_SWIFT_DIR}/local.properties" - if [ ${HAS_INCLUDE_MODELS} -eq 0 ]; then - LOCALTEMP=/tmp/.buildswiftsdktemp - sed "s/^onlyIncludeModels=.*/onlyIncludeModels=${SDK_ONLY}/g" "${LOCAL_PROPS_FILE}" > ${LOCALTEMP} - echo "" >> ${LOCALTEMP} - SUFFIX=`date "+%Y%m%d%H%M%S"` - mv "${LOCAL_PROPS_FILE}" "${LOCAL_PROPS_FILE}.${SUFFIX}" - mv "${LOCALTEMP}" "${LOCAL_PROPS_FILE}" - else - echo "onlyIncludeModels=${SDK_ONLY}" >> ${LOCAL_PROPS_FILE} - echo "" >> ${LOCAL_PROPS_FILE} - fi - fi - fi - - cd "${AWS_SDK_SWIFT_DIR}" && \ - ./gradlew -p codegen/sdk-codegen build - - CODEGEN_OUTPUT_DIR="${AWS_SDK_SWIFT_DIR}/codegen/sdk-codegen/build/smithyprojections/sdk-codegen" - SDK_OUTPUT=`ls ${CODEGEN_OUTPUT_DIR} |grep -v "source"` - if [ ! -z "${SDK_OUTPUT}" ]; then - echo "Artifacts folder(s):" - for sdk in ${SDK_OUTPUT}; do - echo "${CODEGEN_OUTPUT_DIR}/${sdk}/swift-codegen" - done - else - echo "Build folder:" - echo "${CODEGEN_OUTPUT_DIR}" - fi - link -} - -link() { - PROJ_DIR="${AWS_SDK_SWIFT_DIR}/codegen/sdk-codegen/build/smithyprojections/sdk-codegen" - PROJECTIONS=`ls ${PROJ_DIR}|grep -v source` - for projection in ${PROJECTIONS}; do - projName=`echo ${projection} | tr '.' ' '| awk '{print $1}'` - cd ${PROJ_DIR}/${projection} && ln -vs swift-codegen ${projName} - done -} - -lint() { - klint - slint -} - -klint() { - cd "${AWS_SDK_SWIFT_DIR}" && \ - ./gradlew ktlintFormat - cd "${SMITHY_SWIFT_DIR}" && \ - ./gradlew ktlintFormat -} - -slint() { - if [[ ! -z "${SWIFTLINT}" ]]; then - cd "${AWS_CLIENT_RUNTIME_DIR}" && "${SWIFTLINT}" autocorrect - cd "${CLIENT_RUNTIME_DIR}" && "${SWIFTLINT}" autocorrect - else - echo "swiftlint not installed, skipping" - fi -} - -ssclean() { - cd "${SMITHY_SWIFT_DIR}" && \ - ./gradlew clean -} - -sdkclean() { - cd "${AWS_SDK_SWIFT_DIR}" && \ - ./gradlew clean -} - -clean() { - ssclean && sdkclean -} - -checkIfServiceDefined() { - SDKREF=$1 - SDK_POINTER="SDK_${SDKREF}" - dereference "${SDK_POINTER}" - SDK_ONLY="${RETURNVAL}" - if [ x"" != x"${SDK_ONLY}" ]; then - RETURNVAL=0 - else - RETURNVAL=1 - fi - -} - -interpretArgs() { - case "$1" in - "b") - buildall - ;; - "pcg") - pcg - ;; - "rpcg") - rpcg $2 - ;; - "clean") - clean - ;; - "sdk") - sdk $2 - ;; - "link") - link - ;; - "lint") - lint - ;; - "klint") - klint - ;; - "slint") - slint - ;; - "ssclean") - ssclean - ;; - "sdkclean") - sdkclean - ;; - *) - usage - ;; - esac -} - -checkIfServiceDefined $1 -if [ ${RETURNVAL} -eq 0 ]; then - sdk $1 -else - interpretArgs $* -fi - diff --git a/scripts/updateReleaseToLocalDev.sh b/scripts/updateReleaseToLocalDev.sh deleted file mode 100755 index ad36c53902d..00000000000 --- a/scripts/updateReleaseToLocalDev.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/bash - -# Use this script after pulling down a local copy of the AWS Swift SDK to your local machine. -# Doing so will allow you to build (and modify) a local copy of the AWS Swift SDK. -# -# After setting this up, you can update your executable's Package.swift to depend on a local version of the SDK via: -# -# dependencies: [ -# .package(name: "AWSSwiftSDK", path:"~/Projects/SwiftSDK_Releases/aws-sdk-swift"), -# ], - -# -# Setup Instructions -# Note: Versions listed below should be updated to your preference (ideally, the latest) -# -# mkdir -p ~/Projects/SwiftSDK_Releases -# cd ~/Projects/SwiftSDK_Releases -# -# git clone git@github.com:awslabs/aws-sdk-swift.git -# cd aws-sdk-swift -# git checkout -b 0.1.1 -# cd .. -# -# git clone git@github.com:awslabs/smithy-swift.git -# cd smithy-swift -# git checkout -b 0.1.1 -# cd .. -# -# git clone --recurse-submodules git@github.com:awslabs/aws-crt-swift.git -# cd aws-crt-swift -# git checkout -b 0.1.0 -# cd .. -# -# ./aws-sdk-swift/scripts/updateReleaseToLocalDev.sh -# -# If this script runs successfully, you can depend on a local version of the SDK - - -AWS_SDK_SWIFT= -SMITHY_SWIFT= -AWS_CRT_SWIFT= - -determineAbsolutePath() { - SCRIPTDIR=`dirname $1` - pushd ${SCRIPTDIR} > /dev/null - cd ../../ - AWS_SDK_SWIFT=$PWD/aws-sdk-swift - SMITHY_SWIFT=$PWD/smithy-swift - AWS_CRT_SWIFT=$PWD/aws-crt-swift -} - -determineAbsolutePath $0 - -if [ -z ${AWS_SDK_SWIFT} ] || [ ! -d ${AWS_SDK_SWIFT} ]; then - echo "Unable to detect aws-sdk-swift" - exit 1 -fi - -if [ -z ${SMITHY_SWIFT} ] || [ ! -d ${SMITHY_SWIFT} ]; then - echo "Unable to detect smithy-swift" - exit 1 -fi - -if [ -z ${AWS_CRT_SWIFT} ] || [ ! -d ${AWS_CRT_SWIFT} ]; then - echo "Unable to detect aws-crt-swift" - exit 1 -fi - -TEMPFILE=`mktemp` -AWS_SDK_SWIFT_PACKAGE=${AWS_SDK_SWIFT}/Package.swift -cat ${AWS_SDK_SWIFT_PACKAGE} |\ - sed -e "s|\(.*\)url:\ \"https://github.com/awslabs/aws-crt-swift.*\"\(.*\)|\1path:\ \"$AWS_CRT_SWIFT\"\2|g" \ - -e "s|\(.*\)url:\ \"https://github.com/awslabs/smithy-swift.*\"\(.*\)|\1path:\ \"$SMITHY_SWIFT\"\2|g" > ${TEMPFILE} -mv ${TEMPFILE} ${AWS_SDK_SWIFT_PACKAGE} -rm -f ${TEMPFILE} -# Package.swift in 'AWSClientRuntime' needs to be removed if users are depending on the top level Package.swift to easily browse code in XCode -rm -f ${AWS_SDK_SWIFT}/AWSClientRuntime/Package.swift -echo "Updated ${AWS_SDK_SWIFT_PACKAGE}" - -TEMPFILE=`mktemp` -SMITHY_SWIFT_PACKAGE=${SMITHY_SWIFT}/Package.swift -cat ${SMITHY_SWIFT_PACKAGE} |\ - sed -e "s|\(.*\)url:\ \"https://github.com/awslabs/aws-crt-swift.*\"\(.*\)|\1path:\ \"$AWS_CRT_SWIFT\"\2|g" > ${TEMPFILE} -mv ${TEMPFILE} ${SMITHY_SWIFT_PACKAGE} -rm -f ${TEMPFILE} -# Package.swift in 'Packages' needs to be removed if users are depending on the top level Package.swift to easily browse code in XCode -rm -f ${SMITHY_SWIFT}/Packages/Package.swift -echo "Updated ${SMITHY_SWIFT_PACKAGE}"