/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.text.SimpleDateFormat def ant = new AntBuilder(); ant.path(id:"compile.classpath") { project.compileClasspathElements.each{ pathelement(path:"${it}") } } ant.copy(todir: new File(project.basedir, "./target/sources")) { fileset(dir: new File(project.basedir, "../cocoon-controller/src/main/java")) { exclude(name: '**/.svn') } fileset(dir: new File(project.basedir, "../cocoon-optional/src/main/java")) { exclude(name: '**/.svn') } fileset(dir: new File(project.basedir, "../cocoon-pipeline/src/main/java")) { exclude(name: '**/.svn') } fileset(dir: new File(project.basedir, "../cocoon-sax/src/main/java")) { exclude(name: '**/.svn') } fileset(dir: new File(project.basedir, "../cocoon-stax/src/main/java")) { exclude(name: '**/.svn') } fileset(dir: new File(project.basedir, "../cocoon-profiling/src/main/java")) { exclude(name: '**/.svn') } fileset(dir: new File(project.basedir, "../cocoon-monitoring/src/main/java")) { exclude(name: '**/.svn') } fileset(dir: new File(project.basedir, "../cocoon-rest/src/main/java")) { exclude(name: '**/.svn') } fileset(dir: new File(project.basedir, "../cocoon-servlet/src/main/java")) { exclude(name: '**/.svn') } fileset(dir: new File(project.basedir, "../cocoon-sitemap/src/main/java")) { exclude(name: '**/.svn') } fileset(dir: new File(project.basedir, "../cocoon-stringtemplate/src/main/java")) { exclude(name: '**/.svn') } fileset(dir: new File(project.basedir, "../cocoon-util/src/main/java")) { exclude(name: '**/.svn') } fileset(dir: new File(project.basedir, "../cocoon-wicket/src/main/java")) { exclude(name: '**/.svn') } } String title = "Apache Cocoon " + project.version + " API"; String inceptionYear = project.inceptionYear SimpleDateFormat yearFormat = new SimpleDateFormat('yyyy') String currentYear = yearFormat.format(new Date()); if(!inceptionYear.equals(currentYear)) { inceptionYear = inceptionYear + "-" + currentYear } ant.javadoc( destdir : new File(project.basedir, "./target/apidocs"), sourcepath : new File(project.basedir, "./target/sources"), classpathref : "compile.classpath", Author : "Apache Cocoon", Doctitle : title, Windowtitle : title, bottom : "Copyright © " + inceptionYear + " The Apache Software Foundation. All Rights Reserved." ) { link(href : 'http://java.sun.com/javase/6/docs/api/') link(href : 'http://static.springsource.org/spring/docs/3.0.x/javadoc-api/') link(href : 'http://www.slf4j.org/api/') link(href : 'http://download.oracle.com/javaee/5/api/index.html') }