Changeset 2a68e9d in rtems-docs


Ignore:
Timestamp:
Feb 6, 2019, 5:46:42 AM (4 months ago)
Author:
Chris Johns <chrisj@…>
Branches:
master
Children:
a3b0a40
Parents:
21c4a44
git-author:
Chris Johns <chrisj@…> (02/06/19 05:46:42)
git-committer:
Chris Johns <chrisj@…> (02/06/19 06:01:48)
Message:

Support VERSION file for releasing and deployment

  • Shorten the GIT hash.
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • wscript

    r21c4a44 r2a68e9d  
    33#
    44
    5 from sys import path
    6 from os.path import abspath
    7 path.append(abspath('common'))
     5import sys
     6import os.path
     7
     8sys.path.append(os.path.abspath('common'))
    89
    910import waflib
    1011import waf as docs_waf
     12import version
    1113
     14#
     15# Branch version
     16#
     17rtems_major_version = '5'
     18
     19#
     20# The documents to build.
     21#
    1222build_all = ['user',
    1323             'c-user',
     
    5060        o.write(js.replace('@CATALOGUE', xml))
    5161
    52 def pretty_day(day):
    53     if day == 3:
    54         s = 'rd'
    55     elif day == 11:
    56         s = 'th'
    57     elif day == 12:
    58         s = 'th'
    59     elif day == 13:
    60         s = 'th'
    61     elif day % 10 == 1:
    62         s = 'st'
    63     elif day % 10 == 2:
    64         s = 'nd'
    65     else:
    66         s = 'th'
    67     return str(day) + s
    6862
    6963def build(ctx):
    7064    #
    71     # Get date and version from Git
     65    # Get the version.
    7266    #
    73     version = '5.0.0'
    74     if ctx.exec_command(['git', 'diff-index', '--quiet', 'HEAD']) == 0:
    75         modified = ''
    76     else:
    77         modified = '-modified'
    78     try:
    79         out = ctx.cmd_and_log(['git', 'log', '-1', '--format=%H,%cd', '--date=format:%e,%B,%Y'])
    80         f = out.strip('\n').split(',')
    81         version = version + '.' + f[0] + modified
    82         date = pretty_day(int(f[1])) + ' ' + f[2] + ' ' + f[3]
    83     except waflib.Build.Errors.WafError:
    84         date = 'unknown date'
    85     ctx.env.DATE = date
    86     ctx.env.RELEASE = version + ' (' + date + ')'
    87     ctx.env.VERSION = version
     67    ver_version, ver_date = version.get(ctx, rtems_major_version)
     68    ctx.env.DATE = ver_date
     69    ctx.env.RELEASE = ver_version + ' (' + ver_date + ')'
     70    ctx.env.VERSION = ver_version
     71    ctx.to_log('Build: %s%s' % (ctx.env.RELEASE, os.linesep))
    8872
     73    #
    8974    #
    9075    # Generate any PlantUML images if enabled.
Note: See TracChangeset for help on using the changeset viewer.