Skip to content

Instantly share code, notes, and snippets.

@kimukou
Created October 15, 2012 03:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kimukou/3890692 to your computer and use it in GitHub Desktop.
Save kimukou/3890692 to your computer and use it in GitHub Desktop.
JPP_Ant_Test
ant.path(id: "aptFactoryPath",location:'factory/jsonpullparser-apt-1.4.11.jar')
ant.path(id: "path") {
fileset(dir: "${config.sdk.dir}/tools/lib") {
include(name: "**/*.jar")
}
fileset(dir: 'libs') {
include(name: "**/*.jar")
}
}
ant.mkdir(dir:'bin')
ant.mkdir(dir:'gen')
ant.apt(compile: false,
includeAntRuntime:false,
factorypathref:'aptFactoryPath',
classpathref:'path',
factory: 'net.vvakame.util.jsonpullparser.factory.JsonAnnotationProcessor',
srcdir: 'src',
destdir: 'gen',
encoding: 'UTF-8')
{
ant.option(name: 'JsonPullParserClassPostfix', value: 'Gererated')
ant.option(name: 'JsonPullParserDebug', value: 'true')
}
ant.javac(
errorproperty: "cmdErrA",
failonerror: "true",
srcdir:"src/com/twitpic/bean",
destdir:"bin",
compiler:"javac1.6",
classpathref:"aptFactoryPath",
debug:'on',
encoding:"UTF-8") {
compilerarg(line:"-AJsonPullParserClassPostfix=Gererated -AJsonPullParserDebug=true")
}
参考資料)
http://doma.seasar.org/reference/apt.html#Ant
http://d.hatena.ne.jp/unageanu/20070527/1180254621
http://www.hitachi.co.jp/Prod/comp/soft1/manual/cosmi/v0900/03Y2301D/EY230135.HTM
ant.exec(outputproperty:"cmdOutA",
errorproperty: "cmdErrA",
resultproperty:"cmdExitA",
failonerror: "true",
dir:".",
executable: "apt") {
arg(value:"-AJsonPullParserClassPostfix=Gererated")
arg(value:"-AJsonPullParserDebug=true")
arg(line:"-cp factory/jsonpullparser-apt-1.4.11.jar")
arg(line:"-factory net.vvakame.util.jsonpullparser.factory.JsonAnnotationProcessor")
arg(line:"-d bin")
arg(line:"-s gen")
new File("src/com/twitpic/bean").eachFileMatch(~".*.java"){
arg(value:it.absolutePath)
println it.absolutePath
}
}
println "[$cmd]<${ant.project.properties.cmdExitA}>=${ant.project.properties.cmdOutA}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment