1
groovyを使用してプロジェクトのAnt Buildを作成しようとしています。 Antibuilderをgroovyで作成する際にjarが "destdir"属性 "エラーをサポートしていません。次のようにGroovyでAntBuilderを使用してjarを作成できません
私のグルーヴィーなファイルがある
build.groovy
パッケージcom.groovy.core.utils
輸入groovy.util.AntBuilder
クラスのビルド{
def ant = new groovy.util.AntBuilder()
def base_dir = "C:/Users/abc/neon/GroovyAntDateUtils/"
def src_dir = base_dir + "src"
def lib_dir = "C:/Jars/groovy-2.4.12/lib"
def build_dir = base_dir + "com/groovy/core/utils"
def dist_dir = base_dir + "dist"
def file_name = "DateUtils"
/*, includeantruntime : "false"*/
static void main(args){
println("hi welcome to groovy");
def b = new build()
b.jar()
//b.run(args)
}
def classpath = ant.path {
fileset(dir: "${lib_dir}"){
include(name: "*.jar")
}
pathelement(path: "${build_dir}")
}
def clean(){
ant.delete(dir : "${build_dir}")
ant.delete(dir : "${dist_dir}")
}
def jar(){
clean()
buildFolder()
ant.mkdir(dir: "${dist_dir}")
ant.jar(destdir: "${dist_dir}/${file_name}.jar", basedir: "${build_dir}")
}
def compile(){
ant.javac(destdir: "${build_dir}", srcdir: "${src_dir}", classpath: "${classpath}")
}
def buildFolder(){
ant.mkdir(dir: "${build_dir}")
compile()
}
}
JDK - 1.8.0_121 アリ&アリランチャー - 1.9.0 グルーヴィー - 2.4.12
ありがとうございます!それは最後の行方不明の作品であり、それは魅力的に働いた:) – user1734698