@@ -34,11 +34,13 @@ import org.gradle.api.tasks.Input
3434import org.gradle.api.tasks.InputFiles
3535import org.gradle.api.tasks.Internal
3636import org.gradle.api.tasks.Optional
37+ import org.gradle.api.tasks.PathSensitive
3738import org.gradle.api.tasks.TaskAction
3839
3940import static com.github.jrubygradle.api.gems.GemOverwriteAction.SKIP
4041import static com.github.jrubygradle.api.gems.GemUtils.extractGems
4142import static com.github.jrubygradle.api.gems.GemUtils.setupJars
43+ import static org.gradle.api.tasks.PathSensitivity.ABSOLUTE
4244
4345/* * Abstract base class for building custom tasks for preparing GEMs.
4446 *
@@ -81,9 +83,24 @@ abstract class AbstractJRubyPrepare extends DefaultTask implements JRubyAwareTas
8183 /* * All GEMs that have been supplied as dependencies.
8284 *
8385 * @return Collection of GEMs.
86+ *
87+ * @see #getGemsAsFileCollection()
88+ * @deprecated Use {@link #getGemsAsFileCollection()} instead.
8489 */
85- @InputFiles
90+ @Deprecated
8691 FileCollection gemsAsFileCollection () {
92+ gemsAsFileCollection
93+ }
94+
95+ /* * All GEMs that have been supplied as dependencies.
96+ *
97+ * @return Collection of GEMs.
98+ *
99+ * @since 2.1.0
100+ */
101+ @InputFiles
102+ @PathSensitive (ABSOLUTE )
103+ FileCollection getGemsAsFileCollection () {
87104 return GemUtils . getGems(project. files(this . dependencies))
88105 }
89106
@@ -94,7 +111,6 @@ abstract class AbstractJRubyPrepare extends DefaultTask implements JRubyAwareTas
94111 *
95112 * @param f One or more of file, directory, configuration or list of gems.
96113 */
97- @Optional
98114 void dependencies (Object ... f ) {
99115 this . dependencies. addAll(f. toList())
100116 }
@@ -121,7 +137,7 @@ abstract class AbstractJRubyPrepare extends DefaultTask implements JRubyAwareTas
121137 void exec () {
122138 File out = getOutputDir()
123139 File jrubyJar = jrubyJarLocation. get()
124- extractGems(project, jrubyJar, gemsAsFileCollection() , out, SKIP )
140+ extractGems(project, jrubyJar, gemsAsFileCollection, out, SKIP )
125141
126142 dependencies. findAll {
127143 it instanceof Configuration
0 commit comments