Skip to content

Commit 24de973

Browse files
rtbowilzbach
authored andcommitted
document toolchain requirements (#16)
1 parent 171c5d9 commit 24de973

File tree

2 files changed

+87
-9
lines changed

2 files changed

+87
-9
lines changed

views/package_format_json.dt

Lines changed: 50 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ block body
5050
a(href="#configurations") Configurations
5151
ul
5252
li: a(href="#configuration-settings") Specific settings
53-
li: a(href="#build-types") Build types
53+
li
54+
a(href="#build-types") Build types
55+
li
56+
a(href="#toolchain-requirements") Toolchain requirements
5457

5558

5659

@@ -76,9 +79,9 @@ block body
7679
td Brief description of the package
7780

7881
tr
79-
td minDubVersion
80-
td: code string
81-
td Minimum version of DUB necessary to build the package
82+
td toolchainRequirements
83+
td: code string[string]
84+
td Set of version requirements for DUB, for compilers and for language frontend. See the <a href="#toolchain-requirements">toolchain requirements</a> section.
8285

8386
tr
8487
td homepage
@@ -389,7 +392,7 @@ block body
389392
p With this set to <code>true</code>, the dependency will be chosen by default if no dub.selections.json exists yet. If omitted, this attribute defaults to <code>false</code>. Note that this only has an effect if the "optional" attribute is set to <code>true</code>.
390393
p Note that versions prior to 0.9.25 will ignore this attribute.
391394

392-
p Version specifiers define a range of acceptable versions. They can be specified in any of the following ways:
395+
p#version-syntax Version specifiers define a range of acceptable versions. They can be specified in any of the following ways:
393396
ul
394397
li Restrict to a certain minor version: <code>"~&gt;2.2.13"</code>, equivalent to <code>"&gt;=2.2.13 &lt;2.3.0"</code>
395398
li Restrict to a certain major version: <code>"~&gt;2.2"</code>, equivalent to <code>"&gt;=2.2.0 &lt;3.0.0"</code>
@@ -724,3 +727,45 @@ block body
724727
| }
725728
| }
726729
|}
730+
731+
h2#toolchain-requirements Toolchain requirements
732+
733+
p The package can specify version requirements for the toolchain. Each requirement is specified with the <a href="#version-syntax">version dependency syntax</a>. For compilers, the keyword <code>no</code> can be specified instead of a version requirement to disallow the use of a specific compiler for the package. The following requirements are allowed:
734+
table
735+
tr
736+
th Identifier
737+
th Description
738+
tr
739+
td <code>"dub"</code>
740+
td DUB version requirement
741+
tr
742+
td <code>"frontend"</code>
743+
td D frontend version requirement
744+
tr
745+
td <code>"dmd"</code>
746+
td DMD version requirement
747+
tr
748+
td <code>"ldc"</code>
749+
td LDC version requirement
750+
tr
751+
td <code>"gdc"</code>
752+
td GDC version requirement
753+
754+
p Example 1: package that needs at least dub-1.14 and uses D features introduced in frontend 2.068 and other features that will be deprecated in frontend 2.087
755+
pre.code
756+
|{
757+
| "toolchainRequirements": {
758+
| "dub": "&gt;=1.14.0",
759+
| "frontend": "&gt;=2.068 &lt;2.087"
760+
| }
761+
|}
762+
763+
p Example 2: package that needs to be compiled with LDC from version 1.11
764+
pre.code
765+
|{
766+
| "toolchainRequirements": {
767+
| "dmd": "no",
768+
| "gdc": "no",
769+
| "ldc": "&gt;=1.11"
770+
| }
771+
|}

views/package_format_sdl.dt

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ block body
5252
li: a(href="#configuration-settings") Specific settings
5353
li
5454
a(href="#build-types") Build types
55+
li
56+
a(href="#toolchain-requirements") Toolchain requirements
5557

5658

5759

@@ -76,9 +78,9 @@ block body
7678
td Brief description of the package
7779

7880
tr
79-
td minDubVersion
80-
td: code string
81-
td Minimum version of DUB necessary to build the package
81+
td toolchainRequirements
82+
td: code &lt;requirement1&gt; [&lt;requirement2&gt; [...]]
83+
td Set of version requirements for DUB, for compilers and for language frontend. See the <a href="#toolchain-requirements">toolchain requirements</a> section.
8284

8385
tr
8486
td homepage
@@ -373,7 +375,7 @@ block body
373375
p With this set to <code>true</code>, the dependency will be chosen by default if no dub.selections.json exists yet. If omitted, this attribute defaults to <code>false</code>. Note that this only has an effect if the "optional" attribute is set to <code>true</code>.
374376
p Note that versions prior to 0.9.25 will ignore this attribute.
375377

376-
p Version specifiers define a range of acceptable versions. They can be specified in any of the following ways:
378+
p#version-syntax Version specifiers define a range of acceptable versions. They can be specified in any of the following ways:
377379
ul
378380
li Restrict to a certain minor version: <code>"~&gt;2.2.13"</code>, equivalent to <code>"&gt;=2.2.13 &lt;2.3.0"</code>
379381
li Restrict to a certain major version: <code>"~&gt;2.2"</code>, equivalent to <code>"&gt;=2.2.0 &lt;3.0.0"</code>
@@ -690,3 +692,34 @@ block body
690692
|buildType "debug-profile" {
691693
| buildOptions "debugMode" "debugInfo" "profile"
692694
|}
695+
696+
h2#toolchain-requirements Toolchain requirements
697+
698+
p The package can specify version requirements for the toolchain. Each requirement is specified with the <a href="#version-syntax">version dependency syntax</a>. For compilers, the keyword <code>no</code> can be specified instead of a version requirement to disallow the use of a specific compiler for the package. The following requirements are allowed:
699+
table
700+
tr
701+
th Identifier
702+
th Description
703+
tr
704+
td <code>"dub"</code>
705+
td DUB version requirement
706+
tr
707+
td <code>"frontend"</code>
708+
td D frontend version requirement
709+
tr
710+
td <code>"dmd"</code>
711+
td DMD version requirement
712+
tr
713+
td <code>"ldc"</code>
714+
td LDC version requirement
715+
tr
716+
td <code>"gdc"</code>
717+
td GDC version requirement
718+
719+
p Example 1: package that needs at least dub-1.14 and uses D features introduced in frontend 2.068 and other features that will be deprecated in frontend 2.087
720+
pre.code
721+
|toolchainRequirements dub="&gt;=1.14.0" frontend="&gt;=2.068 &lt;2.087"
722+
723+
p Example 2: package that needs to be compiled with LDC from version 1.11
724+
pre.code
725+
|toolchainRequirements dmd="no" gdc="no" ldc="&gt;=1.11.0"

0 commit comments

Comments
 (0)