mirror of
https://git.rtems.org/rtems-docs/
synced 2025-05-14 15:19:22 +08:00
waf: Get the version numbers from the version file.
This commit is contained in:
parent
7b53b604c5
commit
19af6b47d5
@ -1,7 +1,10 @@
|
|||||||
|
import version as rtems_version
|
||||||
|
|
||||||
extensions = [
|
extensions = [
|
||||||
"sphinx.ext.autodoc",
|
"sphinx.ext.autodoc",
|
||||||
"sphinx.ext.coverage",
|
"sphinx.ext.coverage",
|
||||||
"sphinx.ext.doctest",
|
"sphinx.ext.doctest",
|
||||||
|
"sphinx.ext.extlinks",
|
||||||
"sphinx.ext.graphviz",
|
"sphinx.ext.graphviz",
|
||||||
"sphinx.ext.intersphinx",
|
"sphinx.ext.intersphinx",
|
||||||
"sphinx.ext.mathjax",
|
"sphinx.ext.mathjax",
|
||||||
@ -9,6 +12,8 @@ extensions = [
|
|||||||
"rtemsdomain",
|
"rtemsdomain",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
extlinks = {'release_path': ('https://ftp.rtems.org/pub/rtems/releases', None) }
|
||||||
|
|
||||||
# Add any paths that contain templates here, relative to this directory.
|
# Add any paths that contain templates here, relative to this directory.
|
||||||
#templates_path = ['build/_templates']
|
#templates_path = ['build/_templates']
|
||||||
|
|
||||||
@ -23,17 +28,21 @@ master_doc = 'index'
|
|||||||
|
|
||||||
# General information about the project.
|
# General information about the project.
|
||||||
project = u'RTEMS Documentation Project'
|
project = u'RTEMS Documentation Project'
|
||||||
copyright = u'1988, 2019 RTEMS Project and contributors'
|
copyright = u'1988, 2020 RTEMS Project and contributors'
|
||||||
|
|
||||||
# The version info for the project you're documenting, acts as replacement for
|
# The version info for the project you're documenting, acts as replacement for
|
||||||
# |version| and |release|, also used in various other places throughout the
|
# |version| and |release|, also used in various other places throughout the
|
||||||
# built documents.
|
# built documents.
|
||||||
#
|
#
|
||||||
# The short X.Y version.
|
# The short X.Y version.
|
||||||
#version = '@VERSION@'
|
version = rtems_version.version()
|
||||||
|
|
||||||
# The full version, including alpha/beta/rc tags.
|
# The full version, including alpha/beta/rc tags.
|
||||||
#release = '@RELEASE@'
|
release = rtems_version.string()
|
||||||
|
|
||||||
|
major = rtems_version.major()
|
||||||
|
minor = rtems_version.minor()
|
||||||
|
revision = rtems_version.revision()
|
||||||
|
|
||||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||||
# for a list of supported languages.
|
# for a list of supported languages.
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#
|
#
|
||||||
# RTEMS Documentation Project (http://www.rtems.org/)
|
# RTEMS Documentation Project (http://www.rtems.org/)
|
||||||
# Copyright 2019 Chris Johns (chrisj@rtems.org)
|
# Copyright 2019, 2020 Chris Johns (chrisj@rtems.org)
|
||||||
# Copyright (C) 2019 embedded brains GmbH
|
# Copyright (C) 2019 embedded brains GmbH
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
#
|
#
|
||||||
@ -66,6 +66,9 @@ from __future__ import print_function
|
|||||||
import os.path
|
import os.path
|
||||||
|
|
||||||
_version = 'invalid'
|
_version = 'invalid'
|
||||||
|
_major = 0
|
||||||
|
_minor = 0
|
||||||
|
_revision = 0
|
||||||
_date = 'unknown date'
|
_date = 'unknown date'
|
||||||
_released = False
|
_released = False
|
||||||
|
|
||||||
@ -155,6 +158,17 @@ def get(ctx, rtems_major_version):
|
|||||||
_version = version
|
_version = version
|
||||||
_date = date
|
_date = date
|
||||||
_release = released
|
_release = released
|
||||||
|
if version != 'invalid':
|
||||||
|
vs = _version.split('.')
|
||||||
|
_major = vs[0]
|
||||||
|
if len(vs) == 3:
|
||||||
|
_minor = vs[1]
|
||||||
|
_revision = vs[2]
|
||||||
|
elif len(vs) == 2:
|
||||||
|
_minor = 0
|
||||||
|
_revision = vs[1]
|
||||||
|
else:
|
||||||
|
ctx.fatal('Invalid version format: %s' % (_version))
|
||||||
return version, date, released
|
return version, date, released
|
||||||
|
|
||||||
def string():
|
def string():
|
||||||
@ -163,6 +177,15 @@ def string():
|
|||||||
def version():
|
def version():
|
||||||
return _version
|
return _version
|
||||||
|
|
||||||
|
def major():
|
||||||
|
return _major
|
||||||
|
|
||||||
|
def minor():
|
||||||
|
return _minor
|
||||||
|
|
||||||
|
def revision():
|
||||||
|
return revision
|
||||||
|
|
||||||
def date():
|
def date():
|
||||||
return _date
|
return _date
|
||||||
|
|
||||||
|
@ -19,7 +19,10 @@ import conf
|
|||||||
sphinx_min_version = (1, 3)
|
sphinx_min_version = (1, 3)
|
||||||
|
|
||||||
def version_cmdline(ctx):
|
def version_cmdline(ctx):
|
||||||
return '-Drelease="%s" -Dversion="%s"' % (ctx.env.RELEASE, ctx.env.VERSION)
|
return '-Drelease="%s" -Dversion="%s" -Drtems_major="%s" ' \
|
||||||
|
'-Drtems_minor="%s" -D rtems_revision="%s"' \
|
||||||
|
% (ctx.env.RELEASE, ctx.env.VERSION, ctx.env.RTEMS_MAJOR,
|
||||||
|
ctx.env.RTEMS_MINOR, ctx.env.RTEMS_REVISION)
|
||||||
|
|
||||||
def sphinx_cmdline(ctx, build_type, conf_dir, doctrees,
|
def sphinx_cmdline(ctx, build_type, conf_dir, doctrees,
|
||||||
source_dir, output_dir, configs = []):
|
source_dir, output_dir, configs = []):
|
||||||
|
3
wscript
3
wscript
@ -86,6 +86,9 @@ def build(ctx):
|
|||||||
ctx.env.DATE = ver_date
|
ctx.env.DATE = ver_date
|
||||||
ctx.env.RELEASE = ver_version + ' (' + ver_date + ')'
|
ctx.env.RELEASE = ver_version + ' (' + ver_date + ')'
|
||||||
ctx.env.VERSION = ver_version
|
ctx.env.VERSION = ver_version
|
||||||
|
ctx.env.RTEMS_MAJOR = version.major()
|
||||||
|
ctx.env.RTEMS_MINOR = version.minor()
|
||||||
|
ctx.env.RTEMS_REVISION = version.revision()
|
||||||
ctx.to_log('Build: %s%s' % (ctx.env.RELEASE, os.linesep))
|
ctx.to_log('Build: %s%s' % (ctx.env.RELEASE, os.linesep))
|
||||||
|
|
||||||
#
|
#
|
||||||
|
Loading…
x
Reference in New Issue
Block a user