File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,33 @@ if not runenvs then
7
7
import (" private.action.run.make_runenvs" )
8
8
end
9
9
10
+ -- config target
11
+ function _config_target (target )
12
+ local oldenvs = os .addenvs (target :pkgenvs ())
13
+ for _ , rule in ipairs (target :orderules ()) do
14
+ local on_config = rule :script (" config" )
15
+ if on_config then
16
+ on_config (target )
17
+ end
18
+ end
19
+ local on_config = target :script (" config" )
20
+ if on_config then
21
+ on_config (target )
22
+ end
23
+ if oldenvs then
24
+ os .setenvs (oldenvs )
25
+ end
26
+ end
27
+
28
+ -- config targets
29
+ function _config_targets ()
30
+ for _ , target in ipairs (project .ordertargets ()) do
31
+ if target :is_enabled () then
32
+ _config_target (target )
33
+ end
34
+ end
35
+ end
36
+
10
37
-- recursively target add env
11
38
function _add_target_pkgenvs (target , envs , targets_added )
12
39
if targets_added [target :name ()] then
@@ -33,6 +60,7 @@ function main (targetname)
33
60
if not os .isfile (os .projectfile ()) then
34
61
return
35
62
end
63
+ _config_targets ()
36
64
37
65
-- get target
38
66
local target = nil
You can’t perform that action at this time.
0 commit comments