本文整理了Java中groovy.util.AntBuilder.<init>()
方法的一些代码示例,展示了AntBuilder.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AntBuilder.<init>()
方法的具体详情如下:
包路径:groovy.util.AntBuilder
类名称:AntBuilder
方法名:<init>
暂无
代码示例来源:origin: stackoverflow.com
def ant = new AntBuilder() // create an antbuilder
ant.unzip( src:"your-src.zip",
dest:"your-dest-directory",
overwrite:"false" )
代码示例来源:origin: stackoverflow.com
new AntBuilder ().with {
compileClasspath = path(id: "compile.classpath") {
fileset(dir: "libs") {
include(name: "**/*.jar")
}
}
// print the classpath entries to System.out
compileClasspath.list().each { println it }
javac (...) {
classpath (refid: "compile.classpath")
}
}
代码示例来源:origin: stackoverflow.com
import groovy.xml.NamespaceBuilder
def ant = new AntBuilder()
def ivy = NamespaceBuilder.newInstance(ant, 'antlib:org.apache.ivy.ant')
ivy.settings(file:"ivysettings.xml")
ivy.retrieve(pattern:"lib/[conf]/[artifact].[ext]")
ivy.report(toDir:'reports', graph:false)
代码示例来源:origin: stackoverflow.com
def doStuff = { tar, out, gzip ->
new AntBuilder().with {
tar( basedir: out, destfile: tar )
gzip( src: tar, destfile: gzip )
delete( file: tar )
delete( dir: out, includes:"*.xml" )
}
}
代码示例来源:origin: stackoverflow.com
def String execute(def cmd, def host, def uname, def pwd)throws Exception {
def ant = new AntBuilder()
ant.sshexec(host : host,
username : uname,
password : pwd,
command : "ls -l,
trust : "true",
outputproperty : "result")
return ant.project.properties."result"
}
代码示例来源:origin: stackoverflow.com
def ant = new AntBuilder()
ant.mkdir( dir: 'C:\Folder\' )
def file = new File( 'C:\Folder\', 'TestFile'+ '.txt').newWriter()
file.writeLine( 'File content' )
file.close
代码示例来源:origin: stackoverflow.com
new AntBuilder().zip(
destfile: "myfile.zip",
basedir: "baseDir")
代码示例来源:origin: snowindy/scriptlet4docx
public void prepare(File pathToDocx, String templateKey) throws IOException {
File dir = getTemplateUnzipFolder(templateKey);
if (pathToDocx.exists() && pathToDocx.isFile()) {
AntBuilder antBuilder = new AntBuilder();
HashMap<String, Object> params = new HashMap<String, Object>();
params.put("src", pathToDocx);
params.put("dest", dir);
params.put("overwrite", "true");
antBuilder.invokeMethod("unzip", params);
} else {
throw new FileNotFoundException(String.format("Cannot find docx template: '%s'",
pathToDocx.getAbsolutePath()));
}
}
代码示例来源:origin: org.codehaus.gmaven/gmaven-mojo
/**
* Lazily initialize the AntBuilder, so we can pick up the log impl correctly.
*/
private AntBuilder getAnt() {
if (this.ant == null) {
AntBuilder ant = new AntBuilder();
BuildLogger logger = (BuildLogger) ant.getAntProject().getBuildListeners().get(0);
logger.setEmacsMode(true);
this.ant = ant;
}
return this.ant;
}
代码示例来源:origin: org.codehaus.gmaven.runtime/gmaven-runtime-2.0
private AntBuilder createAntBuilder() {
AntBuilder ant = new AntBuilder();
Object obj = ant.getAntProject().getBuildListeners().elementAt(0);
if (obj instanceof BuildLogger) {
BuildLogger logger = (BuildLogger)obj;
logger.setEmacsMode(true);
}
return ant;
}
代码示例来源:origin: org.codehaus.mojo.groovy.runtime/groovy-runtime-1.1
private AntBuilder createAntBuilder() {
AntBuilder ant = new AntBuilder();
Object obj = ant.getAntProject().getBuildListeners().elementAt(0);
if (obj instanceof BuildLogger) {
BuildLogger logger = (BuildLogger)obj;
logger.setEmacsMode(true);
}
return ant;
}
代码示例来源:origin: org.codehaus.gmaven.runtime/gmaven-runtime-1.6
private AntBuilder createAntBuilder() {
AntBuilder ant = new AntBuilder();
Object obj = ant.getAntProject().getBuildListeners().elementAt(0);
if (obj instanceof BuildLogger) {
BuildLogger logger = (BuildLogger)obj;
logger.setEmacsMode(true);
}
return ant;
}
代码示例来源:origin: org.codehaus.gmaven.runtime/gmaven-runtime-1.7
private AntBuilder createAntBuilder() {
AntBuilder ant = new AntBuilder();
Object obj = ant.getAntProject().getBuildListeners().elementAt(0);
if (obj instanceof BuildLogger) {
BuildLogger logger = (BuildLogger)obj;
logger.setEmacsMode(true);
}
return ant;
}
代码示例来源:origin: org.codehaus.groovy.maven.runtime/gmaven-runtime-1.6
private AntBuilder createAntBuilder() {
AntBuilder ant = new AntBuilder();
Object obj = ant.getAntProject().getBuildListeners().elementAt(0);
if (obj instanceof BuildLogger) {
BuildLogger logger = (BuildLogger)obj;
logger.setEmacsMode(true);
}
return ant;
}
代码示例来源:origin: org.codehaus.gmaven.runtime/gmaven-runtime-1.5
private AntBuilder createAntBuilder() {
AntBuilder ant = new AntBuilder();
Object obj = ant.getAntProject().getBuildListeners().elementAt(0);
if (obj instanceof BuildLogger) {
BuildLogger logger = (BuildLogger)obj;
logger.setEmacsMode(true);
}
return ant;
}
代码示例来源:origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm
public static void main(String[] args) {
final GroovyShell shell = new GroovyShell(new Binding());
final Groovy groovy = new Groovy();
for (int i = 1; i < args.length; i++) {
final Commandline.Argument argument = groovy.createArg();
argument.setValue(args[i]);
}
final AntBuilder builder = new AntBuilder();
groovy.setProject(builder.getProject());
groovy.parseAndRunScript(shell, null, null, null, new File(args[0]), builder);
}
代码示例来源:origin: org.codehaus.groovy/groovy-all-minimal
public static void main(String[] args) {
final GroovyShell shell = new GroovyShell(new Binding());
final Groovy groovy = new Groovy();
for (int i = 1; i < args.length; i++) {
final Commandline.Argument argument = groovy.createArg();
argument.setValue(args[i]);
}
final AntBuilder builder = new AntBuilder();
groovy.setProject(builder.getProject());
groovy.parseAndRunScript(shell, null, null, null, new File(args[0]), builder);
}
代码示例来源:origin: org.codehaus.groovy/groovy-ant
public static void main(String[] args) {
final GroovyShell shell = new GroovyShell(new Binding());
final Groovy groovy = new Groovy();
for (int i = 1; i < args.length; i++) {
final Commandline.Argument argument = groovy.createArg();
argument.setValue(args[i]);
}
final AntBuilder builder = new AntBuilder();
groovy.setProject(builder.getProject());
groovy.parseAndRunScript(shell, null, null, null, new File(args[0]), builder);
}
代码示例来源:origin: org.kohsuke.droovy/groovy
public static void main(String[] args) {
final GroovyShell shell = new GroovyShell(new Binding());
final Groovy groovy = new Groovy();
for (int i = 1; i < args.length; i++) {
final Commandline.Argument argument = groovy.createArg();
argument.setValue(args[i]);
}
final AntBuilder builder = new AntBuilder();
groovy.setProject(builder.getProject());
groovy.parseAndRunScript(shell, null, null, null, new File(args[0]), builder);
}
代码示例来源:origin: org.codehaus.groovy/groovy-jdk14
public static void main(String[] args) {
final GroovyShell shell = new GroovyShell(new Binding());
final Groovy groovy = new Groovy();
for (int i = 1; i < args.length; i++) {
final Commandline.Argument argument = groovy.createArg();
argument.setValue(args[i]);
}
final AntBuilder builder = new AntBuilder();
groovy.setProject(builder.getProject());
groovy.parseAndRunScript(shell, null, null, null, new File(args[0]), builder);
}
内容来源于网络,如有侵权,请联系作者删除!