()
| 255 | |
| 256 | |
| 257 | def main(): |
| 258 | usage = """%prog release_version next_dev_version |
| 259 | Update 'version' file to release_version and commit. |
| 260 | Generates the document tarball. |
| 261 | Tags the sandbox revision with release_version. |
| 262 | Update 'version' file to next_dev_version and commit. |
| 263 | |
| 264 | Performs an svn export of tag release version, and build a source tarball. |
| 265 | |
| 266 | Must be started in the project top directory. |
| 267 | |
| 268 | Warning: --force should only be used when developing/testing the release script. |
| 269 | """ |
| 270 | from optparse import OptionParser |
| 271 | parser = OptionParser(usage=usage) |
| 272 | parser.allow_interspersed_args = False |
| 273 | parser.add_option('--dot', dest="dot_path", action='store', default=doxybuild.find_program('dot'), |
| 274 | help="""Path to GraphViz dot tool. Must be full qualified path. [Default: %default]""") |
| 275 | parser.add_option('--doxygen', dest="doxygen_path", action='store', default=doxybuild.find_program('doxygen'), |
| 276 | help="""Path to Doxygen tool. [Default: %default]""") |
| 277 | parser.add_option('--force', dest="ignore_pending_commit", action='store_true', default=False, |
| 278 | help="""Ignore pending commit. [Default: %default]""") |
| 279 | parser.add_option('--retag', dest="retag_release", action='store_true', default=False, |
| 280 | help="""Overwrite release existing tag if it exist. [Default: %default]""") |
| 281 | parser.add_option('-p', '--platforms', dest="platforms", action='store', default='', |
| 282 | help="""Comma separated list of platform passed to scons for build check.""") |
| 283 | parser.add_option('--no-test', dest="no_test", action='store_true', default=False, |
| 284 | help="""Skips build check.""") |
| 285 | parser.add_option('--no-web', dest="no_web", action='store_true', default=False, |
| 286 | help="""Do not update web site.""") |
| 287 | parser.add_option('-u', '--upload-user', dest="user", action='store', |
| 288 | help="""Sourceforge user for SFTP documentation upload.""") |
| 289 | parser.add_option('--sftp', dest='sftp', action='store', default=doxybuild.find_program('psftp', 'sftp'), |
| 290 | help="""Path of the SFTP compatible binary used to upload the documentation.""") |
| 291 | parser.enable_interspersed_args() |
| 292 | options, args = parser.parse_args() |
| 293 | |
| 294 | if len(args) != 2: |
| 295 | parser.error('release_version missing on command-line.') |
| 296 | release_version = args[0] |
| 297 | next_version = args[1] |
| 298 | |
| 299 | if not options.platforms and not options.no_test: |
| 300 | parser.error('You must specify either --platform or --no-test option.') |
| 301 | |
| 302 | if options.ignore_pending_commit: |
| 303 | msg = '' |
| 304 | else: |
| 305 | msg = check_no_pending_commit() |
| 306 | if not msg: |
| 307 | print('Setting version to', release_version) |
| 308 | set_version(release_version) |
| 309 | svn_commit('Release ' + release_version) |
| 310 | tag_url = svn_join_url(SVN_TAG_ROOT, release_version) |
| 311 | if svn_check_if_tag_exist(tag_url): |
| 312 | if options.retag_release: |
| 313 | svn_remove_tag(tag_url, 'Overwriting previous tag') |
| 314 | else: |
no test coverage detected