diff --git a/cmake/sdks.cmake b/cmake/sdks.cmake index 6548ef66932..567c013fc0a 100644 --- a/cmake/sdks.cmake +++ b/cmake/sdks.cmake @@ -137,7 +137,7 @@ foreach(custom_client ${ADD_CUSTOM_CLIENTS}) file(REMOVE_RECURSE "${CMAKE_CURRENT_SOURCE_DIR}/aws-cpp-sdk-${C_SERVICE_NAME}") message(STATUS "generating client for ${C_SERVICE_NAME} version ${C_VERSION}") execute_process( - COMMAND ${PYTHON_CMD} scripts/generate_sdks.py --serviceName ${C_SERVICE_NAME} --apiVersion ${C_VERSION} ${ENABLE_VIRTUAL_OPERATIONS_ARG} --outputLocation ./ + COMMAND ${PYTHON3_CMD} scripts/legacy/generate_sdks.py --serviceName ${C_SERVICE_NAME} --apiVersion ${C_VERSION} ${ENABLE_VIRTUAL_OPERATIONS_ARG} --outputLocation ./ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) LIST(APPEND SDK_BUILD_LIST ${C_SERVICE_NAME}) @@ -198,7 +198,7 @@ function(add_sdks) # Generates SDK client based on aws-cpp-sdk-core-tests/resources/api-descriptions/document-test-2021-06-28.normal.json for functional testing. execute_process( - COMMAND ${PYTHON_CMD} scripts/generate_sdks.py --pathToApiDefinitions aws-cpp-sdk-core-tests/resources/api-descriptions --serviceName document-test --apiVersion 2021-06-28 --outputLocation ./ --prepareTool + COMMAND ${PYTHON3_CMD} scripts/legacy/generate_sdks.py --pathToApiDefinitions aws-cpp-sdk-core-tests/resources/api-descriptions --serviceName document-test --apiVersion 2021-06-28 --outputLocation ./ --prepareTool WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) message(STATUS "Generated service: document-test, version: 2021-06-28") diff --git a/scripts/build_3rdparty.py b/scripts/build_3rdparty.py deleted file mode 100644 index 25df7f7d65f..00000000000 --- a/scripts/build_3rdparty.py +++ /dev/null @@ -1,376 +0,0 @@ -# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -# SPDX-License-Identifier: Apache-2.0. -# - -import argparse -import os -import platform -import re -import sdk_directories -import shutil -import subprocess - -def GetBuildEnvironments(): - return { 'make' : { 'global_build_call' : [ "make" ], - 'parallel_option' : '-j??' }, - 'msbuild' : { 'global_build_call' : [ "msbuild", "ALL_BUILD.vcxproj" ], - 'parallel_option' : '-m:??' }, - 'nmake' : { 'global_build_call' : [ "nmake" ], - 'parallel_option' : '' }, - 'jom' : { 'global_build_call' : [ "jom" ], - 'parallel_option' : '-j??' } } - -def GetPlatformEnvironments(): - return { 'Windows' : { 'default_install_directory' : 'C:\\temp\\AWSNativeSDK' }, - 'Linux' : { 'default_install_directory' : '/tmp/AWSNativeSDK' }, - 'Darwin' : { 'default_install_directory' : '/tmp/AWSNativeSDK' } } - - -def GetPlatformBuildTargets(): - return { 'Windows' : { 'buildPlatforms' : [ 'Windows' ], - 'configs' : { 'DebugDynamic' : { 'directory' : '_build_windows_dynamic_debug', - 'cmake_params' : "-DSTATIC_LINKING=0 -DCMAKE_BUILD_TYPE=Debug", - 'build_params' : [ "-p:Configuration=Debug" ], - 'config' : 'Debug' }, - 'DebugStatic' : { 'directory' : '_build_windows_static_debug', - 'cmake_params' : "-DSTATIC_LINKING=1 -DCMAKE_BUILD_TYPE=Debug", - 'build_params' : [ "-p:Configuration=Debug" ], - 'config' : 'Debug' }, - 'ReleaseDynamic' : { 'directory' : '_build_windows_dynamic_release', - 'cmake_params' : "-DSTATIC_LINKING=0 -DCMAKE_BUILD_TYPE=Release", - 'build_params' : [ "-p:Configuration=Release" ], - 'config' : 'Release' }, - 'ReleaseStatic' : { 'directory' : '_build_windows_static_release', - 'cmake_params' : "-DSTATIC_LINKING=1 -DCMAKE_BUILD_TYPE=Release", - 'build_params' : [ "-p:Configuration=Release" ], - 'config' : 'Release' } }, - 'platform_install_qualifier' : "vs2013", - 'build_environment' : 'msbuild', - 'gen_param' : { 'x86' : "-G \"Visual Studio 12 2013\"", 'x86_64' : "-G \"Visual Studio 12 2013 Win64\"" }, - 'global_cmake_params' : "-DGENERATE_VERSION_INFO=0 -DSIMPLE_INSTALL=OFF -DENABLE_UNITY_BUILD=ON -DCMAKE_CONFIGURATION_TYPES=\"Debug;Release;MinSizeRel;RelWithDebInfo\" -DCMAKE_CXX_FLAGS_DEBUGOPT=\"\" -DCMAKE_EXE_LINKER_FLAGS_DEBUGOPT=\"\" -DCMAKE_SHARED_LINKER_FLAGS_DEBUGOPT=\"\"" }, - 'Windows2015' : { 'buildPlatforms' : [ 'Windows' ], - 'configs' : { 'DebugDynamic' : { 'directory' : '_build_windows_2015_dynamic_debug', - 'cmake_params' : "-DSTATIC_LINKING=0 -DCMAKE_BUILD_TYPE=Debug", - 'build_params' : [ "-p:Configuration=Debug" ], - 'config' : 'Debug' }, - 'DebugStatic' : { 'directory' : '_build_windows_2015_static_debug', - 'cmake_params' : "-DSTATIC_LINKING=1 -DCMAKE_BUILD_TYPE=Debug", - 'build_params' : [ "-p:Configuration=Debug" ], - 'config' : 'Debug' }, - 'ReleaseDynamic' : { 'directory' : '_build_windows_2015_dynamic_release', - 'cmake_params' : "-DSTATIC_LINKING=0 -DCMAKE_BUILD_TYPE=Release", - 'build_params' : [ "-p:Configuration=Release" ], - 'config' : 'Release' }, - 'ReleaseStatic' : { 'directory' : '_build_windows_2015_static_release', - 'cmake_params' : "-DSTATIC_LINKING=1 -DCMAKE_BUILD_TYPE=Release", - 'build_params' : [ "-p:Configuration=Release" ], - 'config' : 'Release' } }, - 'platform_install_qualifier' : "vs2015", - 'build_environment' : 'msbuild', - 'gen_param' : { 'x86' : "-G \"Visual Studio 14 2015\"", 'x86_64' : "-G \"Visual Studio 14 2015 Win64\"" }, - 'global_cmake_params' : "-DGENERATE_VERSION_INFO=0 -DSIMPLE_INSTALL=OFF -DENABLE_UNITY_BUILD=ON -DCMAKE_CONFIGURATION_TYPES=\"Debug;Release;MinSizeRel;RelWithDebInfo\" -DCMAKE_CXX_FLAGS_DEBUGOPT=\"\" -DCMAKE_EXE_LINKER_FLAGS_DEBUGOPT=\"\" -DCMAKE_SHARED_LINKER_FLAGS_DEBUGOPT=\"\"" }, - 'Windows2017' : { 'buildPlatforms' : [ 'Windows' ], - 'configs' : { 'DebugDynamic' : { 'directory' : '_build_windows_2017_dynamic_debug', - 'cmake_params' : "-DSTATIC_LINKING=0 -DCMAKE_BUILD_TYPE=Debug", - 'build_params' : [ "-p:Configuration=Debug" ], - 'config' : 'Debug' }, - 'DebugStatic' : { 'directory' : '_build_windows_2017_static_debug', - 'cmake_params' : "-DSTATIC_LINKING=1 -DCMAKE_BUILD_TYPE=Debug", - 'build_params' : [ "-p:Configuration=Debug" ], - 'config' : 'Debug' }, - 'ReleaseDynamic' : { 'directory' : '_build_windows_2017_dynamic_release', - 'cmake_params' : "-DSTATIC_LINKING=0 -DCMAKE_BUILD_TYPE=Release", - 'build_params' : [ "-p:Configuration=Release" ], - 'config' : 'Release' }, - 'ReleaseStatic' : { 'directory' : '_build_windows_2017_static_release', - 'cmake_params' : "-DSTATIC_LINKING=1 -DCMAKE_BUILD_TYPE=Release", - 'build_params' : [ "-p:Configuration=Release" ], - 'config' : 'Release' } }, - 'platform_install_qualifier' : "vs2017", - 'build_environment' : 'msbuild', - 'gen_param' : { 'x86' : "-G \"Visual Studio 15 2017\"", 'x86_64' : "-G \"Visual Studio 15 2017 Win64\"" }, - 'global_cmake_params' : "-DGENERATE_VERSION_INFO=0 -DSIMPLE_INSTALL=OFF -DENABLE_UNITY_BUILD=ON -DCMAKE_CONFIGURATION_TYPES=\"Debug;Release;MinSizeRel;RelWithDebInfo\" -DCMAKE_CXX_FLAGS_DEBUGOPT=\"\" -DCMAKE_EXE_LINKER_FLAGS_DEBUGOPT=\"\" -DCMAKE_SHARED_LINKER_FLAGS_DEBUGOPT=\"\"" }, - 'AndroidArm32' : { 'buildPlatforms' : [ 'Linux' ], - 'configs' : { 'DebugDynamic' : { 'directory' : '_build_android_arm_32_dynamic_debug', - 'cmake_params' : "-DSTATIC_LINKING=0 -DCMAKE_BUILD_TYPE=Debug", - 'build_params' : [], - 'config' : 'Debug' }, - 'DebugStatic' : { 'directory' : '_build_android_arm_32_dynamic_static', - 'cmake_params' : "-DSTATIC_LINKING=1 -DCMAKE_BUILD_TYPE=Debug", - 'build_params' : [], - 'config' : 'Debug' }, - 'ReleaseDynamic' : { 'directory' : '_build_android_arm_32_dynamic_release', - 'cmake_params' : "-DSTATIC_LINKING=0 -DCMAKE_BUILD_TYPE=Release", - 'build_params' : [], - 'config' : 'Release' }, - 'ReleaseStatic' : { 'directory' : '_build_android_arm_32_static_release', - 'cmake_params' : "-DSTATIC_LINKING=1 -DCMAKE_BUILD_TYPE=Release", - 'build_params' : [], - 'config' : 'Release' } }, - 'platform_install_qualifier' : "", - 'build_environment' : 'make', - 'gen_param' : { 'x86' : "", 'x86_64' : "" }, - 'global_cmake_params' : "-DSIMPLE_INSTALL=OFF " \ - "-DGENERATE_VERSION_INFO=0 " \ - "-DMINIMIZE_SIZE=ON " \ - "-DTARGET_ARCH=ANDROID "}, - 'AndroidArm64' : { 'buildPlatforms' : [ 'Linux' ], - 'configs' : { 'DebugDynamic' : { 'directory' : '_build_android_arm_64_dynamic_debug', - 'cmake_params' : "-DSTATIC_LINKING=0 -DCMAKE_BUILD_TYPE=Debug", - 'build_params' : [], - 'config' : 'Debug' }, - 'DebugStatic' : { 'directory' : '_build_android_arm_64_dynamic_static', - 'cmake_params' : "-DSTATIC_LINKING=1 -DCMAKE_BUILD_TYPE=Debug", - 'build_params' : [], - 'config' : 'Debug' }, - 'ReleaseDynamic' : { 'directory' : '_build_android_arm_64_dynamic_release', - 'cmake_params' : "-DSTATIC_LINKING=0 -DCMAKE_BUILD_TYPE=Release", - 'build_params' : [], - 'config' : 'Release' }, - 'ReleaseStatic' : { 'directory' : '_build_android_arm_64_static_release', - 'cmake_params' : "-DSTATIC_LINKING=1 -DCMAKE_BUILD_TYPE=Release", - 'build_params' : [], - 'config' : 'Release' } }, - 'platform_install_qualifier' : "", - 'build_environment' : 'make', - 'gen_param' : { 'x86' : "", 'x86_64' : "" }, - 'global_cmake_params' : "-DSIMPLE_INSTALL=OFF " \ - "-DGENERATE_VERSION_INFO=0 " \ - "-DMINIMIZE_SIZE=ON " \ - "-DTARGET_ARCH=ANDROID " \ - "-DANDROID_ABI=arm64-v8a "}, - 'Linux' : { 'buildPlatforms' : [ 'Linux' ], - 'configs' : { 'DebugDynamic' : { 'directory' : '_build_linux_dynamic_debug', - 'cmake_params' : "-DSTATIC_LINKING=0 -DCMAKE_BUILD_TYPE=Debug", - 'build_params' : [], - 'config' : 'Debug' }, - 'DebugStatic' : { 'directory' : '_build_linux_dynamic_static', - 'cmake_params' : "-DSTATIC_LINKING=1 -DCMAKE_BUILD_TYPE=Debug", - 'build_params' : [], - 'config' : 'Debug' }, - 'ReleaseDynamic' : { 'directory' : '_build_linux_dynamic_release', - 'cmake_params' : "-DSTATIC_LINKING=0 -DCMAKE_BUILD_TYPE=Release", - 'build_params' : [], - 'config' : 'Release' }, - 'ReleaseStatic' : { 'directory' : '_build_linux_static_release', - 'cmake_params' : "-DSTATIC_LINKING=1 -DCMAKE_BUILD_TYPE=Release", - 'build_params' : [], - 'config' : 'Release' } }, - 'platform_install_qualifier' : "", - 'build_environment' : 'make', - 'gen_param' : { 'x86' : "-DCMAKE_CXX_FLAGS=-m32", 'x86_64' : "" }, - 'global_cmake_params' : "-DSIMPLE_INSTALL=OFF -DGENERATE_VERSION_INFO=0 -DENABLE_UNITY_BUILD=ON" }, - 'Darwin' : { 'buildPlatforms' : [ 'Darwin' ], - 'configs' : { 'DebugDynamic' : { 'directory' : '_build_darwin_dynamic_debug', - 'cmake_params' : "-DSTATIC_LINKING=0 -DCMAKE_BUILD_TYPE=Debug", - 'build_params' : [], - 'config' : 'Debug' }, - 'DebugStatic' : { 'directory' : '_build_darwin_dynamic_static', - 'cmake_params' : "-DSTATIC_LINKING=1 -DCMAKE_BUILD_TYPE=Debug", - 'build_params' : [], - 'config' : 'Debug' }, - 'ReleaseDynamic' : { 'directory' : '_build_darwin_dynamic_release', - 'cmake_params' : "-DSTATIC_LINKING=0 -DCMAKE_BUILD_TYPE=Release", - 'build_params' : [], - 'config' : 'Release' }, - 'ReleaseStatic' : { 'directory' : '_build_darwin_static_release', - 'cmake_params' : "-DSTATIC_LINKING=1 -DCMAKE_BUILD_TYPE=Release", - 'build_params' : [], - 'config' : 'Release' } }, - 'platform_install_qualifier' : "", - 'build_environment' : 'make', - 'gen_param' : { 'x86' : "-DCMAKE_CXX_FLAGS=-m32", 'x86_64' : "" }, - 'global_cmake_params' : "-DSIMPLE_INSTALL=OFF -DGENERATE_VERSION_INFO=0 " } } - - -def ParseArguments(platformEnvironments): - argMap = {} - - platformName = platform.system() - platformEnv = platformEnvironments[ platformName ] - - parser = argparse.ArgumentParser(description="AWSNativeSDK 3rdParty Install Script") - parser.add_argument("--installdir", action="store") - parser.add_argument("--cmake_params", action="store") - parser.add_argument("--architecture", action="store") - parser.add_argument("--configs", action="store") - parser.add_argument("--parallel", action="store") - parser.add_argument("--generateClients", action="store") - parser.add_argument("--sourcedir", action="store") - parser.add_argument("--customMemoryManagement", action="store") - parser.add_argument("--enableRtti", action="store") - parser.add_argument("--cpuArchitecture", action="store") - parser.add_argument("--customplatformdir", action="store") - - args = vars( parser.parse_args() ) - argMap[ "installDir" ] = args[ "installdir" ] or platformEnv['default_install_directory'] - argMap[ "cmakeParams" ] = re.sub(r'^"|"$', '', args[ "cmake_params" ] or "") - argMap[ "architecture" ] = re.sub(r'^"|"$', '', args[ "architecture" ] or platformName) - argMap[ "configs" ] = re.sub(r'^"\"$', '', args[ "configs" ] or "DebugStatic DebugDynamic ReleaseDynamic ReleaseStatic").split() - argMap[ "parallel" ] = args[ "parallel" ] or "" - argMap[ "generateClients" ] = args[ "generateClients" ] or "0" - argMap[ "sourcedir" ] = args[ "sourcedir"] or ".." - argMap[ "customMemoryManagement" ] = args[ "customMemoryManagement"] or "1" - argMap[ "enableRtti" ] = args[ "enableRtti"] or "0" - argMap[ "cpuArchitecture" ] = args[ "cpuArchitecture" ] or "x86_64" - argMap[ "customplatformdir" ] = args[ "customplatformdir" ] or "" - - return argMap - - -def CopyPDBs(config, libDir, installDirectoryPrefix, platformInstallQualifier, cpuArch): - - destDirectory = os.path.join(installDirectoryPrefix, libDir, "windows", cpuArch, platformInstallQualifier, config) - - for rootDir, dirNames, fileNames in os.walk( "." ): - if rootDir == ".": - for dirName in dirNames: - - sourceFile = os.path.join(rootDir, dirName, config, dirName + ".pdb") - if os.path.isfile(sourceFile) and not dirName.endswith("-tests"): - subprocess.check_call( "copy " + sourceFile + " \"" + destDirectory + "\"", shell = True ) - - -def CopyAndroidExternalDependencies(config, installDirectory): - for dependentLib in [ "zlib", "openssl", "curl" ]: - uppercaseLib = dependentLib.upper() - dependentInstallFile = os.path.join( uppercaseLib + "-prefix", "src", uppercaseLib + "-build", "cmake_install.cmake" ) - dependentInstallDirectory = '"' + os.path.join( installDirectory, "external", dependentLib ) + '"' - dependent_install_call = "cmake -DCMAKE_INSTALL_CONFIG_NAME=" + config + " -DCMAKE_INSTALL_PREFIX=" + dependentInstallDirectory + " -P " + dependentInstallFile + " .." - print( "dependent install call = " + dependent_install_call ) - subprocess.check_call( dependent_install_call, shell = True ) - - -def RemoveExternalAndroidDirectories(): - for directory in [ "external", "zlib", "openssl", "curl" ]: - if os.path.exists( directory ): - shutil.rmtree( directory ) - - -def Main(): - platformBuildTargets = GetPlatformBuildTargets() - platformEnvironments = GetPlatformEnvironments() - buildEnvironments = GetBuildEnvironments() - - sourcePlatform = platform.system() - if not sourcePlatform in platformEnvironments: - print( "Platform " + sourcePlatform + " not supported as a build platform" ) - return 1 - - platformEnv = platformEnvironments[ sourcePlatform ] - - arguments = ParseArguments(platformEnvironments) - - customCmakeParams = arguments[ "cmakeParams" ] + " " - architecture = arguments[ "architecture" ] - targetConfigs = arguments[ "configs" ] - installDirectory = arguments[ "installDir" ] - parallelJobs = arguments[ "parallel" ] - quotedInstallDirectory = '"' + installDirectory + '"' - generateClients = arguments[ "generateClients" ] - sourceDir = arguments["sourcedir" ] - quotedSourceDir = '"' + sourceDir + '"' - customMemoryManagement = arguments["customMemoryManagement"] - enableRtti = arguments["enableRtti"] - cpuArch = arguments["cpuArchitecture"] - windowsCpuArch = "intel64" - - if cpuArch == "x86": - windowsCpuArch = "ia32" - - customPlatformDir = arguments[ "customplatformdir" ] - if customPlatformDir != "" and os.path.exists( customPlatformDir ): - import sys - sys.path.insert(0, os.path.join(customPlatformDir, 'scripts')) - - import build_custom_3rdparty - customTargets = build_custom_3rdparty.GetPlatformBuildTargets() - for k in customTargets: - platformBuildTargets[ k ] = customTargets[ k ] - - if os.path.exists( installDirectory ): - shutil.rmtree( installDirectory ) - - if not architecture in platformBuildTargets: - print( "No definition for target architecture " + architecture ) - return 1 - - targetPlatformDef = platformBuildTargets[ architecture ] - if not sourcePlatform in targetPlatformDef[ 'buildPlatforms' ]: - print( "Platform " + sourcePlatform + " does not support building for architecture " + architecture ) - return 1 - - buildEnvironment = buildEnvironments[ targetPlatformDef[ 'build_environment' ] ] - - if architecture[:7] == 'Android': - RemoveExternalAndroidDirectories() - - archConfigs = targetPlatformDef[ 'configs' ] - - if generateClients != "0": - sdk_directories.wipeGeneratedCode() - customCmakeParams += "-DREGENERATE_CLIENTS=1 " - - if customMemoryManagement == "0": - customCmakeParams += "-DCUSTOM_MEMORY_MANAGEMENT=OFF " - else: - customCmakeParams += "-DCUSTOM_MEMORY_MANAGEMENT=ON " - - if enableRtti == "0": - customCmakeParams += "-DENABLE_RTTI=OFF " - else: - customCmakeParams += "-DENABLE_RTTI=ON " - - for targetConfig in targetConfigs: - if targetConfig in archConfigs: - archConfig = archConfigs[ targetConfig ] - buildDirectory = archConfig[ 'directory' ] - if os.path.exists( buildDirectory ): - shutil.rmtree( buildDirectory ) - - os.mkdir( buildDirectory ) - os.chdir( buildDirectory ) - cmake_call_list = "cmake " + customCmakeParams + " " + archConfig[ 'cmake_params' ] + " " + targetPlatformDef[ 'gen_param' ][cpuArch] + " " + targetPlatformDef[ 'global_cmake_params' ] - if targetPlatformDef[ 'platform_install_qualifier' ] != "": - cmake_call_list = cmake_call_list + " -DPLATFORM_INSTALL_QUALIFIER=" + targetPlatformDef[ 'platform_install_qualifier' ] - - if customPlatformDir != "": - cmake_call_list = cmake_call_list + " -DCUSTOM_PLATFORM_DIR=\"" + customPlatformDir + "\"" - - cmake_call_list = cmake_call_list + " " + quotedSourceDir - print( "cmake call = " + cmake_call_list ) - subprocess.check_call( cmake_call_list, shell = True ) - - parallelBuildOption = buildEnvironment[ 'parallel_option' ].replace("??", str(parallelJobs)) - build_call_list = buildEnvironment[ 'global_build_call' ] + archConfig[ 'build_params' ] - if parallelBuildOption != "": - build_call_list = build_call_list + [ parallelBuildOption ] - print( "build call = " + str( build_call_list ) ) - subprocess.check_call( build_call_list ) - - install_call = "cmake -DCMAKE_INSTALL_CONFIG_NAME=" + archConfig[ 'config' ] + " -DCMAKE_INSTALL_PREFIX=" + quotedInstallDirectory + " -P cmake_install.cmake " + quotedSourceDir - print( "install call = " + install_call ) - subprocess.check_call( install_call, shell = True ) - - # platform specific stuff - - # Copy Windows PDBs - if architecture.startswith('Windows') and targetConfig.endswith("Dynamic"): - CopyPDBs( archConfig[ 'config' ], "bin", installDirectory, targetPlatformDef[ 'platform_install_qualifier' ], windowsCpuArch ) - - # Install Android auxiliary dependencies (zlib, openssl, curl) - if architecture == 'Android': - CopyAndroidExternalDependencies( archConfig[ 'config' ], installDirectory ) - - os.chdir( ".." ) - - else: - print("Build target config " + targetConfig + " does not exist for architecture " + architecture) - - print( "Aws SDK for C++ finished 3rd party installation into: " + installDirectory ) - - -# On windows: Run from powershell; make sure msbuild is in PATH environment variable -Main() - - diff --git a/scripts/build_example.py b/scripts/build_example.py deleted file mode 100644 index ba0f19b9605..00000000000 --- a/scripts/build_example.py +++ /dev/null @@ -1,93 +0,0 @@ -# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -# SPDX-License-Identifier: Apache-2.0. -# -import os -import argparse -import os -import shutil -import subprocess - -def GetBuildEnvironments(): - return { 'Windows2017' : { 'global_build_call' : 'msbuild ALL_BUILD.vcxproj', - 'parallel_option' : ' -m:??', - 'configs': ' -p:Configuration=??', - 'generator_param' : { - 'x86' : ' -G \"Visual Studio 15 2017\"', - 'x86_64' : ' -G \"Visual Studio 15 2017 Win64\"'} }, - 'Ubuntu' : { 'global_build_call' : 'make', - 'parallel_option' : ' -j??', - 'configs': '', - 'generator_param' : { - 'x86' : ' -DCMAKE_CXX_FLAGS=-m32', - 'x86_64' : ''} } } - -def ParseArguments(): - argMap = {} - - parser = argparse.ArgumentParser(description="AWSNativeSDK Run all examples from Github aws-doc-sdk-examples repository.") - parser.add_argument("--platform", action="store") - parser.add_argument("--cpuArchitecture", action="store") - parser.add_argument("--configs", action="store") - parser.add_argument("--parallel", action="store") - parser.add_argument("--sdkInstallDir", action="store") - parser.add_argument("--exampleSourceDir", action="store") - - args = vars( parser.parse_args() ) - argMap[ "platform" ] = args[ "platform" ] or "Ubuntu" - argMap[ "configs" ] = args[ "configs" ] or "Debug" - argMap[ "cpuArchitecture" ] = args[ "cpuArchitecture"] or "x86_64" - argMap[ "parallel" ] = args[ "parallel" ] or "8" - argMap[ "sdkInstallDir" ] = args[ "sdkInstallDir" ] or "./install" - argMap[ "exampleSourceDir" ] = args[ "exampleSourceDir" ] or os.path.join("aws-doc-sdk-examples", "cpp", "example_code") - - return argMap - -def BuildExample(platform, cpuArchitecture, buildDir, buildType, sdkInstallDir, sourceDir, parallel): - buildEnvironment = GetBuildEnvironments() - - if os.path.exists(buildDir): - shutil.rmtree(buildDir) - os.mkdir(buildDir) - os.chdir(buildDir) - - cmake_call = "cmake" + buildEnvironment[ platform ][ "generator_param" ][ cpuArchitecture ] - cmake_call = cmake_call + " -DBUILD_SHARED_LIBS=ON" - cmake_call = cmake_call + " -DCMAKE_BUILD_TYPE=" + buildType - cmake_call = cmake_call + " -DCMAKE_PREFIX_PATH=" + sdkInstallDir - cmake_call = cmake_call + " -DAWSSDK_ROOT_DIR=" + sdkInstallDir - cmake_call = cmake_call + " " + sourceDir - print("cmake call = " + cmake_call) - subprocess.check_call(cmake_call, shell = True) - - build_call = buildEnvironment[ platform ][ 'global_build_call' ] - build_call = build_call + buildEnvironment[ platform ][ 'configs' ].replace("??", buildType) - build_call = build_call + buildEnvironment[ platform ][ 'parallel_option' ].replace("??", parallel) - print("build call = " + build_call) - subprocess.check_call(build_call, shell = True) - -def Main(): - arguments = ParseArguments() - currentDirectory = os.getcwd() - - quotedSdkInstallDir = '"' + os.path.abspath(arguments[ "sdkInstallDir" ]) + '"' - exampleSourceDir = os.path.abspath(arguments[ "exampleSourceDir" ]) - - for serviceName in os.listdir(exampleSourceDir): - serviceDir = os.path.join(exampleSourceDir, serviceName) - if not os.path.isdir(serviceDir): - continue - else: - if any(str(file) == "CMakeLists.txt" for file in os.listdir(serviceDir)): - if serviceName == "redshift": - continue - os.chdir(currentDirectory) - BuildExample(platform = arguments[ "platform" ], - cpuArchitecture = arguments[ "cpuArchitecture" ], - buildDir = os.path.join(currentDirectory, serviceName), - buildType = arguments[ "configs" ], - sdkInstallDir = quotedSdkInstallDir, - sourceDir = serviceDir, - parallel = arguments[ "parallel" ]) - -# Run from powershell; make sure msbuild is in PATH environment variable -Main() diff --git a/scripts/dummy_web_server.py b/scripts/dummy_web_server.py deleted file mode 100755 index 82250766d31..00000000000 --- a/scripts/dummy_web_server.py +++ /dev/null @@ -1,145 +0,0 @@ -#!/usr/bin/env python3 -#https://gist.github.com/bradmontgomery/2219997 -""" -Very simple HTTP server in python (Updated for Python 3.7) -Usage: - ./dummy-web-server.py -h - ./dummy-web-server.py -l localhost -p 8000 -Send a GET request: - curl http://localhost:8000 -Send a HEAD request: - curl -I http://localhost:8000 -Send a POST request: - curl -d "foo=bar&bin=baz" http://localhost:8000 -""" -import argparse -import time -import socket -from http.server import HTTPServer, BaseHTTPRequestHandler - -class Handler(BaseHTTPRequestHandler): - - def handle_one_request(self): - """Handle a single HTTP request. - You normally don't need to override this method; see the class - __doc__ string for information on how to handle specific HTTP - commands such as GET and POST. - """ - - try: - self.raw_requestline = self.rfile.readline(65537) - if len(self.raw_requestline) > 65536: - self.requestline = '' - self.request_version = '' - self.command = '' - self.send_error(414) - return - - if not self.raw_requestline: - self.close_connection = 1 - return - - if not self.parse_request(): - # An error code has been sent, just exit - return - mname = 'do_' + self.command - if not hasattr(self, mname): - self.send_error(501, "Unsupported method (%r)" % self.command) - return - method = getattr(self, mname) - method() - #add verification of wfile is closed or not - if not self.wfile.closed: - # actually send the response if not already done. - self.wfile.flush() - except socket.timeout as e: - #a read or a write timed out. Discard this connection - self.log_error("Request timed out: %r", e) - self.close_connection = 1 - return - - def _set_headers(self): - self.send_response(200) - self.send_header("Content-type", "text/html") - self.end_headers() - - def _html(self, message): - """This just generates an HTML document that includes `message` - in the body. Override, or re-write this do do more interesting stuff. - """ - content = "

