Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
ruby-build
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ruby-build
Commits
047953e1
Commit
047953e1
authored
Feb 10, 2014
by
Mislav Marohnić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify Java 7 detection and error message
parent
88968339
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
12 deletions
+50
-12
bin/ruby-build
+10
-12
test/build.bats
+40
-0
No files found.
bin/ruby-build
View file @
047953e1
...
@@ -65,6 +65,12 @@ sanitize() {
...
@@ -65,6 +65,12 @@ sanitize() {
printf
"%s"
"
$1
"
| sed
"s/[^A-Za-z0-9.-]/_/g; s/__*/_/g"
printf
"%s"
"
$1
"
| sed
"s/[^A-Za-z0-9.-]/_/g; s/__*/_/g"
}
}
colorize
()
{
if
[
-t
1
]
;
then
printf
"
\e
[%sm%s
\e
[m"
"
$1
"
"
$2
"
else
echo
-n
"
$2
"
fi
}
build_failed
()
{
build_failed
()
{
{
echo
{
echo
echo
"BUILD FAILED"
echo
"BUILD FAILED"
...
@@ -577,18 +583,10 @@ fix_rbx_irb() {
...
@@ -577,18 +583,10 @@ fix_rbx_irb() {
}
}
require_java7
()
{
require_java7
()
{
local
version
=
`
java
-version
2>&1
`
local
version
=
"
$(
java
-version
2>/dev/null | head
-1
)
"
if
[
$?
-eq
0
]
if
[[
$version
!=
*
1.[789]
*
]]
;
then
then
colorize 1
"ERROR"
>
&3
if
[[
$version
==
*
1.[78]
*
]]
echo
": Java 7 required. Please install a 1.7-compatible JRE."
>
&3
then
return
0
else
echo
"jruby-9000-dev requires Java 7 - please install a 1.7 compatible JRE, or ensure it is on your path"
return
1
fi
else
echo
"Couldn't execute Java - please install a 1.7 compatible JRE, or ensure it is on your path"
return
1
return
1
fi
fi
}
}
...
...
test/build.bats
View file @
047953e1
...
@@ -421,6 +421,46 @@ nice gem things
...
@@ -421,6 +421,46 @@ nice gem things
OUT
OUT
}
}
@test "JRuby Java 7 missing" {
cached_tarball "jruby-9000.dev" bin/jruby
stub java false
run_inline_definition <<DEF
require_java7
install_package "jruby-9000.dev" "http://ci.jruby.org/jruby-dist-9000.dev-bin.tar.gz" jruby
DEF
assert_failure <<OUT
ERROR: Java 7 required. Please install a 1.7-compatible JRE.
OUT
}
@test "JRuby Java is outdated" {
cached_tarball "jruby-9000.dev" bin/jruby
stub java '-version : echo java version "1.6.0_21"'
run_inline_definition <<DEF
require_java7
install_package "jruby-9000.dev" "http://ci.jruby.org/jruby-dist-9000.dev-bin.tar.gz" jruby
DEF
assert_failure <<OUT
ERROR: Java 7 required. Please install a 1.7-compatible JRE.
OUT
}
@test "JRuby Java 7 up-to-date" {
cached_tarball "jruby-9000.dev" bin/jruby
stub java '-version : echo java version "1.7.0_21"'
run_inline_definition <<DEF
require_java7
install_package "jruby-9000.dev" "http://ci.jruby.org/jruby-dist-9000.dev-bin.tar.gz" jruby
DEF
assert_success
}
@test "non-writable TMPDIR aborts build" {
@test "non-writable TMPDIR aborts build" {
export TMPDIR="${TMP}/build"
export TMPDIR="${TMP}/build"
mkdir -p "$TMPDIR"
mkdir -p "$TMPDIR"
...
...
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