[go: nahoru, domu]

Skip to content

Commit

Permalink
Bug 1403519 - only build docs when necessary r=gps
Browse files Browse the repository at this point in the history
This marks **/docs/** as exclusively docs, and code that is autodoc'd as
inclusively docs.

That means that a change that purely modifies documentation files will *only*
run `docs` tasks, while a change that modifies autodoc'd source code will
*additionaly* run `docs` tasks.  The tasks do not run by default.

MozReview-Commit-ID: G9tOK0AwtrI
  • Loading branch information
djmitche committed Oct 2, 2017
1 parent 7fe025a commit 3546a0b
Show file tree
Hide file tree
Showing 25 changed files with 105 additions and 14 deletions.
3 changes: 3 additions & 0 deletions browser/base/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ with Files("**"):

SPHINX_TREES['sslerrorreport'] = 'content/docs/sslerrorreport'

with Files('content/docs/sslerrorreport/**'):
SCHEDULES.exclusive = ['docs']

MOCHITEST_MANIFESTS += [
'content/test/general/mochitest.ini',
]
Expand Down
3 changes: 3 additions & 0 deletions browser/experiments/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ EXTRA_JS_MODULES.experiments += [
XPCSHELL_TESTS_MANIFESTS += ['test/xpcshell/xpcshell.ini']

SPHINX_TREES['experiments'] = 'docs'

with Files('docs/**'):
SCHEDULES.exclusive = ['docs']
3 changes: 3 additions & 0 deletions browser/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ CONFIGURE_SUBST_FILES += ['installer/Makefile']

SPHINX_TREES['browser'] = 'docs'

with Files('docs/**'):
SCHEDULES.exclusive = ['docs']

DIRS += [
'base',
'components',
Expand Down
3 changes: 3 additions & 0 deletions build/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ with Files('**'):
# This cannot be named "build" because of bug 922191.
SPHINX_TREES['buildsystem'] = 'docs'

with Files('docs/**'):
SCHEDULES.exclusive = ['docs']

if CONFIG['OS_ARCH'] == 'WINNT':
DIRS += ['win32']
if CONFIG['WIN64_CARGO_LINKER']:
Expand Down
7 changes: 7 additions & 0 deletions dom/bindings/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,15 @@ include('/ipc/chromium/chromium-config.mozbuild')
FINAL_LIBRARY = 'xul'

SPHINX_TREES['webidl'] = 'docs'

with Files('docs/**'):
SCHEDULES.exclusive = ['docs']

SPHINX_PYTHON_PACKAGE_DIRS += ['mozwebidlcodegen']

with Files('mozwebidlcodegen/**.py'):
SCHEDULES.inclusive += ['docs']

if CONFIG['MOZ_BUILD_APP'] in ['browser', 'mobile/android', 'xulrunner']:
# This is needed for Window.webidl
DEFINES['HAVE_SIDEBAR'] = True
Expand Down
3 changes: 3 additions & 0 deletions gfx/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,6 @@ if CONFIG['ENABLE_TESTS']:
TEST_DIRS += ['tests']

SPHINX_TREES['gfx'] = 'docs'

with Files('docs/**'):
SCHEDULES.exclusive = ['docs']
3 changes: 3 additions & 0 deletions mobile/android/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,6 @@ TEST_DIRS += [
]

SPHINX_TREES['fennec'] = 'docs'

with Files('docs/**'):
SCHEDULES.exclusive = ['docs']
11 changes: 10 additions & 1 deletion moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,16 @@ with Files('**/Makefile.in'):
FINAL = True

with Files("**/*.js"):
SCHEDULES.inclusive += ['test-verify']
SCHEDULES.inclusive += ['test-verify', 'docs']

with Files("**/*.jsm"):
SCHEDULES.inclusive += ['docs']

with Files("**/*.rst"):
SCHEDULES.inclusive += ['docs']

with Files("**/*.md"):
SCHEDULES.inclusive += ['docs']

