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
8eab806d
Commit
8eab806d
authored
Jul 04, 2013
by
kyab
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add --pull_gems option to minirake
parent
4c8fd521
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
7 deletions
+27
-7
minirake
minirake
+5
-0
tasks/mruby_build_commands.rake
tasks/mruby_build_commands.rake
+10
-1
tasks/mruby_build_gem.rake
tasks/mruby_build_gem.rake
+12
-6
No files found.
minirake
View file @
8eab806d
...
@@ -317,6 +317,8 @@ class RakeApp
...
@@ -317,6 +317,8 @@ class RakeApp
"Require MODULE before executing rakefile."
],
"Require MODULE before executing rakefile."
],
[
'--tasks'
,
'-T'
,
GetoptLong
::
NO_ARGUMENT
,
[
'--tasks'
,
'-T'
,
GetoptLong
::
NO_ARGUMENT
,
"Display the tasks and dependencies, then exit."
],
"Display the tasks and dependencies, then exit."
],
[
'--pull_gems'
,
'-p'
,
GetoptLong
::
NO_ARGUMENT
,
"Pull all git mrbgems."
],
[
'--trace'
,
'-t'
,
GetoptLong
::
NO_ARGUMENT
,
[
'--trace'
,
'-t'
,
GetoptLong
::
NO_ARGUMENT
,
"Turn on invoke/execute tracing."
],
"Turn on invoke/execute tracing."
],
[
'--usage'
,
'-h'
,
GetoptLong
::
NO_ARGUMENT
,
[
'--usage'
,
'-h'
,
GetoptLong
::
NO_ARGUMENT
,
...
@@ -401,6 +403,8 @@ class RakeApp
...
@@ -401,6 +403,8 @@ class RakeApp
require
value
require
value
when
'--tasks'
when
'--tasks'
$show_tasks
=
true
$show_tasks
=
true
when
'--pull_gems'
$pull_gems
=
true
when
'--trace'
when
'--trace'
$trace
=
true
$trace
=
true
when
'--usage'
when
'--usage'
...
@@ -419,6 +423,7 @@ class RakeApp
...
@@ -419,6 +423,7 @@ class RakeApp
# Read and handle the command line options.
# Read and handle the command line options.
def
handle_options
def
handle_options
$verbose
=
false
$verbose
=
false
$pull_gems
=
false
opts
=
GetoptLong
.
new
(
*
command_line_options
)
opts
=
GetoptLong
.
new
(
*
command_line_options
)
opts
.
each
{
|
opt
,
value
|
do_option
(
opt
,
value
)
}
opts
.
each
{
|
opt
,
value
|
do_option
(
opt
,
value
)
}
end
end
...
...
tasks/mruby_build_commands.rake
View file @
8eab806d
...
@@ -220,19 +220,28 @@ module MRuby
...
@@ -220,19 +220,28 @@ module MRuby
class
Command::Git
<
Command
class
Command::Git
<
Command
attr_accessor
:flags
attr_accessor
:flags
attr_accessor
:clone_options
attr_accessor
:clone_options
,
:pull_options
def
initialize
(
build
)
def
initialize
(
build
)
super
super
@command
=
'git'
@command
=
'git'
@flags
=
[]
@flags
=
[]
@clone_options
=
"clone %{flags} %{url} %{dir}"
@clone_options
=
"clone %{flags} %{url} %{dir}"
@pull_options
=
"pull"
end
end
def
run_clone
(
dir
,
url
,
_flags
=
[])
def
run_clone
(
dir
,
url
,
_flags
=
[])
_pp
"GIT"
,
url
,
dir
.
relative_path
_pp
"GIT"
,
url
,
dir
.
relative_path
_run
clone_options
,
{
:flags
=>
[
flags
,
_flags
].
flatten
.
join
(
' '
),
:url
=>
url
,
:dir
=>
filename
(
dir
)
}
_run
clone_options
,
{
:flags
=>
[
flags
,
_flags
].
flatten
.
join
(
' '
),
:url
=>
url
,
:dir
=>
filename
(
dir
)
}
end
end
def
run_pull
(
dir
,
url
)
root
=
Dir
.
pwd
Dir
.
chdir
dir
_pp
"GIT PULL"
,
url
,
dir
.
relative_path
_run
pull_options
Dir
.
chdir
root
end
end
end
class
Command::Mrbc
<
Command
class
Command::Mrbc
<
Command
...
...
tasks/mruby_build_gem.rake
View file @
8eab806d
...
@@ -40,13 +40,19 @@ module MRuby
...
@@ -40,13 +40,19 @@ module MRuby
elsif
params
[
:git
]
elsif
params
[
:git
]
url
=
params
[
:git
]
url
=
params
[
:git
]
gemdir
=
"build/mrbgems/
#{
url
.
match
(
/([-\w]+)(\.[-\w]+|)$/
).
to_a
[
1
]
}
"
gemdir
=
"build/mrbgems/
#{
url
.
match
(
/([-\w]+)(\.[-\w]+|)$/
).
to_a
[
1
]
}
"
return
gemdir
if
File
.
exists?
(
gemdir
)
if
File
.
exists?
(
gemdir
)
if
$pull_gems
git
.
run_pull
gemdir
,
url
else
gemdir
end
else
options
=
[
params
[
:options
]]
||
[]
options
=
[
params
[
:options
]]
||
[]
options
<<
"--branch
\"
#{
params
[
:branch
]
}
\"
"
if
params
[
:branch
]
options
<<
"--branch
\"
#{
params
[
:branch
]
}
\"
"
if
params
[
:branch
]
FileUtils
.
mkdir_p
"build/mrbgems"
FileUtils
.
mkdir_p
"build/mrbgems"
git
.
run_clone
gemdir
,
url
,
options
git
.
run_clone
gemdir
,
url
,
options
end
else
else
fail
"unknown gem option
#{
params
}
"
fail
"unknown gem option
#{
params
}
"
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