Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changes/next-release/bugfix-AWSSDKforJavav2-02228de.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"type": "bugfix",
"category": "AWS SDK for Java v2",
"contributor": "Carey-AWS",
"description": "Update buildspec and script for javadocs cross-linking"
}
2 changes: 1 addition & 1 deletion buildspecs/release-javadoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
16 changes: 7 additions & 9 deletions scripts/doc_crosslinks/generate_cross_link_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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();
Expand All @@ -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()