with Files("**/*.html"):
SCHEDULES.inclusive += ['test-verify']
Expand Down
6 changes: 6 additions & 0 deletions python/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,14 @@ SPHINX_PYTHON_PACKAGE_DIRS += [
'mozversioncontrol/mozversioncontrol',
]

with Files('**.py'):
SCHEDULES.inclusive += ['docs']

SPHINX_TREES['mach'] = 'mach/docs'

with Files('mach/docs/**'):
SCHEDULES.exclusive = ['docs']

PYTHON_UNITTEST_MANIFESTS += [
'mach/mach/test/python.ini',
'mozbuild/dumbmake/test/python.ini',
Expand Down
9 changes: 9 additions & 0 deletions python/mozbuild/mozbuild/schedules.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@

# TODO: ideally these lists could be specified in moz.build itself

# Inclusive components are those which are scheduled when certain files are
# changed, but do not run by default. These are generally added to
# `SCHEDULES.inclusive` using `+=`, but can also be used as exclusive
# components for files which *only* affect the named component.
INCLUSIVE_COMPONENTS = [
'docs',
'py-lint',
'js-lint',
'yaml-lint',
Expand All @@ -23,6 +28,10 @@
]
INCLUSIVE_COMPONENTS = sorted(INCLUSIVE_COMPONENTS)

# Exclusive components are those which are scheduled by default, but for which
# some files *only* affect that component. For example, most files affect all
# platforms, but platform-specific files exclusively affect a single platform.
# These components are assigned to `SCHEDULES.exclusive` with `=`.
EXCLUSIVE_COMPONENTS = [
# os families
'android',
Expand Down
17 changes: 4 additions & 13 deletions taskcluster/ci/source-test/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,8 @@ generate:
cd /builds/worker/checkouts/gecko &&
./mach doc --outdir docs-out --no-open --archive
sparse-profile: sphinx-docs
when:
files-changed:
- '**/*.py'
- '**/*.rst'
- '**/*.md'
- 'tools/docs/**'
- '**/*.js'
- '**/*.jsm'
optimization:
skip-unless-schedules: [docs]

upload:
description: Generate and upload the Sphinx documentation
Expand All @@ -47,8 +41,5 @@ upload:
sparse-profile: sphinx-docs
scopes:
- secrets:get:project/releng/gecko/build/level-{level}/gecko-docs-upload
when:
files-changed:
- '**/*.py'
- '**/*.rst'
- 'tools/docs/**'
optimization:
skip-unless-schedules: [docs]
3 changes: 3 additions & 0 deletions taskcluster/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ PYTHON_UNITTEST_MANIFESTS += [
]
SPHINX_TREES['taskcluster'] = 'docs'
SPHINX_PYTHON_PACKAGE_DIRS += ['taskgraph']

with Files('docs/**'):
SCHEDULES.exclusive = ['docs']
3 changes: 3 additions & 0 deletions testing/geckodriver/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ with Files("**"):
BUG_COMPONENT = ("Testing", "Marionette")

SPHINX_TREES["geckodriver"] = "doc"

with Files('doc/**'):
SCHEDULES.exclusive = ['docs']
3 changes: 3 additions & 0 deletions testing/marionette/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ with Files("harness/**"):
SCHEDULES.exclusive = ["marionette", "firefox-ui"]

SPHINX_TREES["marionette"] = "doc"

with Files('doc/**'):
SCHEDULES.exclusive = ['docs']
3 changes: 3 additions & 0 deletions testing/mozbase/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,8 @@ TEST_HARNESS_FILES.mozbase += [

SPHINX_TREES['/mozbase'] = 'docs'

with Files('docs/**'):
SCHEDULES.exclusive = ['docs']

with Files('**'):
BUG_COMPONENT = ('Testing', 'Mozbase')
3 changes: 3 additions & 0 deletions toolkit/components/crashes/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

SPHINX_TREES['crash-manager'] = 'docs'

with Files('docs/**'):
SCHEDULES.exclusive = ['docs']

XPIDL_MODULE = 'toolkit_crashservice'

XPIDL_SOURCES += [
Expand Down
3 changes: 3 additions & 0 deletions toolkit/components/extensions/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,7 @@ XPCSHELL_TESTS_MANIFESTS += [

SPHINX_TREES['webextensions'] = 'docs'

with Files('docs/**'):
SCHEDULES.exclusive = ['docs']

include('/ipc/chromium/chromium-config.mozbuild')
3 changes: 3 additions & 0 deletions toolkit/components/payments/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ MOCHITEST_MANIFESTS += ['test/mochitest/mochitest.ini']

SPHINX_TREES['docs'] = 'docs'

with Files('docs/**'):
SCHEDULES.exclusive = ['docs']

TESTING_JS_MODULES += [
'test/PaymentTestUtils.jsm',
]
Expand Down
3 changes: 3 additions & 0 deletions toolkit/components/telemetry/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ LOCAL_INCLUDES += [

SPHINX_TREES['telemetry'] = 'docs'

with Files('docs/**'):
SCHEDULES.exclusive = ['docs']

if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
CXXFLAGS += ['-Wno-error=shadow']

Expand Down
3 changes: 3 additions & 0 deletions toolkit/components/url-classifier/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,7 @@ if CONFIG['NIGHTLY_BUILD'] or CONFIG['MOZ_DEBUG']:

SPHINX_TREES['url-classifier'] = 'docs'

with Files('docs/**'):
SCHEDULES.exclusive = ['docs']

include('/ipc/chromium/chromium-config.mozbuild')
3 changes: 3 additions & 0 deletions toolkit/crashreporter/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

SPHINX_TREES['crashreporter'] = 'docs'

with Files('docs/**'):
SCHEDULES.exclusive = ['docs']

EXPORTS += [
'nsExceptionHandler.h',
]
Expand Down
3 changes: 3 additions & 0 deletions toolkit/modules/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ TESTING_JS_MODULES += [

SPHINX_TREES['toolkit_modules'] = 'docs'

with Files('docs/**'):
SCHEDULES.exclusive = ['docs']

EXTRA_JS_MODULES += [
'addons/MatchURLFilters.jsm',
'addons/WebNavigation.jsm',
Expand Down
3 changes: 3 additions & 0 deletions toolkit/modules/subprocess/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@ else:
XPCSHELL_TESTS_MANIFESTS += ['test/xpcshell/xpcshell.ini']

SPHINX_TREES['toolkit_modules/subprocess'] = ['docs']

with Files('docs/**'):
SCHEDULES.exclusive = ['docs']
3 changes: 3 additions & 0 deletions toolkit/mozapps/extensions/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

SPHINX_TREES['addon-manager'] = 'docs'

with Files('docs/**'):
SCHEDULES.exclusive = ['docs']

if CONFIG['MOZ_BUILD_APP'] == 'mobile/android':
DEFINES['MOZ_FENNEC'] = True

Expand Down
12 changes: 12 additions & 0 deletions tools/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ with Files("coverity/**"):

with Files("docs/**"):
BUG_COMPONENT = ("Core", "Build Config")
SCHEDULES.exclusive = ['docs']

with Files("lint/**"):
BUG_COMPONENT = ("Testing", "Lint")
Expand All @@ -47,9 +48,20 @@ with Files("update-packaging/**"):
BUG_COMPONENT = ("Release Engineering", "Other")

SPHINX_TREES['lint'] = 'lint/docs'

with Files('lint/docs/**'):
SCHEDULES.exclusive = ['docs']

SPHINX_TREES['compare-locales'] = 'compare-locales/docs'

with Files('compare-locales/docs/**'):
SCHEDULES.exclusive = ['docs']

SPHINX_TREES['try'] = 'tryselect/docs'

with Files('tryselect/docs/**'):
SCHEDULES.exclusive = ['docs']

CRAMTEST_MANIFESTS += [
'tryselect/test/cram.ini',
]
Expand Down

0 comments on commit 3546a0b

Please sign in to comment.