Skip to content

Commit

Permalink
[GR-48450] The maven-deploy command can force generation of dummy jav…
Browse files Browse the repository at this point in the history
…adoc.

PullRequest: mx/1672
  • Loading branch information
ansalond committed Sep 5, 2023
2 parents c86b9e8 + 8e268b5 commit 356e6d4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions mx.py
Original file line number Diff line number Diff line change
Expand Up @@ -11794,6 +11794,7 @@ def _maven_deploy_dists(dists, versionGetter, repo, settingsXml,
gpg=False,
keyid=None,
generateJavadoc=False,
generateDummyJavadoc=False,
deployMapFiles=False,
deployRepoMetadata=False):
if repo != maven_local_repository():
Expand Down Expand Up @@ -11863,7 +11864,7 @@ def _maven_deploy_dists(dists, versionGetter, repo, settingsXml,
tmpJavadocJar = tempfile.NamedTemporaryFile('w', suffix='.jar', delete=False)
tmpJavadocJar.close()
javadocPath = tmpJavadocJar.name
if getattr(dist, "noMavenJavadoc", False):
if getattr(dist, "noMavenJavadoc", False) or generateDummyJavadoc:
with zipfile.ZipFile(javadocPath, 'w', compression=zipfile.ZIP_DEFLATED) as arc:
arc.writestr("index.html", "<html><body>No Javadoc</body></html>")
else:
Expand Down Expand Up @@ -12051,7 +12052,9 @@ def maven_deploy(args):
parser.add_argument('--skip', action='store', help='Comma-separated list of globs of distributions not to be deployed')
parser.add_argument('--skip-existing', action='store_true', help='Do not deploy distributions if already in repository')
parser.add_argument('--validate', help='Validate that maven metadata is complete enough for publication', default='compat', choices=['none', 'compat', 'full'])
parser.add_argument('--suppress-javadoc', action='store_true', help='Suppress javadoc generation and deployment')
javadoc_parser = parser.add_mutually_exclusive_group()
javadoc_parser.add_argument('--suppress-javadoc', action='store_true', help='Suppress javadoc generation and deployment')
javadoc_parser.add_argument('--dummy-javadoc', action='store_true', help='Generate and deploy dummy javadocs, as if every distribution has `"noMavenJavadoc": True`')
parser.add_argument('--all-distribution-types', help='Include all distribution types. By default, only JAR distributions are included', action='store_true')
parser.add_argument('--all-distributions', help='Include all distributions, regardless of the maven flags.', action='store_true')
version_parser = parser.add_mutually_exclusive_group()
Expand Down Expand Up @@ -12119,6 +12122,7 @@ def versionGetter(_suite):
gpg=args.gpg,
keyid=args.gpg_keyid,
generateJavadoc=generateJavadoc,
generateDummyJavadoc=args.generate_javadoc,
deployRepoMetadata=args.with_suite_revisions_metadata)
has_deployed_dist = True
if not has_deployed_dist:
Expand Down Expand Up @@ -18783,7 +18787,7 @@ def alarm_handler(signum, frame):
abort(1, killsig=signal.SIGINT)

# The version must be updated for every PR (checked in CI) and the comment should reflect the PR's issue
version = VersionSpec("6.45.1") # GR-48321 Fix JARDistribution exclude list not triggering rebuild
version = VersionSpec("6.46.0") # GR-48450: The maven-deploy command can force generation of dummy javadoc.

_mx_start_datetime = datetime.utcnow()
_last_timestamp = _mx_start_datetime
Expand Down

0 comments on commit 356e6d4

Please sign in to comment.