Apache Solr open-source search software
releaseWizard: allow explicitly setting MANIFEST.MF userid (e.g., to apache id) (#1290)
Michael Gibney1d65ab6633b1
diff --git a/dev-tools/scripts/buildAndPushRelease.py b/dev-tools/scripts/buildAndPushRelease.pyindex a7275490ce5..b7b73768325 100755--- a/dev-tools/scripts/buildAndPushRelease.py+++ b/dev-tools/scripts/buildAndPushRelease.py@@ -91,7 +91,7 @@ def getGitRev():return os.popen('git rev-parse HEAD').read().strip()-def prepare(root, version, gpg_key_id, gpg_password, gpg_home=None, sign_gradle=False):+def prepare(root, version, mf_username, gpg_key_id, gpg_password, gpg_home=None, sign_gradle=False):print()print('Prepare release...')if os.path.exists(LOG):@@ -120,6 +120,8 @@ def prepare(root, version, gpg_key_id, gpg_password, gpg_home=None, sign_gradle=print(' prepare-release')cmd = './gradlew --no-daemon assembleRelease' \' -Dversion.release=%s' % version+ if mf_username is not None:+ cmd += ' -Dmanifest.username=%s' % mf_usernameif dev_mode:cmd += ' -Pvalidation.git.failOnModified=false'if gpg_key_id is None:@@ -252,6 +254,8 @@ def parse_config():help='Uses local KEYS file to validate presence of RM\'s gpg key')parser.add_argument('--push-local', metavar='PATH',help='Push the release to the local path')+ parser.add_argument('--mf-username', metavar='ID',+ help='Use the specified username in the Implementation-Version for jar MANIFEST.MF files (e.g., Apache ID).')parser.add_argument('--sign', metavar='FINGERPRINT',help='Sign the release with the given gpg key. This must be the full GPG fingerprint, not just the last 8 characters.')parser.add_argument('--sign-method-gradle', dest='sign_method_gradle', default=False, action='store_true',@@ -394,7 +398,7 @@ def main():c.key_password = Noneif c.prepare:- prepare(c.root, c.version, c.key_id, c.key_password, gpg_home=gpg_home, sign_gradle=c.sign_method_gradle)+ prepare(c.root, c.version, c.mf_username, c.key_id, c.key_password, gpg_home=gpg_home, sign_gradle=c.sign_method_gradle)else:os.chdir(c.root)diff --git a/dev-tools/scripts/releaseWizard.yaml b/dev-tools/scripts/releaseWizard.yamlindex d38f8df224f..747c62d22a4 100644--- a/dev-tools/scripts/releaseWizard.yaml+++ b/dev-tools/scripts/releaseWizard.yaml@@ -749,7 +749,7 @@ groups:cmd: git pull --ff-onlytee: true- !Command- cmd: python3 -u dev-tools/scripts/buildAndPushRelease.py {{ local_keys }} --logfile {{ logfile }} --push-local "{{ dist_file_path }}" --rc-num {{ rc_number }} --sign {{ gpg.gpg_fingerprint | default("<gpg_fingerprint>", True) }} --gpg-pass-noprompt+ cmd: python3 -u dev-tools/scripts/buildAndPushRelease.py {{ local_keys }} --logfile {{ logfile }} --push-local "{{ dist_file_path }}" --rc-num {{ rc_number }} --manifest-username {{ gpg.apache_id }} --sign {{ gpg.gpg_fingerprint | default("<gpg_fingerprint>", True) }} --gpg-pass-nopromptcomment: "Using gpg command for signing."logfile: build_rc.logtee: truediff --git a/gradle/java/jar-manifest.gradle b/gradle/java/jar-manifest.gradleindex 14be4d2710f..25cae7ea523 100644--- a/gradle/java/jar-manifest.gradle+++ b/gradle/java/jar-manifest.gradle@@ -44,7 +44,9 @@ subprojects {if (snapshotBuild) {return "${project.version} ${gitRev} [snapshot build, details omitted]"} else {- return "${project.version} ${gitRev} - ${System.properties['user.name']} - ${buildDate} ${buildTime}"+ def sysProps = System.properties+ def manifestUsername = sysProps.getOrDefault('manifest.username', sysProps['user.name'])+ return "${project.version} ${gitRev} - ${manifestUsername} - ${buildDate} ${buildTime}"}}