File tree Expand file tree Collapse file tree 3 files changed +15
-8
lines changed Expand file tree Collapse file tree 3 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -173,12 +173,6 @@ func main() {
173
173
return
174
174
}
175
175
176
- if * jobsFlag > 0 {
177
- runtime .GOMAXPROCS (* jobsFlag )
178
- } else {
179
- runtime .GOMAXPROCS (runtime .NumCPU ())
180
- }
181
-
182
176
ctx := & types.Context {}
183
177
184
178
if * buildOptionsFileFlag != "" {
@@ -196,6 +190,14 @@ func main() {
196
190
ctx .InjectBuildOptions (buildOptions )
197
191
}
198
192
193
+ // Parallel Jobs flag
194
+ if * jobsFlag > 0 {
195
+ ctx .Jobs = * jobsFlag
196
+ } else {
197
+ ctx .Jobs = runtime .NumCPU ()
198
+ }
199
+ runtime .GOMAXPROCS (ctx .Jobs )
200
+
199
201
// FLAG_HARDWARE
200
202
if hardwareFolders , err := toSliceOfUnquoted (hardwareFoldersFlag ); err != nil {
201
203
printCompleteError (err )
Original file line number Diff line number Diff line change @@ -53,6 +53,10 @@ func (s *PrintUsedAndNotUsedLibraries) Run(ctx *types.Context) error {
53
53
return nil
54
54
}
55
55
56
+ if ctx .Jobs > 1 {
57
+ time .Sleep (100 * time .Millisecond )
58
+ }
59
+
56
60
logger := ctx .GetLogger ()
57
61
libraryResolutionResults := ctx .LibrariesResolutionResults
58
62
@@ -64,7 +68,5 @@ func (s *PrintUsedAndNotUsedLibraries) Run(ctx *types.Context) error {
64
68
}
65
69
}
66
70
67
- time .Sleep (100 * time .Millisecond )
68
-
69
71
return nil
70
72
}
Original file line number Diff line number Diff line change @@ -86,6 +86,9 @@ type Context struct {
86
86
87
87
// ReadFileAndStoreInContext command
88
88
FileToRead string
89
+
90
+ // Max jobs
91
+ Jobs int
89
92
}
90
93
91
94
func (ctx * Context ) ExtractBuildOptions () properties.Map {
You can’t perform that action at this time.
0 commit comments