blob: 7f55b3e002e65108a627856d43aa3e5bb7013ad6 [file] [log] [blame]
<!--
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.
-->
<project name="org.apache.easyant.plugins;easyant-plugin-documentation" xmlns:ivy="antlib:org.apache.ivy.ant"
xmlns:ea="antlib:org.apache.easyant">
<ea:core-version requiredrevision="[0.10,+]" />
<ea:parameter property="target.documentation.dir" default="${target}/documentation"
description="directory where the documentation will be generated to" />
<target name="easyant-plugin-documentation:init">
<ea:parameter property="plugindoc.module.ivy" description="plugin's module ivy used to know dependencies"
default="${basedir}/module.ivy" />
<ea:parameter property="plugindoc.source.dir" description="plugin's source dirrectory used to know targets/extensionPoints etc..."
required="true" />
<ea:parameter property="plugindoc.main.confs" description="plugin's main conf" default="default" />
</target>
<target name="easyant-plugin-documentation:report" depends="easyant-plugin-documentation:init">
<ea:plugin-report moduleIvy="${plugindoc.module.ivy}" sourceDirectory="${plugindoc.source.dir}"
conf="${plugindoc.main.confs}" todir="${target.documentation.dir}" />
</target>
<target name="easyant-plugin-documentation:package" depends="easyant-plugin-documentation:report"
description="generate a package containing plugin documentation">
<ea:parameter property="target.artifacts" default="${target}/artifacts" description="destination directory for target artifacts" />
<mkdir dir="${target.artifacts}" />
<zip destfile="${target.artifacts}/${ivy.module}-documentation.zip">
<fileset dir="${target.documentation.dir}" erroronmissingdir="false" />
</zip>
</target>
<target name="easyant-plugin-documentation:generate-readme" depends="easyant-plugin-documentation:init">
<ea:plugin-report moduleIvy="${plugindoc.module.ivy}" sourceDirectory="${plugindoc.source.dir}" xslext="markdown"
xslFile="${org.apache.easyant.plugins#easyant-plugin-documentation.easyant-report-markdown.xsl.file}"
conf="${plugindoc.main.confs}" todir="${target.documentation.dir}" tofile="README.md" />
</target>
<target name="easyant-plugin-documentation:register-artifact" depends="easyant-plugin-documentation:package">
<ea:parameter property="plugindoc.publish.type" default="zip"
description="default type for plugin documentation artifacts" />
<ea:parameter property="plugindoc.publish.confs" default="documentation"
description="default configurations for plugin documentation artifacts" />
<ea:parameter property="project.ivy.instance" default="project.ivy.instance" description="the ivy instance name for your project" />
<ea:registerartifact type="${plugindoc.publish.type}" confs="${publishdoc.publish.confs}"
settingsRef="easyant.ivy.instance" />
</target>
</project>