Skip to content
This repository was archived by the owner on May 19, 2019. It is now read-only.

Commit e99470e

Browse files
committed
Fixed it so that 'java-base' instead of 'java' plugin is applied in the plugin. Applying 'java' is now a choice of the user
1 parent a3e17d6 commit e99470e

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,16 @@ apply plugin: 'com.github.jrubygradle.jar'
3131

3232
This loads the following plugins if they are not already loaded:
3333
+ `com.github.jrubygradle.base`
34-
+ `java`
34+
+ `java-base`
3535

3636
## Using the plugin
3737

3838
This plugin does not add any new tasks or extensions, extends the `Jar` task type with a `jruby` closure. If the `java` plugin
3939
is loaded, then the `jar` task can also be configured.
4040

4141
```groovy
42+
apply plugin: 'java'
43+
4244
jar {
4345
jruby {
4446
@@ -105,7 +107,7 @@ buildscript {
105107
106108
apply plugin: 'com.github.jrubygradle.jar'
107109
apply plugin: 'com.github.johnrengelman.shadow'
108-
110+
apply plugin: 'java'
109111
```
110112

111113
### Configuring Shadow JAR

src/main/groovy/com/github/jrubygradle/jar/JRubyJarPlugin.groovy

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class JRubyJarPlugin implements Plugin<Project> {
2020
void apply(Project project) {
2121

2222
project.apply plugin : 'com.github.jruby-gradle.base'
23-
project.apply plugin : 'java'
23+
project.apply plugin : 'java-base'
2424
project.configurations.maybeCreate('jrubyEmbeds')
2525
project.configurations.maybeCreate('jrubyJar')
2626

@@ -57,12 +57,15 @@ class JRubyJarPlugin implements Plugin<Project> {
5757

5858
}
5959

60-
project.sourceSets {
61-
main {
62-
java {
63-
srcDir new File(project.buildDir,'generated/java')
64-
}
65-
}
60+
// project.sourceSets {
61+
// main {
62+
// java {
63+
// srcDir new File(project.buildDir,'generated/java')
64+
// }
65+
// }
66+
// }
67+
project.sourceSets.matching { it.name == "main" } .all {
68+
it.java.srcDir new File(project.buildDir,'generated/java')
6669
}
6770
}
6871
@PackageScope

0 commit comments

Comments
 (0)