name    = Test-JSON-Schema-Acceptance
author  = Ben Hutton (@relequestual) <relequest@cpan.org>
license = MIT
copyright_year = 2015
copyright_holder = Ben Hutton

; ATTENTION DISTRO REPACKAGERS: do NOT use fresh copies of these files
; from their source; it is important to include the original versions
; of the files as they were packaged with this cpan distribution, or
; surprising behaviour may occur.

; bring local checkout up to what the submodule commit says
[Run::BeforeBuild]
quiet = 1
run = git submodule update --init --recursive
run = git submodule update --recursive  ; fetches the commit captured in 'share'

; pull in updates to the latest commit in the submodule repository
; if there are new changes to the submodule, release will be halted by [Git::Check]
[Run::BeforeRelease]
:version = 0.050
quiet = 1
run = git submodule update --remote
run = if [[ -n $(git status --untracked --porcelain share) ]]; then bash -c "echo -e '\033[1;33m!!! submodule has changed! run './update-share' to commit updates to share/\033[0m' >&2"; fi

[Run::AfterRelease]
quiet = 1
eval = chomp(my $status = `git submodule status`);
eval = my ($new_sha) = split(' ', $status, 2);
eval = $new_sha =~ s/^\+//;
eval = `pushd ../JSON-Schema-Test-Suite; git tag -a -m'%n-%v' '%n-%v' $new_sha`

[Git::GatherDir / Gather sharedir]
root = share
prefix = share
exclude_filename = index.js
exclude_filename = package.json
exclude_filename = tox.ini
exclude_match = ^bin/
exclude_filename = tests/latest

[=inc::OldShareDirFiles]
removed = share/tests/draft2019-09/optional/format/ecmascript-regex.json
removed = share/tests/draft3/optional/format.json
removed = share/tests/draft4/optional/format.json
removed = share/tests/draft6/optional/format.json
removed = share/tests/draft7/optional/format/ecmascript-regex.json
removed = share/remotes/folder/folderInteger.json
removed = share/tests/draft2019-09/optional/content.json
removed = share/tests/draft2019-09/optional/unicode.json
removed = share/tests/draft2020-12/optional/unicode.json
removed = share/tests/draft4/optional/unicode.json
removed = share/tests/draft6/optional/unicode.json
removed = share/tests/draft7/optional/unicode.json
removed = share/remotes/draft-next/subSchemas-defs.json
removed = share/remotes/draft2019-09/subSchemas-defs.json
removed = share/remotes/draft2020-12/subSchemas-defs.json
removed = share/remotes/subSchemas-defs.json
removed = share/tests/draft-next/unknownKeyword.json
removed = share/tests/draft2019-09/unknownKeyword.json
removed = share/tests/draft2020-12/unknownKeyword.json
removed = share/tests/draft4/id.json
removed = share/tests/draft6/id.json
removed = share/tests/draft6/unknownKeyword.json
removed = share/tests/draft7/id.json
removed = share/tests/draft7/unknownKeyword.json
removed = share/tests/draft-next/id.json
removed = share/tests/draft2019-09/id.json
removed = share/tests/draft2020-12/id.json
removed = share/remotes/locationIndependentIdentifierDraft4.json
removed = share/remotes/locationIndependentIdentifierPre2019.json
removed = share/remotes/name.json
removed = share/remotes/ref-and-definitions.json
removed = share/remotes/subSchemas.json
removed = share/tests/draft3/optional/ecmascript-regex.json

[@Author::ETHER]
:version = 0.154    ; submodules, github issues
authority = cpan:RELEQUEST
bugtracker = github
installer = MakeMaker
Test::MinimumVersion.max_target_perl = 5.020 ; may go higher later on
Git::GatherDir.exclude_filename = share ; in git, this is a filename (containing submodule info)
StaticInstall.mode = off    ; sharedir
Test::ReportPrereqs.include[0] = JSON::PP
Test::ReportPrereqs.include[1] = Cpanel::JSON::XS
Test::ReportPrereqs.include[2] = JSON::XS
Test::ReportPrereqs.include[3] = Mojolicious
-remove = Test::Pod::No404s

[Prereqs / RuntimeRequires]
Mojolicious = 7.87  ; Mojo::JSON::JSON_XS

[Prereqs / RuntimeSuggests]
Class::XSAccessor = 0
Type::Tiny::XS = 0
Ref::Util::XS = 0
Cpanel::JSON::XS = 0

[Prereqs / TestRequires]
Test::Simple = 1.302176 ; Test2::API::intercept compatibility with Test::Builder and TODO
Test2::Suite = 0.000131 ; ""

; we almost certainly have a compiler available, because Syntax::Keyword::Try
; is used (via Feature::Compat::Try) on all but the most recent perl versions.
[DynamicPrereqs]
:version = 0.040
-condition = want_xs()
-body = requires('Cpanel::JSON::XS', '3.0223')

[GenerateFile / submodule_status]
filename = share/submodule_status
content_is_template = 1
content = {{
content =   chomp(my $str = `git submodule status`);
content =   my ($sha, undef, $tag) = split(' ', $str);
content =   chomp(my $url = `git config  --file .gitmodules submodule.share.url`);
content =   $sha.' '.$tag."\n".$url;
content = }}

[ShareDir]
dir = share