Skip to content

Commit c1d545f

Browse files
More fixes
1 parent a917451 commit c1d545f

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

jruby-maven-plugin/src/main/java/de/saumya/mojo/jruby/CompileMojo.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class CompileMojo extends AbstractJRubyMojo {
4141
/**
4242
* do not fail the goal
4343
*/
44-
@Parameter( property = "jrubyc.ignoreFailue", defaultValue = "false" )
44+
@Parameter( property = "jrubyc.ignoreFailure", defaultValue = "false" )
4545
protected boolean ignoreFailures;
4646

4747
/**
@@ -82,7 +82,14 @@ else if (!this.outputDirectory.exists()) {
8282

8383
final Script script = this.factory.newScript(
8484
"\nrequire 'jruby/jrubyc'\n"
85-
+ "status = JRubyCompiler::compile_argv(ARGV)\n"
85+
+ "status = 0\n"
86+
+ "begin\n"
87+
+ " status = JRubyCompiler::compile_argv(ARGV)\n"
88+
+ "rescue Exception\n"
89+
+ " puts \"Failure during compilation of file #{ARGV}:\\n#{$!}\"\n"
90+
+ " puts $!.backtrace\n"
91+
+ " status = 1\n"
92+
+ "end\n"
8693
+ "raise 'compilation-error(s)' if status !=0 && !"
8794
+ this.ignoreFailures);
8895

@@ -93,7 +100,7 @@ else if (!this.outputDirectory.exists()) {
93100
script.addArg("-t", fixPathSeparator(this.outputDirectory));
94101
}
95102

96-
if( getJrubyVersion().hasJRubycVerbose() && (this.jrubyVerbose || this.jrubycVerbose)){
103+
if(this.jrubyVerbose || this.jrubycVerbose){
97104
script.addArg("--verbose");
98105
}
99106
// add current directory
@@ -106,4 +113,4 @@ private String fixPathSeparator(final File f) {
106113
// http://jira.codehaus.org/browse/JRUBY-5065
107114
return f.getPath().replace(System.getProperty("file.separator"), "/");
108115
}
109-
}
116+
}

jruby-maven-plugin/src/main/java/de/saumya/mojo/jruby/JRubyVersion.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,6 @@ public boolean needsOpenSSL()
9090
return this.major == 1 && this.minor < 7;
9191
}
9292

93-
public boolean hasJRubycVerbose()
94-
{
95-
return this.major == 1 && this.minor > 5;
96-
}
97-
9893
public String toString()
9994
{
10095
return this.version;

0 commit comments

Comments
 (0)