使用AntBuilder复制文件 Groovy内建了对Ant的支持!复杂的文件操作可以直接使用Ant的. to a Directory def ant = new AntBuilder() ant.copy(file:"src.txt", todir:".. :"dest.txt", overwrite:true) //Using AntBuilder to Copy a Directory def ant = new AntBuilder() ant.copy def ant = new AntBuilder() ant.delete(file:"src.txt") 删除 目录 def ant = new AntBuilder() ant.delete(dir /backup.tar") //Zipping Up Selected Files def ant = new AntBuilder() ant.zip(destfile:"..
projectDir File 配置脚本所在的目录 buildDir File projectDir/build 输出目录 group Object 未指定 version Object 未指定 ant AntBuilder AntBuilder 实例 settings.gradle 这是一个设置文件,用于初始化以及项目树的配置。
process.waitFor(); //5 拷贝so String outPath = jniSoDir.getAbsoluteFile(); (new AntBuilder
build script. buildDir File *projectDir*/build group Object unspecified version Object unspecified ant AntBuilder An AntBuilder instance 这里描述的构建脚本针对 Project 对象。
var knownBuilders = { ant: 'AntBuilder', gradle: 'GradleBuilder', none: 'GenericBuilder'
Groovy 附带了神奇的 AntBuilder。 在 Gradle 使用 Ant 任务比在 build.xml 文件中使用 Ant 任务更方便、更强大。 而且在 Kotlin 也可以使用。