registration: Add development requirements to extension.json
authorKunal Mehta <legoktm@member.fsf.org>
Sun, 19 May 2019 09:17:56 +0000 (02:17 -0700)
committerKunal Mehta <legoktm@member.fsf.org>
Wed, 22 May 2019 08:59:33 +0000 (01:59 -0700)
commit1aa819513ba34521d9ef59978c0e23a4132bcaa1
tree8d015975f1cfd2c20633115a37fdb06caa18ab09
parentcfd5d33da2734eed56f665d0de49f8c332743a39
registration: Add development requirements to extension.json

Extensions can specify development dependencies in extension.json under
the "dev-requires" key. It's identical to the "requires" field.

Any requirement that is needed to pass tests, including but not limited
to, PHPUnit, QUnit, structure, phan, should be documented in this new
field. The main intention is that CI will ensure that all of these
dependencies are satisfied before running tests.

At standard runtime, the development requirements will be ignored by
MediaWiki, since it only checks for real requirements. Scripts can
manually check development requirements by calling
ExtensionRegistry::setCheckDevRequires( true ) before trying to load
things.

If both "requires" and "dev-requires" are present, MediaWiki will merge
the two together, so the environment will need to satisfy both before
proceeding.

Bug: T193824
Change-Id: I9b2936666ee3c96f5c976c7a17f11c437c2c7f48
docs/extension.schema.v1.json
docs/extension.schema.v2.json
includes/registration/ExtensionProcessor.php
includes/registration/ExtensionRegistry.php
includes/registration/Processor.php
tests/phpunit/includes/registration/ExtensionProcessorTest.php