Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
54712c06
Unverified
Commit
54712c06
authored
Jul 12, 2019
by
Yukihiro "Matz" Matsumoto
Committed by
GitHub
Jul 12, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4572 from shuujii/lazy-load-tasks-toolchains
Lazy load `tasks/toolchains/*.rake`
parents
c5f0a025
16e4657a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
lib/mruby/build.rb
lib/mruby/build.rb
+9
-10
No files found.
lib/mruby/build.rb
View file @
54712c06
...
...
@@ -22,7 +22,6 @@ module MRuby
def
initialize
(
name
,
&
block
)
@name
,
@initializer
=
name
.
to_s
,
block
MRuby
::
Toolchain
.
toolchains
||=
{}
MRuby
::
Toolchain
.
toolchains
[
@name
]
=
self
end
...
...
@@ -30,13 +29,8 @@ module MRuby
conf
.
instance_exec
(
conf
,
params
,
&
@initializer
)
end
def
self
.
load
Dir
.
glob
(
"
#{
MRUBY_ROOT
}
/tasks/toolchains/*.rake"
).
each
do
|
file
|
Kernel
.
load
file
end
end
self
.
toolchains
=
{}
end
Toolchain
.
load
class
Build
class
<<
self
...
...
@@ -196,10 +190,15 @@ EOS
end
def
toolchain
(
name
,
params
=
{})
tc
=
Toolchain
.
toolchains
[
name
.
to_s
]
fail
"Unknown
#{
name
}
toolchain"
unless
tc
name
=
name
.
to_s
tc
=
Toolchain
.
toolchains
[
name
]
||
begin
path
=
"
#{
MRUBY_ROOT
}
/tasks/toolchains/
#{
name
}
.rake"
fail
"Unknown
#{
name
}
toolchain"
unless
File
.
exist?
(
path
)
load
path
Toolchain
.
toolchains
[
name
]
end
tc
.
setup
(
self
,
params
)
@toolchains
.
unshift
name
.
to_s
@toolchains
.
unshift
name
end
def
primary_toolchain
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment