(root, version, pause_before_sign, mf_username, gpg_key_id, gpg_password, gpg_home=None, sign_gradle=False)
| 92 | |
| 93 | |
| 94 | def prepare(root, version, pause_before_sign, mf_username, gpg_key_id, gpg_password, gpg_home=None, sign_gradle=False): |
| 95 | print() |
| 96 | print('Prepare release...') |
| 97 | if os.path.exists(LOG): |
| 98 | os.remove(LOG) |
| 99 | |
| 100 | if not dev_mode: |
| 101 | os.chdir(root) |
| 102 | print(' git pull...') |
| 103 | run('git pull') |
| 104 | else: |
| 105 | print(' Development mode, not running git pull') |
| 106 | |
| 107 | rev = getGitRev() |
| 108 | print(' git rev: %s' % rev) |
| 109 | log('\nGIT rev: %s\n' % rev) |
| 110 | |
| 111 | print(' Check DOAP files') |
| 112 | checkDOAPfiles(version) |
| 113 | |
| 114 | if not dev_mode: |
| 115 | print(' ./gradlew --no-daemon -Dtests.badapples=false clean check') |
| 116 | run('./gradlew --no-daemon -Dtests.badapples=false clean check') |
| 117 | else: |
| 118 | print(' skipping precommit check due to dev-mode') |
| 119 | |
| 120 | if pause_before_sign: |
| 121 | input("Tests complete! Please press ENTER to proceed to assembleRelease: ") |
| 122 | |
| 123 | print(' prepare-release') |
| 124 | cmd = './gradlew --no-daemon assembleRelease' \ |
| 125 | ' -Dversion.release=%s' % version |
| 126 | if mf_username is not None: |
| 127 | cmd += ' -Dmanifest.username=%s' % mf_username |
| 128 | if dev_mode: |
| 129 | cmd += ' -Pvalidation.git.failOnModified=false' |
| 130 | if gpg_key_id is None: |
| 131 | cmd += ' -Psign=false' # Disable signing if no key provided to script |
| 132 | else: |
| 133 | cmd += ' -Psign --max-workers 2' |
| 134 | if sign_gradle: |
| 135 | print(" Signing method is gradle java-plugin") |
| 136 | cmd += ' -Psigning.keyId="%s"' % gpg_key_id |
| 137 | if gpg_home is not None: |
| 138 | cmd += ' -Psigning.secretKeyRingFile="%s"' % os.path.join(gpg_home, 'secring.gpg') |
| 139 | if gpg_password is not None: |
| 140 | # Pass gpg passphrase as env.var to gradle rather than as plaintext argument |
| 141 | os.environ['ORG_GRADLE_PROJECT_signingPassword'] = gpg_password |
| 142 | else: |
| 143 | print(" Signing method is gpg tool") |
| 144 | cmd += ' -PuseGpg -Psigning.gnupg.keyName="%s"' % gpg_key_id |
| 145 | if gpg_home is not None: |
| 146 | cmd += ' -Psigning.gnupg.homeDir="%s"' % gpg_home |
| 147 | |
| 148 | print(" Running: %s" % cmd) |
| 149 | if gpg_password is not None: |
| 150 | runAndSendGPGPassword(cmd, gpg_password) |
| 151 | else: |
no test coverage detected
searching dependent graphs…