From 605d427c2f2cd622fe30c5cec4fc8b4b1ccd30da Mon Sep 17 00:00:00 2001 From: Carey Burgess Date: Thu, 15 Jul 2021 06:22:31 +0000 Subject: [PATCH] Remove extraneous parameter from javadocs buildspec & script --- .../bugfix-AWSSDKforJavav2-02228de.json | 6 ++++++ buildspecs/release-javadoc.yml | 2 +- .../doc_crosslinks/generate_cross_link_data.py | 16 +++++++--------- 3 files changed, 14 insertions(+), 10 deletions(-) create mode 100644 .changes/next-release/bugfix-AWSSDKforJavav2-02228de.json diff --git a/.changes/next-release/bugfix-AWSSDKforJavav2-02228de.json b/.changes/next-release/bugfix-AWSSDKforJavav2-02228de.json new file mode 100644 index 000000000000..ed62dc0469fe --- /dev/null +++ b/.changes/next-release/bugfix-AWSSDKforJavav2-02228de.json @@ -0,0 +1,6 @@ +{ + "type": "bugfix", + "category": "AWS SDK for Java v2", + "contributor": "Carey-AWS", + "description": "Update buildspec and script for javadocs cross-linking" +} diff --git a/buildspecs/release-javadoc.yml b/buildspecs/release-javadoc.yml index bbacef6911ae..a0b5204f9525 100644 --- a/buildspecs/release-javadoc.yml +++ b/buildspecs/release-javadoc.yml @@ -22,5 +22,5 @@ phases: - aws s3 sync $DOC_PATH/$RELEASE_VERSION/ $DOC_PATH/latest/ --acl=public-read --delete - jar cf aws-java-sdk-v2-docs.jar -C target/site/apidocs . - aws s3 cp aws-java-sdk-v2-docs.jar $DOC_PATH/ --acl="public-read" - - python ./scripts/doc_crosslinks/generate_cross_link_data.py --apiDefinitionsBasePath ./services/ --apiDefinitionsRelativeFilePath src/main/resources/codegen-resources/service-2.json --templateFilePath ./scripts/doc_crosslinks/crosslink_redirect.html --outputFilePath ./scripts/crosslink_redirect.html + - python ./scripts/doc_crosslinks/generate_cross_link_data.py --apiDefinitionsBasePath ./services/ --templateFilePath ./scripts/doc_crosslinks/crosslink_redirect.html --outputFilePath ./scripts/crosslink_redirect.html - aws s3 cp ./scripts/crosslink_redirect.html $DOC_PATH/latest/ --acl="public-read" \ No newline at end of file diff --git a/scripts/doc_crosslinks/generate_cross_link_data.py b/scripts/doc_crosslinks/generate_cross_link_data.py index cf5ce388f93e..b6eb1dae61c9 100644 --- a/scripts/doc_crosslinks/generate_cross_link_data.py +++ b/scripts/doc_crosslinks/generate_cross_link_data.py @@ -13,9 +13,9 @@ sdks = {} clientClass = {} -def generateDocsMap(apiDefinitionsPath, apiDefinitionsRelativeFilePath): +def generateDocsMap(apiDefinitionsPath): - rootPath = pathlib.Path(r'./services') + rootPath = pathlib.Path(apiDefinitionsPath) for serviceModelPaths in rootPath.rglob('service-2.json'): tokenizePath = str(Path(serviceModelPaths).parent).split("/") getServiceName = tokenizePath[len(tokenizePath)-1] @@ -85,8 +85,8 @@ def removeTrailing(str, toRemove) : return str.replace(toRemove, "") return str -def insertDocsMapToRedirect(apiDefinitionsBasePath, apiDefinitionsRelativeFilePath, templateFilePath, outputFilePath): - generateDocsMap(apiDefinitionsBasePath, apiDefinitionsRelativeFilePath) +def insertDocsMapToRedirect(apiDefinitionsBasePath, templateFilePath, outputFilePath): + generateDocsMap(apiDefinitionsBasePath) output = "" with codecs.open(templateFilePath, 'rb', 'utf-8') as redirect_template: current_template = redirect_template.read(); @@ -98,18 +98,16 @@ def insertDocsMapToRedirect(apiDefinitionsBasePath, apiDefinitionsRelativeFilePa def Main(): parser = argparse.ArgumentParser(description="Generates a Cross-link redirect file.") parser.add_argument("--apiDefinitionsBasePath", action="store") - parser.add_argument("--apiDefinitionsRelativeFilePath", action="store") parser.add_argument("--templateFilePath", action="store") parser.add_argument("--outputFilePath", action="store") args = vars( parser.parse_args() ) argMap = {} - argMap[ "apiDefinitionsBasePath" ] = args[ "apiDefinitionsBasePath" ] or "./../services/" - argMap[ "apiDefinitionsRelativeFilePath" ] = args[ "apiDefinitionsRelativeFilePath" ] or "/src/main/resources/codegen-resources/service-2.json" + argMap[ "apiDefinitionsBasePath" ] = args[ "apiDefinitionsBasePath" ] or "./services/" argMap[ "templateFilePath" ] = args[ "templateFilePath" ] or "./scripts/doc_crosslinks/crosslink_redirect.html" - argMap[ "outputFilePath" ] = args[ "outputFilePath" ] or "./crosslink_redirect.html" + argMap[ "outputFilePath" ] = args[ "outputFilePath" ] or "./scripts/crosslink_redirect.html" - insertDocsMapToRedirect(argMap["apiDefinitionsBasePath"], argMap["apiDefinitionsRelativeFilePath"], argMap["templateFilePath"], argMap["outputFilePath"]) + insertDocsMapToRedirect(argMap["apiDefinitionsBasePath"], argMap["templateFilePath"], argMap["outputFilePath"]) print("Generated Cross link at " + argMap["outputFilePath"]) Main()