{}

".format(message); - return content.encode("utf8") # NOTE: must return a bytes object! - - def do_GET(self): - - waitSeconds = self.headers.get('WaitSeconds', 0) # 0 means default return - time.sleep(float(waitSeconds)) - try: - self._set_headers() - self.wfile.write(self._html("hi!")) - except socket.error as e: - print ("socket.error : Connection broke. Aborting" + str(e)) - self.wfile._sock.close() - self.wfile._sock = None - return False - - def do_HEAD(self): - waitSeconds = self.headers.get('WaitSeconds', 0) - time.sleep(float(waitSeconds)) - self._set_headers() - - def do_POST(self): - # Doesn't do anything with posted data - waitSeconds = self.headers.get('WaitSeconds', 0) - time.sleep(float(waitSeconds)) - self._set_headers() - self.wfile.write(self._html("POST!")) - -class StoppableServer(HTTPServer): - - stopped = False - def serve_forever(self): - while not self.stopped: - self.handle_request() - - def stop_server(self): - self.server_close() - self.stopped = True - - -def run(server_class=StoppableServer, handler_class=Handler, addr="localhost", port=8000): - server_address = (addr, port) - httpd = server_class(server_address, handler_class) - - print("Starting httpd server on {}:{}.".format(addr, port)) - httpd.serve_forever() - httpd.stop_server() - - -if __name__ == "__main__": - - parser = argparse.ArgumentParser(description="Run a simple HTTP server") - parser.add_argument( - "-l", - "--listen", - default="localhost", - help="Specify the IP address on which the server listens", - ) - parser.add_argument( - "-p", - "--port", - type=int, - default=8000, - help="Specify the port on which the server listens", - ) - parser.add_argument( - "-w", - "--wait", - type=float, - default=0, - help="Specify the seconds(could be 0.001 as 1 ms) on which the server sleep before sending data back", - ) - - args = parser.parse_args() - waitSeconds = args.wait - run(addr=args.listen, port=args.port) diff --git a/scripts/endpoints_checker.py b/scripts/endpoints_checker.py index befe2054fa9..80fc38170d0 100644 --- a/scripts/endpoints_checker.py +++ b/scripts/endpoints_checker.py @@ -2,121 +2,148 @@ # SPDX-License-Identifier: Apache-2.0. # -# This script is used to check aws-cpp-sdk source file to identify hard coded endpoints in source code. -# This identification action is corresponding to a COE https://coe.amazon.com/coes/70203. -# Complete endpoints list can be found at http://docs.aws.amazon.com/general/latest/gr/rande.html -# Some appearances of endpoints in source files are intentional based on api description such as files' name end with [svc]Endpoint.cpp [svc]/model/*Region.cpp and etc. -# These files can be white listed during checking by adding skip pattern in below SkipFile function. -# Files will be comments-stripped before checking to avoid false alarm. -# If identified, file name, the first appearance of hard coded endpoints and context will be output to command-line. -# The exit code will be 1 if identified any file with hard coded endpoints, 0 otherwise. - import os import re """ -endpoints = ["us-east-1", "us-east-2", - "us-west-1", "us-west-2", - "eu-west-1", "eu-west-2", "eu-west-3", "eu-central-1", "eu-north-1", - "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2", "ap-northeast-3", "ap-south-1", "ap-east-1", - "sa-east-1", - "cn-north-1", "cn-northwest-1", - "ca-central-1", - "us-gov-west-1","us-gov-east-1", - "us-iso-west-1", - "me-south-1", - "af-south-1"]; +endpoints = [ + "us-east-1", "us-east-2", + "us-west-1", "us-west-2", + "eu-west-1", "eu-west-2", "eu-west-3", + "eu-central-1", + "eu-north-1", + "ap-southeast-1", "ap-southeast-2", + "ap-northeast-1", "ap-northeast-2", "ap-northeast-3", + "ap-south-1", + "ap-east-1", + "sa-east-1", + "cn-north-1", + "cn-northwest-1", + "ca-central-1", + "us-gov-west-1","us-gov-east-1", + "us-iso-west-1", + "me-south-1", + "af-south-1" + ]; """ -def RemoveCPPComments(text): + +def remove_cpp_comments(text): def replacer(match): - s = match.group(0); + s = match.group(0) if s.startswith('/'): - return " "; # int/**/x=5 -> int x=5, instead of intx=5. + return " " # int/**/x=5 -> int x=5, instead of intx=5. else: - return s; - pattern = re.compile(r'//.*?$|/\*.*?\*/|"(?:\\.|[^\\"])*"', re.DOTALL | re.MULTILINE); - return re.sub(pattern, replacer, text); - -def SkipFile(fileName): - skipFilePattern = re.compile(r'.*source\/model\/BucketLocationConstraint\.cpp' - '|.*source\/S3Client\.cpp' - '|.*source\/model\/.*Region.*\.cpp' - '|.*source\/[^\/]+Endpoint\.cpp' - '|.*aws-cpp-sdk-core\/include\/aws\/core/\Region.h' - '|.*tests\/.*Test\.cpp' - # add more white lists here - ); - if skipFilePattern.match(fileName): - return True; - return False; - -def ScanContent(content): - EndpointsPattern = re.compile(r'us-east-1|us-east-2|us-west-1|us-west-2|eu-west-1|eu-west-2|eu-west-3|eu-central-1|eu-north-1|ap-southeast-1|ap-southeast-2|ap-northeast-1|ap-northeast-2|ap-northeast-3|ap-south-1|sa-east-1|sa-east-1|cn-north-1|cn-northwest-1|ca-central-1|us-gov-west-1|us-gov-east-1|me-south-1|af-south-1'); - return re.search(EndpointsPattern, content); - -def CheckFile(inputFile): - if SkipFile(inputFile): - return False; - - with open(inputFile) as ftarget: - content = ftarget.read(); - - strippedContent = RemoveCPPComments(content); - match = ScanContent(strippedContent); + return s + + pattern = re.compile(r'//.*?$|/\*.*?\*/|"(?:\\.|[^\\"])*"', re.DOTALL | re.MULTILINE) + return re.sub(pattern, replacer, text) + + +def skip_file(filename): + skip_file_pattern = re.compile(r'.*source/model/BucketLocationConstraint.cpp' + '|.*source/S3Client.cpp' + '|.*source/model/.*Region.*.cpp' + '|.*source/[^/]+Endpoint.cpp' + '|.*aws-cpp-sdk-core/include/aws/core/Region.h' + '|.*tests/.*Test.cpp' + # add more white lists here + ) + if skip_file_pattern.match(filename): + return True + return False + + +def scan_content(content): + endpoints_pattern = re.compile( + r'us-east-1|us-east-2|' + r'us-west-1|us-west-2|' + r'eu-west-1|eu-west-2|eu-west-3|' + r'eu-central-1|' + r'eu-north-1|' + r'ap-southeast-1|ap-southeast-2|' + r'ap-northeast-1|ap-northeast-2|ap-northeast-3|' + r'ap-south-1|' + r'ap-east-1|' + r'sa-east-1|' + r'cn-north-1|' + r'cn-northwest-1|' + r'ca-central-1|' + r'us-gov-west-1|us-gov-east-1|' + r'us-iso-west-1|' + r'me-south-1|' + r'af-south-1') + return re.search(endpoints_pattern, content) + + +def check_file(input_file): + if skip_file(input_file): + return False + + with open(input_file) as input_file_handler: + content = input_file_handler.read() + + stripped_content = remove_cpp_comments(content) + match = scan_content(stripped_content) if match: - print inputFile; - print "..." + strippedContent[match.start() : match.end()] + "..."; - return True; - - return False; - -###################Test Start##################################### -assert RemoveCPPComments("") == ""; -assert RemoveCPPComments("/") == "/"; -assert RemoveCPPComments("//") == " "; -assert RemoveCPPComments("abc//test") == "abc "; -assert RemoveCPPComments("//test") == " "; -assert RemoveCPPComments("abc") == "abc"; -assert RemoveCPPComments("/abc") == "/abc"; -assert RemoveCPPComments("/abc/") == "/abc/"; -assert RemoveCPPComments("/**/") == " "; -assert RemoveCPPComments("/*") == "/*"; -assert RemoveCPPComments("*/") == "*/"; -assert RemoveCPPComments("/*/") == "/*/"; -assert RemoveCPPComments("\"") == "\""; -assert RemoveCPPComments(r'"Hello \"/*test*/World\""') == r'"Hello \"/*test*/World\""'; -assert RemoveCPPComments("/*abc*/") == " "; -assert RemoveCPPComments(r'abc="//"//comments') == r'abc="//" '; -assert RemoveCPPComments(r'abc="/*inner comments*/"/*\ - multiline\ - comments*/') == r'abc="/*inner comments*/" '; - -assert SkipFile("source/model/Regionabc.cpp") == True; -assert SkipFile("source/model/abcRegion.cpp") == True; -assert SkipFile("source/abcEndpoint.cpp") == True; -assert SkipFile("aws-cpp-sdk-core/include/aws/core/Region.h") == True; -assert SkipFile("aws-cpp-sdk-s3/source/model/BucketLocationConstraint.cpp") == True; -assert SkipFile("aws-cpp-sdk-s3/source/S3Client.cpp") == True; -assert SkipFile("source/model/abc.cpp") == False; -assert SkipFile("source/model/absEndpoint.cpp") == False; -assert SkipFile("source/model/Endpointabs.cpp") == False; -assert SkipFile("Endpoint.cpp") == False; - -assert ScanContent("us-west-1") != None; -assert ScanContent("avbcap-southeast-1") != None; -assert ScanContent("eu-central-1") != None; -assert ScanContent("\"cn-north-1 is in BJS\"") != None; -assert ScanContent("\"cn-north-2 doesn't exist\"") == None; - -###################Test End###################################### -print "Start checking hard coded endpoints in source files..."; -exitCode = 0; -RootDir = os.path.dirname(os.path.dirname(os.path.realpath(__file__))); -for root, dirnames, fileNames in os.walk(RootDir): - for fileName in fileNames: - if not root.endswith('-tests') and fileName.endswith(('.h', '.cpp')): - targetFile = os.path.join(root, fileName); - exitCode |= CheckFile(targetFile); -print "Finished checking hard coded endpoints in source files with exit code",exitCode,"."; -exit(exitCode); + print(input_file) + print("..." + stripped_content[match.start(): match.end()] + "...") + return True + + return False + + +def main(): + # Test Start + assert remove_cpp_comments("") == "" + assert remove_cpp_comments("/") == "/" + assert remove_cpp_comments("//") == " " + assert remove_cpp_comments("abc//test") == "abc " + assert remove_cpp_comments("//test") == " " + assert remove_cpp_comments("abc") == "abc" + assert remove_cpp_comments("/abc") == "/abc" + assert remove_cpp_comments("/abc/") == "/abc/" + assert remove_cpp_comments("/**/") == " " + assert remove_cpp_comments("/*") == "/*" + assert remove_cpp_comments("*/") == "*/" + assert remove_cpp_comments("/*/") == "/*/" + assert remove_cpp_comments("\"") == "\"" + assert remove_cpp_comments(r'"Hello \"/*test*/World\""') == r'"Hello \"/*test*/World\""' + assert remove_cpp_comments("/*abc*/") == " " + assert remove_cpp_comments(r'abc="//"//comments') == r'abc="//" ' + assert remove_cpp_comments(r'abc="/*inner comments*/"/*\ + multiline\ + comments*/') == r'abc="/*inner comments*/" ' + + assert skip_file("source/model/Regionabc.cpp") is True + assert skip_file("source/model/abcRegion.cpp") is True + assert skip_file("source/abcEndpoint.cpp") is True + assert skip_file("aws-cpp-sdk-core/include/aws/core/Region.h") is True + assert skip_file("aws-cpp-sdk-s3/source/model/BucketLocationConstraint.cpp") is True + assert skip_file("aws-cpp-sdk-s3/source/S3Client.cpp") is True + assert skip_file("source/model/abc.cpp") is False + assert skip_file("source/model/absEndpoint.cpp") is False + assert skip_file("source/model/Endpointabs.cpp") is False + assert skip_file("Endpoint.cpp") is False + + assert scan_content("us-west-1") is not None + assert scan_content("avbcap-southeast-1") is not None + assert scan_content("eu-central-1") is not None + assert scan_content("\"cn-north-1 is in BJS\"") is not None + assert scan_content("\"cn-north-2 doesn't exist\"") is None + # Test End + + print("Start checking hard coded endpoints in source files...") + exit_code = 0 + root_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) + for root, dirnames, file_names in os.walk(root_dir): + for fileName in file_names: + if not root.endswith('-tests') and fileName.endswith(('.h', '.cpp')): + target_file = os.path.join(root, fileName) + exit_code |= check_file(target_file) + print("Finished checking hard coded endpoints in source files with exit code", exit_code, ".") + exit(exit_code) + + +if __name__ == "__main__": + main() diff --git a/scripts/gather_3rdparty.py b/scripts/gather_3rdparty.py deleted file mode 100644 index 9ddcae51fff..00000000000 --- a/scripts/gather_3rdparty.py +++ /dev/null @@ -1,208 +0,0 @@ -# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -# SPDX-License-Identifier: Apache-2.0. -# - -import argparse -import os -import platform -import shutil -import subprocess -import time - -def GetPlatformEnvironments(): - return { 'Windows' : { 'destination_directory' : 'C:\\temp' }, - 'Linux' : { 'destination_directory' : '/tmp' }, - 'Darwin' : { 'destination_directory' : '/tmp' } } - -def GetGeneratedSDKs(): - return [ #"acm", - #"apigateway", - "autoscaling", - #"cloudhsm", - "cloudformation", - "cloudfront", - #"cloudsearch", - #"cloudsearchdomain", - #"cloudtrail", - #"codecommit", - "codedeploy", - #"codepipeline", - "cognito-identity", - #"cognito-sync", - #"config", - #"datapipeline", - #"devicefarm", - #"directconnect", - #"ds", - "dynamodb", - #"ec2", - "ecs", - #"ecr", - "elasticache", - "elasticbeanstalk", - "elasticfilesystem", - "elasticloadbalancing", - "elasticmapreduce", - "elastictranscoder", - "email", - #"es", - #"events", - #"firehose", - "gamelift", - "glacier", - "iam", - #"importexport", - #"inspector", - #"iot", - "kinesis", - "kms", - "lambda", - "logs", - "machinelearning", - #"marketplacecommerceanalytics", - "mobileanalytics", - "monitoring", - "opsworks", - "rds", - "redshift", - #"route53", - #"route53domains", - "s3", - "sdb", - "sns", - "sqs", - #"ssm", - #"storagegateway", - "sts", - #"support", - "swf" - #"waf", - #"workspaces" - ] - -def GetGeneratedSDKDirectories(): - return [ "aws-cpp-sdk-" + dir for dir in GetGeneratedSDKs() ] - -def GetC2JFiles(): - sdks = GetGeneratedSDKs() - apiDir = os.path.join( os.getcwd(), "code-generation", "api-descriptions" ) - fileList = [] - for baseDir, dirNames, fileNames in os.walk( apiDir ): - if baseDir == apiDir: - for fileName in fileNames: - for sdk in sdks: - if fileName.startswith(sdk): - fileList.append(fileName) - break - - return fileList - - - -def GetTestDirectories(): - return [ "testing-resources", - "aws-cpp-sdk-transfer-tests", - "aws-cpp-sdk-sqs-integration-tests", - "aws-cpp-sdk-s3-integration-tests", - "aws-cpp-sdk-redshift-integration-tests", - "aws-cpp-sdk-lambda-integration-tests", - "aws-cpp-sdk-identity-management-tests", - "aws-cpp-sdk-dynamodb-integration-tests", - "aws-cpp-sdk-cognitoidentity-integration-tests", - "aws-cpp-sdk-cloudfront-integration-tests", - "aws-cpp-sdk-core-tests", - "android-unified-tests" ] - -def GetCoreDirectories(): - return [ "aws-cpp-sdk-core", os.path.join("code-generation", "generator", "src"), "scripts", "doxygen", "android-build" ] - -def GetHighLevelSDKDirectories(): - return [ "aws-cpp-sdk-access-management", - "aws-cpp-sdk-identity-management", - "aws-cpp-sdk-queues", - "aws-cpp-sdk-transfer" ] - -def GetAllDirectories(): - return GetCoreDirectories() + GetGeneratedSDKDirectories() + GetTestDirectories() + GetHighLevelSDKDirectories() - -def GetLooseFiles(): - return [ "CMakeLists.txt", - "LICENSE.txt", - "NOTICE.txt", - "README.md", - os.path.join("toolchains", "android.toolchain.cmake"), - os.path.join("code-generation", "generator", "LICENSE.txt"), - os.path.join("code-generation", "generator", "NOTICE.txt"), - os.path.join("code-generation", "generator", "pom.xml")] - - -def ParseArguments(platformEnv): - argMap = {} - - parser = argparse.ArgumentParser(description="AWSNativeSDK 3rdParty Gather Script") - parser.add_argument("--destdir", action="store") - - args = vars( parser.parse_args() ) - argMap[ "destDir" ] = args[ "destdir" ] or platformEnv['destination_directory'] - - return argMap - - - -def Main(): - platformEnvironments = GetPlatformEnvironments() - platformEnv = platformEnvironments[ platform.system() ] - arguments = ParseArguments(platformEnv) - - baseDir = arguments[ "destDir" ] - sdkDir = "aws-sdk-cpp" - uploadFilename = "latestSnapshot.zip" - destDir = os.path.join(baseDir, sdkDir) - uploadZipFile = os.path.join( baseDir, uploadFilename ) - - if os.path.exists( destDir ): - shutil.rmtree( destDir ) - - if os.path.exists( uploadZipFile ): - os.remove( uploadZipFile ) - - time.sleep(2) - - os.makedirs( destDir ) - - # copy all files needed - sourceDir = os.getcwd() - for dir in GetAllDirectories(): - sourceTree = os.path.join( sourceDir, dir ) - destTree = os.path.join( destDir, dir ) - shutil.copytree( sourceTree, destTree ) - - for filename in GetLooseFiles(): - sourceFile = os.path.join( sourceDir, filename ) - destFile = os.path.join(destDir, filename) - fileDestDir = os.path.dirname(destFile) - if( not os.path.exists( fileDestDir ) ): - os.makedirs( fileDestDir ) - - shutil.copy( sourceFile, os.path.join(destDir, filename) ) - - # c2j files need to be individually filtered to keep out services we don't want - c2jDir = os.path.join( destDir, "code-generation", "api-descriptions" ) - os.mkdir( c2jDir ) - for c2jFile in GetC2JFiles(): - shutil.copy( os.path.join( sourceDir, "code-generation", "api-descriptions", c2jFile ), c2jDir ) - - # zip up the target directory - os.chdir(baseDir) - zipCommand = "jar -cMf \"" + uploadZipFile + "\" " + sdkDir - subprocess.check_call( zipCommand, shell = True ) - os.chdir(sourceDir) - - # shutil.rmtree( destDir ) - - print( "Aws SDK for C++ finished 3rd party pre-build gather into: " + uploadZipFile ) - - -Main() - - diff --git a/scripts/generate_sdks.py b/scripts/generate_sdks.py deleted file mode 100644 index afe50874163..00000000000 --- a/scripts/generate_sdks.py +++ /dev/null @@ -1,152 +0,0 @@ -# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -# SPDX-License-Identifier: Apache-2.0. -# -import argparse -import shutil -import subprocess -import re -import subprocess -import os -import zipfile -import io -import codecs -from subprocess import PIPE, STDOUT, Popen -from os import listdir -from os.path import isfile, join - -def ParseArguments(): - argMap = {} - - parser = argparse.ArgumentParser(description="Generates an SDK given an sdk name and version") - parser.add_argument("--outputLocation", action="store") - parser.add_argument("--serviceName", action="store") - parser.add_argument("--clientConfigDefaults", action="store") - parser.add_argument("--apiVersion", action="store") - parser.add_argument("--namespace", action="store") - parser.add_argument("--licenseText", action="store") - parser.add_argument("--pathToApiDefinitions", action="store") - parser.add_argument("--pathToGenerator", action="store") - parser.add_argument("--prepareTools", help="Makes sure generation environment is setup.", action="store_true") - parser.add_argument("--standalone", help="Build custom client as a separete package, with prebuilt C++ SDK as dependency", action="store_true") - parser.add_argument("--listAll", help="Lists all available SDKs for generation.", action="store_true") - parser.add_argument("--enableVirtualOperations", help ="Mark operation functions in service client as virtual functions.", action="store_true") - - args = vars( parser.parse_args() ) - argMap[ "outputLocation" ] = args[ "outputLocation" ] or "./" - argMap[ "serviceName" ] = args[ "serviceName" ] or None - argMap[ "clientConfigDefaults" ] = args[ "clientConfigDefaults" ] or None - argMap[ "apiVersion" ] = args[ "apiVersion" ] or "" - argMap[ "namespace" ] = args[ "namespace" ] or "" - argMap[ "licenseText" ] = args[ "licenseText" ] or "" - argMap[ "pathToApiDefinitions" ] = args["pathToApiDefinitions"] or "./code-generation/api-descriptions" - argMap[ "pathToGenerator" ] = args["pathToGenerator"] or "./code-generation/generator" - argMap[ "prepareTools" ] = args["prepareTools"] - argMap[ "standalone" ] = args["standalone"] - argMap[ "listAll" ] = args["listAll"] - argMap[ "enableVirtualOperations" ] = args["enableVirtualOperations"] - - return argMap - -serviceNameRemaps = { - "runtime.lex" : "lex", - "runtime.lex.v2" : "lexv2-runtime", - "models.lex.v2" : "lexv2-models", - "entitlement.marketplace" : "marketplace-entitlement", - "runtime.sagemaker" : "sagemaker-runtime", - "transfer" : "awstransfer", - "transcribe-streaming" : "transcribestreaming", - "streams.dynamodb" : "dynamodbstreams" -} - -def DiscoverAllAvailableSDKs(discoveryPath): - sdks = {} - - filesInDir = [f for f in listdir(discoveryPath) if isfile(join(discoveryPath, f))] - - for file in filesInDir: - match = re.search('([\w\d\.-]+)-(\d{4}-\d{2}-\d{2}).normal.json', file) - if match: - serviceName = match.group(1) - if serviceName in serviceNameRemaps: - serviceName = serviceNameRemaps[serviceName] - - sdk = {} - sdk['serviceName'] = serviceName - sdk['apiVersion'] = match.group(2) - sdk['filePath'] = join(discoveryPath, file) - sdks['{}-{}'.format(sdk['serviceName'], sdk['apiVersion'])] = sdk - - if serviceName == "s3": - s3crt = {} - s3crt['serviceName'] = "s3-crt" - s3crt['apiVersion'] = sdk['apiVersion'] - s3crt['filePath'] = sdk['filePath'] - sdks['s3-crt-{}'.format(s3crt['apiVersion'])] = s3crt - - return sdks - -def PrepareGenerator(generatorPath): - currentDir = os.getcwd() - os.chdir(generatorPath) - process = subprocess.call('mvn package', shell=True) - os.chdir(currentDir) - -def GenerateSdk(generatorPath, sdk, outputDir, namespace, licenseText, standalone, enableVirtualOperations): - try: - with codecs.open(sdk['filePath'], 'rb', 'utf-8') as api_definition: - api_content = api_definition.read() - jar_path = join(generatorPath, 'target/aws-client-generator-1.0-SNAPSHOT-jar-with-dependencies.jar') - process = Popen(['java', '-jar', jar_path, '--service', sdk['serviceName'], '--version', sdk['apiVersion'], '--namespace', namespace, '--license-text', licenseText, '--language-binding', 'cpp', '--arbitrary', '--standalone' if standalone else '', '--enable-virtual-operations' if enableVirtualOperations else '' ], stdout=PIPE, stdin=PIPE) - writer = codecs.getwriter('utf-8') - stdInWriter = writer(process.stdin) - stdInWriter.write(api_content) - process.stdin.close() - output = process.stdout.read() - if output: - with zipfile.ZipFile(output.strip().decode('utf-8'), 'r') as zip: - zip.extractall(outputDir) - except EnvironmentError as ex: - print('Error generating sdk {} with error {}'.format(sdk, ex)) - -def GenerateDefaults(generatorPath, defaultsDefinitionPath, outputDir, namespace, licenseText): - try: - with codecs.open(defaultsDefinitionPath, 'rb', 'utf-8') as defaults_definition: - defaults_content = defaults_definition.read() - jar_path = join(generatorPath, 'target/aws-client-generator-1.0-SNAPSHOT-jar-with-dependencies.jar') - process = Popen(['java', '-jar', jar_path, '--defaults', 'global', '--namespace', namespace, '--license-text', licenseText, '--language-binding', 'cpp', '--arbitrary'], stdout=PIPE, stdin=PIPE) - writer = codecs.getwriter('utf-8') - stdInWriter = writer(process.stdin) - stdInWriter.write(defaults_content) - process.stdin.close() - output = process.stdout.read() - if output: - with zipfile.ZipFile(output.strip().decode('utf-8'), 'r') as zip: - zip.extractall(outputDir) - except EnvironmentError as ex: - print('Error generating {} defaults with error {}'.format('global', ex)) - except Exception as ex: - print('Error generating {} defaults with error {}'.format('global', ex)) - -def Main(): - arguments = ParseArguments() - - if arguments['prepareTools']: - PrepareGenerator(arguments['pathToGenerator']) - - sdks = DiscoverAllAvailableSDKs(arguments['pathToApiDefinitions']) - - if arguments['listAll']: - for key, value in sdks.iteritems(): - print(value) - - if arguments['serviceName']: - print('Generating {} api version {}.'.format(arguments['serviceName'], arguments['apiVersion'])) - key = '{}-{}'.format(arguments['serviceName'], arguments['apiVersion']) - GenerateSdk(arguments['pathToGenerator'], sdks[key], arguments['outputLocation'], arguments['namespace'], arguments['licenseText'], arguments['standalone'], arguments['enableVirtualOperations']) - - if arguments['clientConfigDefaults']: - print('Generating {} defaults api version.'.format(arguments['clientConfigDefaults'])) - defaultsDefinitionPath = './code-generation/defaults/sdk-default-configuration.json' - GenerateDefaults(arguments['pathToGenerator'], defaultsDefinitionPath, arguments['outputLocation'], arguments['namespace'], arguments['licenseText']) - -Main() diff --git a/scripts/legacy/generate_sdks.py b/scripts/legacy/generate_sdks.py new file mode 100644 index 00000000000..b96344cf9a4 --- /dev/null +++ b/scripts/legacy/generate_sdks.py @@ -0,0 +1,164 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0. +# +import argparse +import re +import subprocess +import os +import zipfile +import codecs +from subprocess import PIPE, Popen +from os import listdir +from os.path import isfile, join + + +def parse_arguments(): + arg_map = {} + + parser = argparse.ArgumentParser(description="Generates an SDK given an sdk name and version") + parser.add_argument("--outputLocation", action="store") + parser.add_argument("--serviceName", action="store") + parser.add_argument("--clientConfigDefaults", action="store") + parser.add_argument("--apiVersion", action="store") + parser.add_argument("--namespace", action="store") + parser.add_argument("--licenseText", action="store") + parser.add_argument("--pathToApiDefinitions", action="store") + parser.add_argument("--pathToGenerator", action="store") + parser.add_argument("--prepareTools", help="Makes sure generation environment is setup.", action="store_true") + parser.add_argument("--standalone", + help="Build custom client as a separate package, with prebuilt C++ SDK as dependency", + action="store_true") + parser.add_argument("--listAll", help="Lists all available SDKs for generation.", action="store_true") + parser.add_argument("--enableVirtualOperations", + help="Mark operation functions in service client as virtual functions.", action="store_true") + + args = vars(parser.parse_args()) + arg_map["outputLocation"] = args["outputLocation"] or "./" + arg_map["serviceName"] = args["serviceName"] or None + arg_map["clientConfigDefaults"] = args["clientConfigDefaults"] or None + arg_map["apiVersion"] = args["apiVersion"] or "" + arg_map["namespace"] = args["namespace"] or "" + arg_map["licenseText"] = args["licenseText"] or "" + arg_map["pathToApiDefinitions"] = args["pathToApiDefinitions"] or "./code-generation/api-descriptions" + arg_map["pathToGenerator"] = args["pathToGenerator"] or "./code-generation/generator" + arg_map["prepareTools"] = args["prepareTools"] + arg_map["standalone"] = args["standalone"] + arg_map["listAll"] = args["listAll"] + arg_map["enableVirtualOperations"] = args["enableVirtualOperations"] + + return arg_map + + +serviceNameRemaps = { + "runtime.lex": "lex", + "runtime.lex.v2": "lexv2-runtime", + "models.lex.v2": "lexv2-models", + "entitlement.marketplace": "marketplace-entitlement", + "runtime.sagemaker": "sagemaker-runtime", + "transfer": "awstransfer", + "transcribe-streaming": "transcribestreaming", + "streams.dynamodb": "dynamodbstreams" +} + + +def discover_all_available_models(discovery_path): + sdks = {} + + files_in_dir = [f for f in listdir(discovery_path) if isfile(join(discovery_path, f))] + + for file in files_in_dir: + match = re.search(r'([\w.-]+)-(\d{4}-\d{2}-\d{2}).normal.json', file) + if match: + service_name = match.group(1) + if service_name in serviceNameRemaps: + service_name = serviceNameRemaps[service_name] + + sdk = {'service_name': service_name, 'apiVersion': match.group(2), 'filePath': join(discovery_path, file)} + sdks['{}-{}'.format(sdk['service_name'], sdk['apiVersion'])] = sdk + + if service_name == "s3": + s3crt = {'service_name': "s3-crt", 'apiVersion': sdk['apiVersion'], 'filePath': sdk['filePath']} + sdks['s3-crt-{}'.format(s3crt['apiVersion'])] = s3crt + + return sdks + + +def prepare_generator(generator_path): + current_dir = os.getcwd() + os.chdir(generator_path) + subprocess.call('mvn package', shell=True) + os.chdir(current_dir) + + +def generate_sdk(generator_path, sdk, output_dir, namespace, license_text, standalone, enable_virtual_operations): + try: + with codecs.open(sdk['filePath'], 'rb', 'utf-8') as api_definition: + api_content = api_definition.read() + jar_path = join(generator_path, 'target/aws-client-generator-1.0-SNAPSHOT-jar-with-dependencies.jar') + process = Popen(['java', '-jar', jar_path, '--service', sdk['serviceName'], '--version', sdk['apiVersion'], + '--namespace', namespace, '--license-text', license_text, '--language-binding', 'cpp', + '--arbitrary', '--standalone' if standalone else '', + '--enable-virtual-operations' if enable_virtual_operations else ''], + stdout=PIPE, + stdin=PIPE) + writer = codecs.getwriter('utf-8') + std_in_writer = writer(process.stdin) + std_in_writer.write(api_content) + process.stdin.close() + output = process.stdout.read() + if output: + with zipfile.ZipFile(output.strip().decode('utf-8'), 'r') as zipped: + zipped.extractall(output_dir) + except EnvironmentError as ex: + print('Error generating sdk {} with error {}'.format(sdk, ex)) + + +def generate_defaults(generator_path, defaults_definition_path, output_dir, namespace, license_text): + try: + with codecs.open(defaults_definition_path, 'rb', 'utf-8') as defaults_definition: + defaults_content = defaults_definition.read() + jar_path = join(generator_path, 'target/aws-client-generator-1.0-SNAPSHOT-jar-with-dependencies.jar') + process = Popen( + ['java', '-jar', jar_path, '--defaults', 'global', '--namespace', namespace, '--license-text', + license_text, '--language-binding', 'cpp', '--arbitrary'], stdout=PIPE, stdin=PIPE) + writer = codecs.getwriter('utf-8') + std_in_writer = writer(process.stdin) + std_in_writer.write(defaults_content) + process.stdin.close() + output = process.stdout.read() + if output: + with zipfile.ZipFile(output.strip().decode('utf-8'), 'r') as zipped: + zipped.extractall(output_dir) + except EnvironmentError as ex: + print('Error generating {} defaults with error {}'.format('global', ex)) + except Exception as ex: + print('Error generating {} defaults with error {}'.format('global', ex)) + + +def main(): + arguments = parse_arguments() + + if arguments['prepareTools']: + prepare_generator(arguments['pathToGenerator']) + + sdks = discover_all_available_models(arguments['pathToApiDefinitions']) + + if arguments['listAll']: + for key, value in sdks.items(): + print(value) + + if arguments['serviceName']: + print('Generating {} api version {}.'.format(arguments['serviceName'], arguments['apiVersion'])) + key = '{}-{}'.format(arguments['serviceName'], arguments['apiVersion']) + generate_sdk(arguments['pathToGenerator'], sdks[key], arguments['outputLocation'], arguments['namespace'], + arguments['licenseText'], arguments['standalone'], arguments['enableVirtualOperations']) + + if arguments['clientConfigDefaults']: + print('Generating {} defaults api version.'.format(arguments['clientConfigDefaults'])) + defaults_definition_path = './code-generation/defaults/sdk-default-configuration.json' + generate_defaults(arguments['pathToGenerator'], defaults_definition_path, arguments['outputLocation'], + arguments['namespace'], arguments['licenseText']) + + +if __name__ == "__main__": + main() diff --git a/scripts/renew_license.py b/scripts/renew_license.py deleted file mode 100644 index 71bdb8655df..00000000000 --- a/scripts/renew_license.py +++ /dev/null @@ -1,76 +0,0 @@ -# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -# SPDX-License-Identifier: Apache-2.0. - -# This script is used to update License end year for those hand crafted files -# Auto-generated files will be automatically updated by code-generator when published to release candidate in our code pipeline -# Simply modify OldLicense and NewLicense before running this script - -import fnmatch -import filecmp -import os -import sys -import datetime -import re - -highLevelServices = ["aws-cpp-sdk-access-management", - "aws-cpp-sdk-identity-management", - "aws-cpp-sdk-queues", - "aws-cpp-sdk-transfer", - "aws-cpp-sdk-s3-encryption", - "aws-cpp-sdk-text-to-speech", - "aws-cpp-sdk-core", - "aws-cpp-sdk-polly-sample" - ] - -def skipFile(fileName): - if (fileName.endswith("gtest.h")): - return True; - - y = re.search(r"\.git", fileName); - if (y != None): - return True; - - x = re.search(r"aws-cpp-sdk-[\w-]+", fileName); - if (x == None): - return False; - - if (x.group(0) in highLevelServices): - return False; - - if (x.group(0).endswith("tests")): - return False; - - return True; - -NewLicense = '''/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */''' - -NewLicenseScript = '''# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -# SPDX-License-Identifier: Apache-2.0.''' - -def updateLicense(inputFile): - - if (skipFile(inputFile)): - return False; - - print ("Process file: " + inputFile) - with open(inputFile) as ftarget: - content = ftarget.read() - - newContent1 = re.sub(r"\/\*.*?Copyright.*?Amazon.com.*?\*\/", NewLicense, content, flags=re.S); - newContent = re.sub(r"#.*?Copyright.*?Amazon.com.*?under the License\.", NewLicenseScript, newContent1, flags=re.S); - - if (content == newContent): - return False; - - with open(inputFile, "w") as fdest: - fdest.write(newContent) - return True; - -RootDir = os.path.dirname(os.path.dirname(os.path.realpath(__file__))); -for root, dirnames, filenames in os.walk(RootDir): - for filename in fnmatch.filter(filenames, '*'): - targetFile = os.path.join(root, filename); - ret = updateLicense(targetFile) diff --git a/scripts/run_integration_tests.py b/scripts/run_integration_tests.py index 94c5fb34219..fb63a3edca3 100644 --- a/scripts/run_integration_tests.py +++ b/scripts/run_integration_tests.py @@ -9,60 +9,62 @@ import random import string -def ParseArguments(): - argMap = {} + +def parse_arguments(): + arg_map = {} parser = argparse.ArgumentParser(description="AWSNativeSDK Run all Integration Tests") parser.add_argument("--testDir", action="store") - args = vars( parser.parse_args() ) - argMap["testDir"] = args["testDir"] or "./build" + args = vars(parser.parse_args()) + arg_map["testDir"] = args["testDir"] or "./build" + + return arg_map - return argMap -def AddExecutableBit(file): +def add_executable_bit(file): st = os.stat(file) os.chmod(file, st.st_mode | stat.S_IEXEC) -def Main(): - arguments = ParseArguments() - testHasParentDir = platform.system() != "Windows" - exeExtension = ".exe" if platform.system() == "Windows" else "" +def main(): + arguments = parse_arguments() + + test_has_parent_dir = platform.system() != "Windows" + exe_extension = ".exe" if platform.system() == "Windows" else "" - testList = [ #"aws-cpp-sdk-transcribestreaming-integration-tests", # Temporarily disabled while investigated - "aws-cpp-sdk-dynamodb-integration-tests", - "aws-cpp-sdk-sqs-integration-tests", - "aws-cpp-sdk-s3-integration-tests", - "aws-cpp-sdk-s3-crt-integration-tests", - "aws-cpp-sdk-s3control-integration-tests", - "aws-cpp-sdk-lambda-integration-tests", - "aws-cpp-sdk-cognitoidentity-integration-tests", - "aws-cpp-sdk-transfer-tests", - "aws-cpp-sdk-s3-encryption-integration-tests", - #"aws-cpp-sdk-mediastore-data-integration-tests", # Temporarily disabled while investigated - "aws-cpp-sdk-kinesis-integration-tests", - "aws-cpp-sdk-logs-integration-tests", - "aws-cpp-sdk-elasticfilesystem-integration-tests", - "aws-cpp-sdk-rds-integration-tests", - #"aws-cpp-sdk-redshift-integration-tests", # Don't run this test unless you really want to, it will cost you a lot of money. The test takes around a half hour to finish. - #"aws-cpp-sdk-cloudfront-integration-tests", # This test will cost you a lot of money as well. - "aws-cpp-sdk-ec2-integration-tests" ] + test_list = [ # "aws-cpp-sdk-transcribestreaming-integration-tests", # Temporarily disabled while investigated + "aws-cpp-sdk-dynamodb-integration-tests", + "aws-cpp-sdk-sqs-integration-tests", + "aws-cpp-sdk-s3-integration-tests", + "aws-cpp-sdk-s3-crt-integration-tests", + "aws-cpp-sdk-s3control-integration-tests", + "aws-cpp-sdk-lambda-integration-tests", + "aws-cpp-sdk-cognitoidentity-integration-tests", + "aws-cpp-sdk-transfer-tests", + "aws-cpp-sdk-s3-encryption-integration-tests", + "aws-cpp-sdk-kinesis-integration-tests", + "aws-cpp-sdk-logs-integration-tests", + "aws-cpp-sdk-elasticfilesystem-integration-tests", + "aws-cpp-sdk-rds-integration-tests", + "aws-cpp-sdk-ec2-integration-tests"] - random.shuffle(testList) + random.shuffle(test_list) - for testName in testList: - test_exe = os.path.join(arguments["testDir"], testName if testHasParentDir else "", testName) + exeExtension + for testName in test_list: + test_exe = os.path.join(arguments["testDir"], testName if test_has_parent_dir else "", testName) + exe_extension # when build with BUILD_ONLY, not all test binaries will be generated. if not os.path.isfile(test_exe): print("Test: \"{}\" doesn't exist, skipped.".format(test_exe)) continue - prefix = "--aws_resource_prefix=" + ''.join(random.choice(string.ascii_lowercase + string.digits) for _ in range(8)) + prefix = "--aws_resource_prefix=" + ''.join( + random.choice(string.ascii_lowercase + string.digits) for _ in range(8)) print("testExe = " + test_exe) print("prefix = " + prefix) - AddExecutableBit(test_exe) + add_executable_bit(test_exe) subprocess.check_call([test_exe, prefix]) # Run from powershell; make sure msbuild is in PATH environment variable -Main() +if __name__ == "__main__": + main() diff --git a/scripts/sdk_directories.py b/scripts/sdk_directories.py deleted file mode 100644 index f1b101ec1da..00000000000 --- a/scripts/sdk_directories.py +++ /dev/null @@ -1,80 +0,0 @@ -# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -# SPDX-License-Identifier: Apache-2.0. -# - -import shutil -import os - -def getDirectories(): - return [ "aws-cpp-sdk-autoscaling", - "aws-cpp-sdk-acm", - "aws-cpp-sdk-apigateway", - "aws-cpp-sdk-cloudhsm", - "aws-cpp-sdk-cloudformation", - "aws-cpp-sdk-cloudfront", - "aws-cpp-sdk-cloudsearch", - "aws-cpp-sdk-cloudsearchdomain", - "aws-cpp-sdk-cloudtrail", - "aws-cpp-sdk-codecommit", - "aws-cpp-sdk-codedeploy", - "aws-cpp-sdk-codepipeline", - "aws-cpp-sdk-cognito-identity", - "aws-cpp-sdk-cognito-sync", - "aws-cpp-sdk-config", - "aws-cpp-sdk-datapipeline", - "aws-cpp-sdk-devicefarm", - "aws-cpp-sdk-directconnect", - "aws-cpp-sdk-ds", - "aws-cpp-sdk-dynamodb", - "aws-cpp-sdk-ec2", - "aws-cpp-sdk-ecs", - "aws-cpp-sdk-ecr", - "aws-cpp-sdk-elasticache", - "aws-cpp-sdk-elasticbeanstalk", - "aws-cpp-sdk-elasticfilesystem", - "aws-cpp-sdk-elasticloadbalancing", - "aws-cpp-sdk-elasticmapreduce", - "aws-cpp-sdk-elastictranscoder", - "aws-cpp-sdk-email", - "aws-cpp-sdk-es", - "aws-cpp-sdk-events", - "aws-cpp-sdk-firehose", - "aws-cpp-sdk-gamelift", - "aws-cpp-sdk-glacier", - "aws-cpp-sdk-iam", - "aws-cpp-sdk-importexport", - "aws-cpp-sdk-inspector", - "aws-cpp-sdk-iot", - "aws-cpp-sdk-kinesis", - "aws-cpp-sdk-kms", - "aws-cpp-sdk-lambda", - "aws-cpp-sdk-logs", - "aws-cpp-sdk-machinelearning", - "aws-cpp-sdk-marketplacecommerceanalytics", - "aws-cpp-sdk-mobileanalytics", - "aws-cpp-sdk-monitoring", - "aws-cpp-sdk-opsworks", - "aws-cpp-sdk-rds", - "aws-cpp-sdk-redshift", - "aws-cpp-sdk-route53", - "aws-cpp-sdk-route53domains", - "aws-cpp-sdk-s3", - "aws-cpp-sdk-sdb", - "aws-cpp-sdk-sns", - "aws-cpp-sdk-sqs", - "aws-cpp-sdk-ssm", - "aws-cpp-sdk-storagegateway", - "aws-cpp-sdk-sts", - "aws-cpp-sdk-support", - "aws-cpp-sdk-swf", - "aws-cpp-sdk-waf", - "aws-cpp-sdk-workspaces", - "aws-cpp-sdk-application-autoscaling", - "aws-cpp-sdk-cognito-idp", - "aws-cpp-sdk-dms", - "aws-cpp-sdk-meteringmarketplace" ] - -def wipeGeneratedCode(): - for directory in getDirectories(): - if os.path.exists( directory ): - shutil.rmtree( directory ) diff --git a/scripts/wipe_generated_code.py b/scripts/wipe_generated_code.py deleted file mode 100644 index bbb0fe30591..00000000000 --- a/scripts/wipe_generated_code.py +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -# SPDX-License-Identifier: Apache-2.0. -# - -import sdk_directories - -sdk_directories.wipeGeneratedCode() - -