Skip to content

Commit dc61d4d

Browse files
committed
mainClass needs to be optional for library() case
1 parent 12403e4 commit dc61d4d

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

jruby-gradle-jar-plugin/src/main/groovy/com/github/jrubygradle/jar/JRubyJar.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ class JRubyJar extends Jar {
100100
* @return configured 'Main-Class' attribute for the JRubyJar
101101
*/
102102
@Input
103+
@Optional
103104
String getMainClass() {
104105
return jarMainClass
105106
}

jruby-gradle-jar-plugin/src/test/groovy/com/github/jrubygradle/jar/JRubyJarSpec.groovy

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,19 @@ class JRubyJarSpec extends Specification {
103103
then:
104104
task.configuration == customConfig.name
105105
}
106+
107+
def "configure library()"() {
108+
given: 'a task with initScript library()'
109+
boolean evaluated = false
110+
JRubyJar task = project.task('library-jar', type: JRubyJar)
111+
112+
when:
113+
task.configure {
114+
evaluated = true
115+
initScript library()
116+
}
117+
118+
then:
119+
evaluated
120+
}
106121
}

0 commit comments

Comments
 (0)