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
ae5ff737
Unverified
Commit
ae5ff737
authored
Feb 13, 2019
by
Yukihiro "Matz" Matsumoto
Committed by
GitHub
Feb 13, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4273 from shuujii/refine-mruby-bin-config-mrbgem.rake
Refine `mrbgems/mruby-bin-config/mrbgem.rake`
parents
37bc343e
c592c093
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
13 deletions
+18
-13
mrbgems/mruby-bin-config/mrbgem.rake
mrbgems/mruby-bin-config/mrbgem.rake
+18
-13
No files found.
mrbgems/mruby-bin-config/mrbgem.rake
View file @
ae5ff737
MRuby
.
each_target
do
next
if
kind_of?
MRuby
::
CrossBuild
unless
MRuby
::
Build
.
current
.
kind_of?
(
MRuby
::
CrossBuild
)
MRuby
::
Gem
::
Specification
.
new
(
'mruby-bin-config'
)
do
|
spec
|
name
=
'mruby-config'
spec
.
license
=
'MIT'
spec
.
author
=
'mruby developers'
spec
.
summary
=
"
#{
name
}
command"
mruby_config
=
'mruby-config'
+
(
ENV
[
'OS'
]
==
'Windows_NT'
?
'.bat'
:
''
)
mruby_config_path
=
"
#{
build_dir
}
/bin/
#{
mruby_config
}
"
@bins
<<
mruby_config
mruby_config
=
name
+
(
ENV
[
'OS'
]
==
'Windows_NT'
?
'.bat'
:
''
)
mruby_config_path
=
"
#{
build
.
build_dir
}
/bin/
#{
mruby_config
}
"
make_cfg
=
"
#{
build
.
build_dir
}
/lib/libmruby.flags.mak"
build
.
bins
<<
mruby_config
make_cfg
=
"
#{
build_dir
}
/lib/libmruby.flags.mak"
file
mruby_config_path
=>
[
libmruby_static
,
make_cfg
]
do
|
t
|
FileUtils
.
copy
"
#{
File
.
dirname
(
__FILE__
)
}
/
#{
mruby_config
}
"
,
t
.
name
config
=
Hash
[
open
(
make_cfg
).
read
.
split
(
"
\n
"
).
map
{
|
x
|
a
=
x
.
split
(
/\s*=\s*/
,
2
);
[
a
[
0
],
a
[
1
].
gsub
(
'\\"'
,
'"'
)
]
}]
IO
.
write
(
t
.
name
,
File
.
open
(
t
.
name
)
{
|
f
|
f
.
read
.
gsub
(
/echo (MRUBY_CFLAGS|MRUBY_LIBS|MRUBY_LDFLAGS_BEFORE_LIBS|MRUBY_LDFLAGS|MRUBY_LIBMRUBY_PATH)/
)
{
|
x
|
config
[
$1
].
empty?
?
''
:
"echo
#{
config
[
$1
]
}
"
}
}
)
FileUtils
.
chmod
(
0755
,
t
.
name
)
file
mruby_config_path
=>
[
build
.
libmruby_static
,
make_cfg
]
do
|
t
|
config
=
Hash
[
File
.
readlines
(
make_cfg
).
map
(
&
:chomp
).
map
{
|
l
|
l
.
gsub
(
'\\"'
,
'"'
).
split
(
' = '
,
2
).
map!
{
|
s
|
s
.
sub
(
/^(?=.)/
,
'echo '
)}
}]
tmplt
=
File
.
read
(
"
#{
__dir__
}
/
#{
mruby_config
}
"
)
File
.
write
(
t
.
name
,
tmplt
.
gsub
(
/(
#{
Regexp
.
union
(
*
config
.
keys
)
}
)\b/
,
config
))
FileUtils
.
chmod
(
0755
,
t
.
name
)
end
end
end
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