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

Commit 1bc9071

Browse files
committed
gemDir refactored to use the GemUtils.gemCopySpec utility method
1 parent 39a120d commit 1bc9071

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

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

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package com.github.jrubygradle.jar
33
import groovy.transform.PackageScope
44
import org.gradle.api.Project
55
import org.gradle.api.tasks.bundling.Jar
6+
import com.github.jrubygradle.GemUtils
67

78
/** Helper class to add extra methods to {@code Jar} tasks in order to add JRuby specifics.
89
*
@@ -39,21 +40,17 @@ class JRubyJarConfigurator {
3940

4041
/** Adds a GEM installation directory
4142
*/
42-
void gemDir(File f) {
43-
gemDir(f.absolutePath)
43+
void gemDir(def properties=[:],File f) {
44+
gemDir(properties,f.absolutePath)
4445
}
4546

4647
/** Adds a GEM installation directory
48+
* @param Properties that affect how the GEM is packaged in the JAR. Currently only {@code fullGem} is
49+
* supported. If set the full GEM content will be packed, otherwise only a subset will be packed.
4750
* @param dir Source folder. Will be handled by {@code project.files(dir)}
4851
*/
49-
void gemDir(Object dir) {
50-
archive.with {
51-
from(dir) {
52-
include '**'
53-
exclude 'cache/**'
54-
exclude 'gems/*/test/**'
55-
}
56-
}
52+
void gemDir(def properties=[:],Object dir) {
53+
archive.with GemUtils.gemCopySpec(properties,archive.project,dir)
5754
}
5855

5956
/** Makes the JAR executable by setting a custom main class

0 commit comments

Comments
 (0)