Changeset 19af6b4 in rtems-docs


Ignore:
Timestamp:
Mar 12, 2020, 5:34:16 AM (4 months ago)
Author:
Chris Johns <chrisj@…>
Branches:
5, master
Children:
1b2a7c8
Parents:
7b53b60
git-author:
Chris Johns <chrisj@…> (03/12/20 05:34:16)
git-committer:
Chris Johns <chrisj@…> (03/12/20 21:18:36)
Message:

waf: Get the version numbers from the version file.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • common/conf.py

    r7b53b60 r19af6b4  
     1import version as rtems_version
     2
    13extensions = [
    24        "sphinx.ext.autodoc",
    35        "sphinx.ext.coverage",
    46        "sphinx.ext.doctest",
     7        "sphinx.ext.extlinks",
    58        "sphinx.ext.graphviz",
    69        "sphinx.ext.intersphinx",
     
    1013]
    1114
     15extlinks = {'release_path': ('https://ftp.rtems.org/pub/rtems/releases', None) }
     16
    1217# Add any paths that contain templates here, relative to this directory.
    1318#templates_path = ['build/_templates']
     
    2429# General information about the project.
    2530project = u'RTEMS Documentation Project'
    26 copyright = u'1988, 2019 RTEMS Project and contributors'
     31copyright = u'1988, 2020 RTEMS Project and contributors'
    2732
    2833# The version info for the project you're documenting, acts as replacement for
     
    3136#
    3237# The short X.Y version.
    33 #version = '@VERSION@'
     38version = rtems_version.version()
    3439
    3540# The full version, including alpha/beta/rc tags.
    36 #release = '@RELEASE@'
     41release = rtems_version.string()
     42
     43major = rtems_version.major()
     44minor = rtems_version.minor()
     45revision = rtems_version.revision()
    3746
    3847# The language for content autogenerated by Sphinx. Refer to documentation
  • common/version.py

    r7b53b60 r19af6b4  
    11#
    22# RTEMS Documentation Project (http://www.rtems.org/)
    3 # Copyright 2019 Chris Johns (chrisj@rtems.org)
     3# Copyright 2019, 2020 Chris Johns (chrisj@rtems.org)
    44# Copyright (C) 2019 embedded brains GmbH
    55# All rights reserved.
     
    6767
    6868_version = 'invalid'
     69_major = 0
     70_minor = 0
     71_revision = 0
    6972_date = 'unknown date'
    7073_released = False
     
    156159        _date = date
    157160        _release = released
     161    if version != 'invalid':
     162        vs = _version.split('.')
     163        _major = vs[0]
     164        if len(vs) == 3:
     165            _minor = vs[1]
     166            _revision = vs[2]
     167        elif len(vs) == 2:
     168            _minor = 0
     169            _revision = vs[1]
     170        else:
     171            ctx.fatal('Invalid version format: %s' % (_version))
    158172    return version, date, released
    159173
     
    164178    return _version
    165179
     180def major():
     181    return _major
     182
     183def minor():
     184    return _minor
     185
     186def revision():
     187    return revision
     188
    166189def date():
    167190    return _date
  • common/waf.py

    r7b53b60 r19af6b4  
    2020
    2121def version_cmdline(ctx):
    22     return '-Drelease="%s" -Dversion="%s"' % (ctx.env.RELEASE, ctx.env.VERSION)
     22    return '-Drelease="%s" -Dversion="%s" -Drtems_major="%s" ' \
     23           '-Drtems_minor="%s" -D rtems_revision="%s"' \
     24        % (ctx.env.RELEASE, ctx.env.VERSION, ctx.env.RTEMS_MAJOR,
     25           ctx.env.RTEMS_MINOR, ctx.env.RTEMS_REVISION)
    2326
    2427def sphinx_cmdline(ctx, build_type, conf_dir, doctrees,
  • wscript

    r7b53b60 r19af6b4  
    8787    ctx.env.RELEASE = ver_version + ' (' + ver_date + ')'
    8888    ctx.env.VERSION = ver_version
     89    ctx.env.RTEMS_MAJOR = version.major()
     90    ctx.env.RTEMS_MINOR = version.minor()
     91    ctx.env.RTEMS_REVISION = version.revision()
    8992    ctx.to_log('Build: %s%s' % (ctx.env.RELEASE, os.linesep))
    9093
Note: See TracChangeset for help on using the changeset viewer.