File tree Expand file tree Collapse file tree 3 files changed +30
-5
lines changed
internal/taskfile/version Expand file tree Collapse file tree 3 files changed +30
-5
lines changed Original file line number Diff line number Diff line change @@ -128,5 +128,21 @@ tasks:
128128 ignore_error: true
129129` ` `
130130
131- [output] : https://github.com/go-task/task#output-syntax
132- [ignore_errors] : https://github.com/go-task/task#ignore-errors
131+ # # Version 2.2
132+
133+ Version 2.2 comes with a global `includes` options to include other
134+ Taskfiles :
135+
136+ ` ` ` yaml
137+ version: '2'
138+
139+ includes:
140+ docs: ./documentation # will look for ./documentation/Taskfile.yml
141+ docker: ./DockerTasks.yml
142+ ` ` `
143+
144+ Please check the [documentation][includes]
145+
146+ [output] : usage#output-syntax
147+ [ignore_errors] : usage#ignore-errors
148+ [includes] : usage#including-other-taskfiles
Original file line number Diff line number Diff line change 99 v2 = mustVersion ("2" )
1010 v21 = mustVersion ("2.1" )
1111 v22 = mustVersion ("2.2" )
12+ v23 = mustVersion ("2.3" )
1213)
1314
1415// IsV1 returns if is a given Taskfile version is version 1
@@ -31,6 +32,11 @@ func IsV22(v *semver.Constraints) bool {
3132 return v .Check (v22 )
3233}
3334
35+ // IsV23 returns if is a given Taskfile version is at least version 2.3
36+ func IsV23 (v * semver.Constraints ) bool {
37+ return v .Check (v23 )
38+ }
39+
3440func mustVersion (s string ) * semver.Version {
3541 v , err := semver .NewVersion (s )
3642 if err != nil {
Original file line number Diff line number Diff line change @@ -116,21 +116,24 @@ func (e *Executor) Setup() error {
116116 Vars : e .taskvars ,
117117 Logger : e .Logger ,
118118 }
119- case version .IsV2 (v ), version .IsV21 (v ):
119+ case version .IsV2 (v ), version .IsV21 (v ), version . IsV22 ( v ) :
120120 e .Compiler = & compilerv2.CompilerV2 {
121121 Dir : e .Dir ,
122122 Taskvars : e .taskvars ,
123123 TaskfileVars : e .Taskfile .Vars ,
124124 Expansions : e .Taskfile .Expansions ,
125125 Logger : e .Logger ,
126126 }
127- case version .IsV22 (v ):
128- return fmt .Errorf (`task: Taskfile versions greater than v2.1 not implemented in the version of Task` )
127+ case version .IsV23 (v ):
128+ return fmt .Errorf (`task: Taskfile versions greater than v2.3 not implemented in the version of Task` )
129129 }
130130
131131 if ! version .IsV21 (v ) && e .Taskfile .Output != "" {
132132 return fmt .Errorf (`task: Taskfile option "output" is only available starting on Taskfile version v2.1` )
133133 }
134+ if ! version .IsV22 (v ) && len (e .Taskfile .Includes ) > 0 {
135+ return fmt .Errorf (`task: Including Taskfiles is only available starting on Taskfile version v2.2` )
136+ }
134137 switch e .Taskfile .Output {
135138 case "" , "interleaved" :
136139 e .Output = output.Interleaved {}
You can’t perform that action at this time.
0 commit comments