class FilePlugin extends org.savantbuild.plugin.groovy.BaseGroovyPlugin
File plugin.
| Fields inherited from class | Fields |
|---|---|
class org.savantbuild.plugin.groovy.BaseGroovyPlugin |
output, project, runtimeConfiguration |
| Constructor and description |
|---|
FilePlugin(org.savantbuild.domain.Project project, org.savantbuild.runtime.RuntimeConfiguration runtimeConfiguration, org.savantbuild.output.Output output) |
| Type Params | Return Type | Name and description |
|---|---|---|
|
void |
append(java.util.Map<java.lang.String, java.lang.Object> attributes, groovy.lang.Closure closure)Appends one or more files to a file. |
|
int |
copy(java.util.Map<java.lang.String, java.lang.Object> attributes, groovy.lang.Closure closure)Copies files around. |
|
void |
copyFile(java.util.Map<java.lang.String, java.lang.Object> attributes)Copies a single file to another location. |
|
void |
delete(groovy.lang.Closure closure)Deletes files using fileSets. |
|
int |
jar(java.util.Map<java.lang.String, java.lang.Object> attributes, groovy.lang.Closure closure)Creates a JAR file from various files. |
|
void |
mkdir(java.util.Map<java.lang.String, java.lang.Object> attributes)Creates a directory. |
|
void |
prune(java.util.Map<java.lang.String, java.lang.Object> attributes)Prunes the given directory. |
|
void |
rename(groovy.lang.Closure closure)Renames the files specified by one or more fileSets using the filter specified. |
|
void |
symlink(java.util.Map<java.lang.String, java.lang.Object> attributes)Creates a symbol link at the [link] attribute that points to the [target] attribute. |
|
int |
tar(java.util.Map<java.lang.String, java.lang.Object> attributes, groovy.lang.Closure closure)Creates a Tarball from various files. |
|
void |
unjar(java.util.Map<java.lang.String, java.lang.Object> attributes)Unzips a JAR file to a directory. |
|
void |
untar(java.util.Map<java.lang.String, java.lang.Object> attributes)Untars a TAR file to a directory. |
|
void |
unzip(java.util.Map<java.lang.String, java.lang.Object> attributes)Unzips a ZIP file to a directory. |
|
int |
zip(java.util.Map<java.lang.String, java.lang.Object> attributes, groovy.lang.Closure closure)Creates a ZIP file from various files. |
| Methods inherited from class | Name |
|---|---|
class org.savantbuild.plugin.groovy.BaseGroovyPlugin |
org.savantbuild.plugin.groovy.BaseGroovyPlugin#getMetaClass(), org.savantbuild.plugin.groovy.BaseGroovyPlugin#setMetaClass(groovy.lang.MetaClass), org.savantbuild.plugin.groovy.BaseGroovyPlugin#wait(long, int), org.savantbuild.plugin.groovy.BaseGroovyPlugin#wait(), org.savantbuild.plugin.groovy.BaseGroovyPlugin#wait(long), org.savantbuild.plugin.groovy.BaseGroovyPlugin#equals(java.lang.Object), org.savantbuild.plugin.groovy.BaseGroovyPlugin#toString(), org.savantbuild.plugin.groovy.BaseGroovyPlugin#hashCode(), org.savantbuild.plugin.groovy.BaseGroovyPlugin#getClass(), org.savantbuild.plugin.groovy.BaseGroovyPlugin#notify(), org.savantbuild.plugin.groovy.BaseGroovyPlugin#notifyAll(), org.savantbuild.plugin.groovy.BaseGroovyPlugin#getProperty(java.lang.String), org.savantbuild.plugin.groovy.BaseGroovyPlugin#setProperty(java.lang.String, java.lang.Object), org.savantbuild.plugin.groovy.BaseGroovyPlugin#invokeMethod(java.lang.String, java.lang.Object) |
Appends one or more files to a file. The "to" attribute specifies the target file and the "files" attribute is an array of files to append to it.
Here is an example of calling this method:
file.append(to: "build/somefile.txt") {
fileSet(dir: "foo")
}
attributes - The named attributes (to and files are required).Copies files around. This uses the CopyDelegate class to handle Closure methods.
Here is an example of calling this method:
file.copy(to: "build/distributions/bin") {* fileSet(dir: "src/main/scripts")
}* attributes - The named attributes (to is required).closure - The closure that is invoked.Copies a single file to another location.
Here is an example of calling this method:
file.copyFile(file: "some-file.txt", to: "build/some-file-renamed.txt")
attributes - The named attributes (file and to are required).Deletes files using fileSets.
Here is an example of calling this method:
file.delete {* fileSet(dir: "build/example", includePatterns: [~/foobar.+/])
}*
Creates a JAR file from various files. This uses the JarDelegate class to handle Closure methods.
Here is an example of calling this method:
file.jar(file: "build/jars/foo.jar") {* fileSet(dir: "build/classes/main")
}* attributes - The named attributes (file is required).closure - The closure that is invoked.Creates a directory. Here is an example of calling this method:
file.mkdir(dir: "foo")
attributes - The named attributes (dir is required).Prunes the given directory. This does not traverse symlinks. It unlinks symlinks.
Here is an example of calling this method:
file.prune(dir: "build/classes/main")
attributes - The named attributes (dir is required).Renames the files specified by one or more fileSets using the filter specified.
Here is an example of calling this method:
file.rename {* fileSet(dir: "build/classes/main")
filter(token: "foobar", value: "baz")
}* closure - The closureCreates a symbol link at the [link] attribute that points to the [target] attribute.
Here is an example of calling this method:
file.symlink(target: "build/classes/main", link: "/tmp/foo/bar")
attributes - The named attributes (target and link are required).Creates a Tarball from various files. This uses the TarDelegate class to handle Closure methods.
Here is an example of calling this method:
file.tar(file: "build/tars/foobar.tar.gz") {* fileSet(dir: "src/main/java")
}* attributes - The named attributes (file is required).closure - The closure that is invoked.Unzips a JAR file to a directory. This requires the [file] and [to] attributes.
Here is an example of calling this method:
file.unjar(file: "build/zips/foobar.jar", to: "build/output")
attributes - The named attributes (file is required).closure - The closure that is invoked.Untars a TAR file to a directory. This requires the [file] and [to] attributes.
Here is an example of calling this method:
file.untar(file: "build/tars/foobar.tar.gz", to: "build/output")
attributes - The named attributes (file is required).closure - The closure that is invoked.Unzips a ZIP file to a directory. This requires the [file] and [to] attributes.
Here is an example of calling this method:
file.unzip(file: "build/zips/foobar.zip", to: "build/output")
attributes - The named attributes (file is required).closure - The closure that is invoked.Creates a ZIP file from various files. This uses the ZipDelegate class to handle Closure methods.
Here is an example of calling this method:
file.zip(file: "build/jars/foo.zip") {* fileSet(dir: "build/classes/main")
}* attributes - The named attributes (file is required).closure - The closure that is invoked.