Compare commits
3 Commits
8320341dd5
...
b4453643d9
Author | SHA1 | Date |
---|---|---|
Schalk W. Cronjé | b4453643d9 | |
Lóránt Pintér | 9374f94648 | |
Lóránt Pintér | cd0da9b064 |
|
@ -33,6 +33,7 @@ import org.gradle.api.file.CopySpec
|
|||
import org.gradle.api.file.FileCopyDetails
|
||||
import org.gradle.api.file.RelativePath
|
||||
import org.gradle.api.tasks.Input
|
||||
import org.gradle.api.tasks.Internal
|
||||
import org.gradle.api.tasks.OutputFile
|
||||
import org.gradle.api.tasks.TaskAction
|
||||
import org.ysb33r.grolifant.api.core.ProjectOperations
|
||||
|
@ -74,6 +75,7 @@ class GenerateGradleRb extends DefaultTask implements JRubyAwareTask {
|
|||
this.gemInstallDir = dir
|
||||
}
|
||||
|
||||
@Internal
|
||||
File getDestinationDir() {
|
||||
projectOperations.file(destinationDir)
|
||||
}
|
||||
|
@ -88,10 +90,16 @@ class GenerateGradleRb extends DefaultTask implements JRubyAwareTask {
|
|||
StringUtils.stringize(baseName)
|
||||
}
|
||||
|
||||
@Internal
|
||||
File getGemInstallDir() {
|
||||
projectOperations.file(this.gemInstallDir)
|
||||
}
|
||||
|
||||
@Input
|
||||
protected String getGemInstallDirPath() {
|
||||
getGemInstallDir().absolutePath
|
||||
}
|
||||
|
||||
@TaskAction
|
||||
@CompileDynamic
|
||||
@SuppressWarnings('DuplicateStringLiteral')
|
||||
|
@ -99,7 +107,7 @@ class GenerateGradleRb extends DefaultTask implements JRubyAwareTask {
|
|||
Object source = getSourceFromResource()
|
||||
File destination = destinationFile().parentFile
|
||||
String path = classpathFromConfiguration(jruby.jrubyConfiguration).join(File.pathSeparator)
|
||||
String gemDir = getGemInstallDir().absolutePath
|
||||
String gemDir = getGemInstallDirPath()
|
||||
String bootstrapName = getBaseName()
|
||||
String bootstrapTemplate = BOOTSTRAP_TEMPLATE
|
||||
logger.info("GenerateGradleRb - source: ${source}, destination: ${destination}, baseName: ${baseName}")
|
||||
|
|
|
@ -29,10 +29,15 @@ import com.github.jrubygradle.internal.JRubyExecUtils
|
|||
import groovy.transform.CompileStatic
|
||||
import org.gradle.api.Task
|
||||
import org.gradle.api.artifacts.Configuration
|
||||
import org.gradle.api.model.ReplacedBy
|
||||
import org.gradle.api.provider.Provider
|
||||
import org.gradle.api.tasks.Input
|
||||
import org.gradle.api.tasks.InputFile
|
||||
import org.gradle.api.tasks.JavaExec
|
||||
import org.gradle.api.tasks.LocalState
|
||||
import org.gradle.api.tasks.Optional
|
||||
import org.gradle.api.tasks.PathSensitive
|
||||
import org.gradle.api.tasks.PathSensitivity
|
||||
import org.gradle.api.tasks.TaskContainer
|
||||
import org.gradle.process.JavaExecSpec
|
||||
import org.gradle.util.GradleVersion
|
||||
|
@ -100,7 +105,8 @@ class JRubyExec extends JavaExec implements JRubyAwareTask, JRubyExecSpec {
|
|||
* @return The path to the script (or {@code null} if not set)
|
||||
*/
|
||||
@Optional
|
||||
@Input
|
||||
@InputFile
|
||||
@PathSensitive(PathSensitivity.NONE)
|
||||
File getScript() {
|
||||
resolveScript(projectOperations, this.script)
|
||||
}
|
||||
|
@ -185,6 +191,7 @@ class JRubyExec extends JavaExec implements JRubyAwareTask, JRubyExecSpec {
|
|||
*
|
||||
* @return Provider of GEM working directory.
|
||||
*/
|
||||
@LocalState
|
||||
Provider<File> getGemWorkDir() {
|
||||
this.gemWorkDir
|
||||
}
|
||||
|
@ -196,6 +203,7 @@ class JRubyExec extends JavaExec implements JRubyAwareTask, JRubyExecSpec {
|
|||
*
|
||||
*/
|
||||
@Deprecated
|
||||
@ReplacedBy('jruby.jrubyVersion')
|
||||
String getJrubyVersion() {
|
||||
deprecated('Use jruby.getJrubyVersion() rather getJrubyVersion()')
|
||||
jruby.jrubyVersion
|
||||
|
|
|
@ -106,6 +106,11 @@ subprojects {
|
|||
ideReport.enabled = true
|
||||
ideReport.destination = file( "${project.codenarc.reportsDir}/${reportName}.ide.txt")
|
||||
}
|
||||
|
||||
tasks.withType(ValidateTaskProperties) { validateTaskProperties ->
|
||||
validateTaskProperties.failOnWarning = true
|
||||
validateTaskProperties.enableStricterValidation = true
|
||||
}
|
||||
}
|
||||
|
||||
idea {
|
||||
|
|
|
@ -34,12 +34,14 @@ import org.gradle.api.tasks.Input
|
|||
import org.gradle.api.tasks.InputFiles
|
||||
import org.gradle.api.tasks.Internal
|
||||
import org.gradle.api.tasks.Optional
|
||||
import org.gradle.api.tasks.PathSensitive
|
||||
import org.gradle.api.tasks.TaskAction
|
||||
import org.ysb33r.grolifant.api.core.ProjectOperations
|
||||
|
||||
import static com.github.jrubygradle.api.gems.GemOverwriteAction.SKIP
|
||||
import static com.github.jrubygradle.api.gems.GemUtils.extractGems
|
||||
import static com.github.jrubygradle.api.gems.GemUtils.setupJars
|
||||
import static org.gradle.api.tasks.PathSensitivity.ABSOLUTE
|
||||
|
||||
/** Abstract base class for building custom tasks for preparing GEMs.
|
||||
*
|
||||
|
@ -86,10 +88,25 @@ abstract class AbstractJRubyPrepare extends DefaultTask implements JRubyAwareTas
|
|||
/** All GEMs that have been supplied as dependencies.
|
||||
*
|
||||
* @return Collection of GEMs.
|
||||
*
|
||||
* @see #getGemsAsFileCollection()
|
||||
* @deprecated Use {@link #getGemsAsFileCollection()} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
FileCollection gemsAsFileCollection() {
|
||||
gemsAsFileCollection
|
||||
}
|
||||
|
||||
/** All GEMs that have been supplied as dependencies.
|
||||
*
|
||||
* @return Collection of GEMs.
|
||||
*
|
||||
* @since 2.1.0
|
||||
*/
|
||||
@InputFiles
|
||||
FileCollection gemsAsFileCollection() {
|
||||
return GemUtils.getGems(projectOperations.files(this.dependencies))
|
||||
@PathSensitive(ABSOLUTE)
|
||||
FileCollection getGemsAsFileCollection() {
|
||||
GemUtils.getGems(projectOperations.files(this.dependencies))
|
||||
}
|
||||
|
||||
@Internal
|
||||
|
@ -99,7 +116,6 @@ abstract class AbstractJRubyPrepare extends DefaultTask implements JRubyAwareTas
|
|||
*
|
||||
* @param f One or more of file, directory, configuration or list of gems.
|
||||
*/
|
||||
@Optional
|
||||
void dependencies(Object... f) {
|
||||
this.dependencies.addAll(f.toList())
|
||||
}
|
||||
|
@ -110,6 +126,7 @@ abstract class AbstractJRubyPrepare extends DefaultTask implements JRubyAwareTas
|
|||
*
|
||||
* @since 2.1.0
|
||||
*/
|
||||
@Internal
|
||||
protected ProjectOperations getProjectOperations() {
|
||||
this.projectOperations
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue