diff --git a/common/perf-test-core/pom.xml b/common/perf-test-core/pom.xml index 2be69e4523443..c0140b6c337c6 100644 --- a/common/perf-test-core/pom.xml +++ b/common/perf-test-core/pom.xml @@ -32,6 +32,10 @@ scm:git:https://github.com/Azure/azure-sdk-for-java.git + + ../.. + + @@ -62,57 +66,6 @@ - - org.apache.maven.plugins - maven-javadoc-plugin - 3.1.1 - - true - - - - https://docs.oracle.com/javase/8/docs/api/ - ${project.basedir}/../../eng/javadoc-package-lists/java8/ - - - - - https://projectreactor.io/docs/core/release/api/ - ${project.basedir}/../../eng/javadoc-package-lists/reactor-core/ - - - https://projectreactor.io/docs/netty/release/api/ - ${project.basedir}/../../eng/javadoc-package-lists/reactor-netty/ - - - - - https://fasterxml.github.io/jackson-annotations/javadoc/2.12/ - ${project.basedir}/../../eng/javadoc-package-lists/jackson-annotations/ - - - https://fasterxml.github.io/jackson-core/javadoc/2.12/ - ${project.basedir}/../../eng/javadoc-package-lists/jackson-core/ - - - https://fasterxml.github.io/jackson-databind/javadoc/2.12/ - ${project.basedir}/../../eng/javadoc-package-lists/jackson-databind/ - - - - - https://netty.io/4.1/api/ - ${project.basedir}/../../eng/javadoc-package-lists/netty/ - - - - - https://avro.apache.org/docs/current/api/java/ - ${project.basedir}/../../eng/javadoc-package-lists/apache-avro/ - - - - diff --git a/eng/scripts/invoke_embedme.py b/eng/scripts/invoke_embedme.py new file mode 100644 index 0000000000000..56d9628a6918f --- /dev/null +++ b/eng/scripts/invoke_embedme.py @@ -0,0 +1,53 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +# Python version 3.4 or higher is required to run this script. + +# Use case: Invokes embedme README codesnippet generation and validation regardless of OS. +# +# Flags +# --readme/-r: Path to the README. +# --verify/-v: Flag indicating to only perform a dry-run validation. +# --debug/-d: Flag indicating to perform debug level logging. +# +# For example: Generating README codesnippets for Azure Storage Blobs. +# python eng/scripts/invoke_embedme.py -r sdk/storage/azure-storage-blob/README.md +# +# For example: Valdate README codesnippets for Azure Core. +# python eng/scripts/invoke_embedme.py -r sdk/core/azure-core/README.md -v +# +# The script must be run at the root of azure-sdk-for-java. + +import argparse +import os +import sys + +# NPX command. +npx_command = 'npx embedme' + +# Invoke embedme. +def invoke_embedme(readme: str, verify: bool, debug: bool): + command = npx_command + + # If the passed README path was relative + command += ' ' + os.path.abspath(readme) + + if verify: + command += ' --verify' + + if debug: + print('Running embedme command: {}'.format(command)) + + sys.exit(os.system(command)) + +def main(): + parser = argparse.ArgumentParser(description='Invokes embedme README codesnippet generation and validation regardless of OS.') + parser.add_argument('--readme', '-r', type=str, required=True, help='Path to the README') + parser.add_argument('--verify', '-v', action='store_true', help='Flag indicating to only perform a dry-run validation') + parser.add_argument('--debug', '-d', action='store_true', help='Flag indicating to perform debug level logging') + args = parser.parse_args() + + invoke_embedme(args.readme, args.verify, args.debug) + +if __name__ == '__main__': + main() diff --git a/sdk/parents/azure-client-sdk-parent/pom.xml b/sdk/parents/azure-client-sdk-parent/pom.xml index 58a76c67659b8..4b7d8b29c13a1 100644 --- a/sdk/parents/azure-client-sdk-parent/pom.xml +++ b/sdk/parents/azure-client-sdk-parent/pom.xml @@ -107,6 +107,7 @@ 0.40 0.30 false + ../../.. @@ -441,9 +442,9 @@ - ../../../eng/code-quality-reports/src/main/resources/checkstyle/checkstyle.xml - ../../../eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml - ../../../eng/code-quality-reports/src/main/resources/checkstyle/java.header + ${project.basedir}/${relative.path.to.eng.folder}/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle.xml + ${project.basedir}/${relative.path.to.eng.folder}/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml + ${project.basedir}/${relative.path.to.eng.folder}/eng/code-quality-reports/src/main/resources/checkstyle/java.header samedir= UTF-8 true @@ -548,43 +549,43 @@ https://docs.oracle.com/javase/8/docs/api/ - ${project.basedir}/../../../eng/javadoc-package-lists/java8/ + ${project.basedir}/${relative.path.to.eng.folder}/eng/javadoc-package-lists/java8/ https://projectreactor.io/docs/core/release/api/ - ${project.basedir}/../../../eng/javadoc-package-lists/reactor-core/ + ${project.basedir}/${relative.path.to.eng.folder}/eng/javadoc-package-lists/reactor-core/ https://projectreactor.io/docs/netty/release/api/ - ${project.basedir}/../../../eng/javadoc-package-lists/reactor-netty/ + ${project.basedir}/${relative.path.to.eng.folder}/eng/javadoc-package-lists/reactor-netty/ https://fasterxml.github.io/jackson-annotations/javadoc/2.12/ - ${project.basedir}/../../../eng/javadoc-package-lists/jackson-annotations/ + ${project.basedir}/${relative.path.to.eng.folder}/eng/javadoc-package-lists/jackson-annotations/ https://fasterxml.github.io/jackson-core/javadoc/2.12/ - ${project.basedir}/../../../eng/javadoc-package-lists/jackson-core/ + ${project.basedir}/${relative.path.to.eng.folder}/eng/javadoc-package-lists/jackson-core/ https://fasterxml.github.io/jackson-databind/javadoc/2.12/ - ${project.basedir}/../../../eng/javadoc-package-lists/jackson-databind/ + ${project.basedir}/${relative.path.to.eng.folder}/eng/javadoc-package-lists/jackson-databind/ https://netty.io/4.1/api/ - ${project.basedir}/../../../eng/javadoc-package-lists/netty/ + ${project.basedir}/${relative.path.to.eng.folder}/eng/javadoc-package-lists/netty/ https://avro.apache.org/docs/current/api/java/ - ${project.basedir}/../../../eng/javadoc-package-lists/apache-avro/ + ${project.basedir}/${relative.path.to.eng.folder}/eng/javadoc-package-lists/apache-avro/ org.apidesign.javadoc.codesnippet.Doclet @@ -860,7 +861,7 @@ generate-overview - ../../../eng/pipelines/scripts/generate_overview_from_readme.py + ${project.basedir}/${relative.path.to.eng.folder}/eng/pipelines/scripts/generate_overview_from_readme.py @@ -880,7 +881,7 @@ python ${project.basedir} - ../../../eng/pipelines/scripts/generate_overview_from_readme.py + ${project.basedir}/${relative.path.to.eng.folder}/eng/pipelines/scripts/generate_overview_from_readme.py --rf ${project.basedir}/README.md --v @@ -915,7 +916,7 @@ inject-codesnippets - ../../../eng/pipelines/scripts/inject_codesnippets.py + ${project.basedir}/${relative.path.to.eng.folder}/eng/pipelines/scripts/inject_codesnippets.py @@ -935,7 +936,7 @@ python ${project.basedir} - ../../../eng/pipelines/scripts/inject_codesnippets.py + ${project.basedir}/${relative.path.to.eng.folder}/eng/pipelines/scripts/inject_codesnippets.py --project-dir ${project.basedir} @@ -947,41 +948,6 @@ - - - readme-codesnippet-windows - - - readme-codesnippet-windows - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - code-snippet-for-readme-windows - prepare-package - - exec - - - npx.cmd - - embedme - ${project.basedir}/README.md - - - - - - - - - @@ -1005,45 +971,10 @@ exec - npx - - embedme - ${project.basedir}/README.md - - - - - - - - - - - - verify-readme-windows - - - verify-readme-windows - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - verify-readme-codesnippet-windows - prepare-package - - exec - - - npx.cmd + python - embedme - --verify + ${project.basedir}/${relative.path.to.eng.folder}/eng/scripts/invoke_embedme.py + --readme ${project.basedir}/README.md @@ -1054,8 +985,7 @@ - + verify-readme @@ -1077,11 +1007,12 @@ exec - npx + python - embedme - --verify + ${project.basedir}/${relative.path.to.eng.folder}/eng/scripts/invoke_embedme.py + --readme ${project.basedir}/README.md + --verify