This is an automated email from the ASF dual-hosted git repository.
asf-gitbox-commits pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ant-antlibs-common.git
The following commit(s) were added to refs/heads/master by this push:
new 4bc0835 simplify creation of new antlibs
4bc0835 is described below
commit 4bc0835ac521a9b64a623a94225cfdbcce708193
Author: Stefan Bodewig <[email protected]>
AuthorDate: Sun May 31 22:38:52 2026 +0200
simplify creation of new antlibs
---
README.md | 216 +----------------------------------
README.md => seed-new-antlib.xml | 236 ++++++++++++++++++++-------------------
2 files changed, 130 insertions(+), 322 deletions(-)
diff --git a/README.md b/README.md
index 83c4841..4f14595 100644
--- a/README.md
+++ b/README.md
@@ -14,219 +14,15 @@ build and Apache Ivy for dependency management.
* add this git repository as submodule named common to your new
repository: `git submodule add
https://gitbox.apache.org/repos/asf/ant-antlibs-common.git common`
-* copy `LICENSE`, `gitignore` and `.gitattributes` from `common` to
- the top level directory of your new antlib.
-* copy `NOTICE.template` from `common` to a file named `NOTICE` inside
- the top level directory of your new antlib and adapt its content
- (PRODUCT_NAME and copyright year.
-* add a minimal `build.xml` file to the top level directory of your
- project.
- Something like
-```xml
-<?xml version="1.0"?>
-<!--
-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
-
-https://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 default="compile" name="YOUR_ANTLIB_NAME">
-
- <!-- easy way to override properties -->
- <property file="build.properties"/>
-
- <import file="common/build.xml"/>
-</project>
-```
+* run `ant -f common/seed-new-antlib.xml`
+* this has copied files from common to your root directory: `LICENSE`,
+ `gitignore`, `.gitattributes`, `docs/style.css`
+* it created files `NOTICE`, `build.xml`, `changes.xml`,
+ `contributors.xml`, `version.properties` and `ivy.xml` based on your
+ inputs. You should review its contents.
* if there are any properties you want to override (you most likely
will want to change `javac.-source` and `javac.-target`) create a
`build.properties` file and add them.
-* create a more or less empty `contributors.xml` file to the top level
- directory of your antlib. Add yourself. The structure is
-```xml
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- 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
-
- https://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.
--->
-<!DOCTYPE contributors
-[
-<!ELEMENT name (first?, middle?, last)>
-<!ELEMENT contributors (introduction, name+)>
-<!ELEMENT first (#PCDATA)>
-<!ELEMENT introduction (#PCDATA)>
-<!ELEMENT middle (#PCDATA)>
-<!ELEMENT last (#PCDATA)>
-]
->
-
-<contributors>
- <introduction>
- These are some of the many people who have helped with this Ant Library.
- </introduction>
- <name>
- <first>YOUR FIRST NAME</first>
- <last>YOUR LAST NAME</last>
- </name>
-</contributors>
-```
-* create a more or less empty `changes.xml` file to the top level
- directory of your antlib. The structure is
-```xml
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- 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
-
- https://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.
--->
-<!DOCTYPE document
-[
-<!ELEMENT document (properties?, release+)>
-<!ELEMENT properties (title)>
-<!ELEMENT title (#PCDATA)>
-<!ELEMENT release (action*)>
-<!ELEMENT action (#PCDATA)>
-<!ATTLIST release
- version CDATA #REQUIRED
- date CDATA #REQUIRED
- description CDATA #IMPLIED>
-<!ATTLIST action
- issue CDATA #IMPLIED
- type (add|fix|remove|update) #REQUIRED
- breaks-bwc (true|false) #IMPLIED>
-]
->
-<document>
- <properties>
- <title>YOUR LIBRARY NAME</title>
- </properties>
-
- <release version="0.1" date="unreleased">
- </release>
-</document>
-```
-* add `version.properties` to the top level directory of your antlib
- which must at least contain a definition of
- `artifact.version`. Something like
-```
-# 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
-#
-# https://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.
-artifact.version=0.1alpha
-```
-* if you want to use Ivy to manage your dependencies, add a file
- `ivy.xml` to the root directory of your antlib and set it up.
- A starting point may be
-```xml
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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
-
- https://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.
-
--->
-<ivy-module version="2.0">
- <info organisation="org.apache.ant"
- module="${artifact.name}"
- revision="${artifact.version}"
- publication="${artifact.publication.datetime}">
- <license name="Apache Software License 2.0"
- url="https://www.apache.org/licenses/LICENSE-2.0"/>
- <ivyauthor name="Apache Ant Development Team"
- url="https://ant.apache.org/"/>
- <description homepage="YOUR-ANTLIB_HOMEPAGE">
- YOUR_DESCRIPTION
- </description>
- </info>
- <configurations>
- <conf name="default" description="full antlib with all
dependencies"/>
- <conf name="provided" description="Ant must be present at runtime"/>
- <conf name="test" description="dependencies used for tests of
the antlib" transitive="false" visibility="private"/>
- </configurations>
- <publications xmlns:e="urn:ant.apache.org:ivy-extras">
- <artifact name="${artifact.name}" type="pom" ext="pom"/>
- <artifact name="${artifact.name}" type="pom.asc" ext="pom.asc"/>
- <artifact name="${artifact.name}" type="jar" ext="jar"/>
- <artifact name="${artifact.name}" type="jar.asc" ext="jar.asc"/>
- <artifact name="${artifact.name}" type="source" ext="jar"
- e:classifier="sources"/>
- <artifact name="${artifact.name}" type="source.asc" ext="jar.asc"
- e:classifier="sources"/>
- <artifact name="${artifact.name}" type="javadoc" ext="jar"
- e:classifier="javadoc"/>
- <artifact name="${artifact.name}" type="javadoc.asc" ext="jar.asc"
- e:classifier="javadoc"/>
- <artifact name="${artifact.name}" type="ivy" ext="xml"
- e:classifier="ivy"/>
- <artifact name="${artifact.name}" type="ivy.asc" ext="xml.asc"
- e:classifier="ivy"/>
- </publications>
- <dependencies>
- <dependency org="org.apache.ant" name="ant" rev="1.10.17"
conf="provided->default"/>
- </dependencies>
-</ivy-module>
-```
-* documentation should go to a `docs` directory, copy `style.css` from
- `common` to your `docs` directory if you want to use the commons
- styles.
* sources are expected to go to `src/main`, test sources to
`src/tests` (JUnit tests to `src/tests/junit`, AntUnit tests to
`src/tests/antunit`).
diff --git a/README.md b/seed-new-antlib.xml
similarity index 50%
copy from README.md
copy to seed-new-antlib.xml
index 83c4841..16ed945 100644
--- a/README.md
+++ b/seed-new-antlib.xml
@@ -1,29 +1,65 @@
-# Antlibs Common
-
-This is a skeleton to make development of Ant Libraries provided by
-the Apache Ant Project follow the same pattern.
-
-The repository is only mean to be included as git submodule into the
-actual Antlib. It provides common infrastructure using Apache Ant to
-build and Apache Ivy for dependency management.
-
-## Setting up a new Antlib Project
-
-* Create a new git repository via https://gitbox.apache.org/boxer/
-* Clone it locally
-* add this git repository as submodule named common to your new
- repository: `git submodule add
- https://gitbox.apache.org/repos/asf/ant-antlibs-common.git common`
-* copy `LICENSE`, `gitignore` and `.gitattributes` from `common` to
- the top level directory of your new antlib.
-* copy `NOTICE.template` from `common` to a file named `NOTICE` inside
- the top level directory of your new antlib and adapt its content
- (PRODUCT_NAME and copyright year.
-* add a minimal `build.xml` file to the top level directory of your
- project.
- Something like
-```xml
<?xml version="1.0"?>
+<!--
+ 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
+
+ https://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="seed-antlib" default="seed" basedir="..">
+
+ <target name="collect-data">
+ <tstamp>
+ <format property="seed.year" pattern="yyyy"/>
+ </tstamp>
+ <input message="Name of Antlib"
+ addproperty="seed.antlib.name"/>
+ <input message="Version of Antlib"
+ addproperty="seed.antlib.version"
+ defaultvalue="0.1"/>
+ <input message="Copyright Year"
+ addproperty="seed.antlib.year"
+ defaultvalue="${seed.year}"/>
+ <input message="First name of initial author"
+ addproperty="seed.author.firstname"/>
+ <input message="Last name of initial author"
+ addproperty="seed.author.lastname"/>
+ </target>
+
+ <target name="seed" depends="collect-data">
+ <copy todir=".">
+ <fileset dir="common" defaultexcludes="false">
+ <include name="LICENSE"/>
+ <include name=".gitattributes"/>
+ <include name=".gitignore"/>
+ <include name=".asf.yaml"/>
+ </fileset>
+ </copy>
+ <mkdir dir="src/main"/>
+ <mkdir dir="src/test"/>
+ <mkdir dir="docs"/>
+ <copy todir="docs">
+ <fileset dir="common">
+ <include name="style.css"/>
+ </fileset>
+ </copy>
+ <copy tofile="NOTICE" file="common/NOTICE.template">
+ <filterset begintoken="[" endtoken="]">
+ <filter token="yyyy" value="${seed.antlib.year}"/>
+ <filter token="PRODUCT_NAME"
+ value="${seed.antlib.name} Ant Library"/>
+ </filterset>
+ </copy>
+ <echo file="build.xml"><![CDATA[<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
@@ -42,36 +78,32 @@ KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
-<project default="compile" name="YOUR_ANTLIB_NAME">
+<project default="compile" name="${seed.antlib.name}">
<!-- easy way to override properties -->
<property file="build.properties"/>
<import file="common/build.xml"/>
</project>
-```
-* if there are any properties you want to override (you most likely
- will want to change `javac.-source` and `javac.-target`) create a
- `build.properties` file and add them.
-* create a more or less empty `contributors.xml` file to the top level
- directory of your antlib. Add yourself. The structure is
-```xml
-<?xml version="1.0" encoding="utf-8"?>
+]]></echo>
+ <echo file="contributors.xml"><![CDATA[<?xml version="1.0"?>
<!--
- 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
+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
- https://www.apache.org/licenses/LICENSE-2.0
+https://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.
+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.
-->
<!DOCTYPE contributors
[
@@ -89,30 +121,29 @@ under the License.
These are some of the many people who have helped with this Ant Library.
</introduction>
<name>
- <first>YOUR FIRST NAME</first>
- <last>YOUR LAST NAME</last>
+ <first>${seed.author.firstname}</first>
+ <last>${seed.author.lastname}</last>
</name>
</contributors>
-```
-* create a more or less empty `changes.xml` file to the top level
- directory of your antlib. The structure is
-```xml
-<?xml version="1.0" encoding="utf-8"?>
+]]></echo>
+ <echo file="changes.xml"><![CDATA[<?xml version="1.0"?>
<!--
- 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
+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
- https://www.apache.org/licenses/LICENSE-2.0
+https://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.
+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.
-->
<!DOCTYPE document
[
@@ -133,18 +164,14 @@ under the License.
>
<document>
<properties>
- <title>YOUR LIBRARY NAME</title>
+ <title>Apache ${seed.antlib.name} Ant Library</title>
</properties>
- <release version="0.1" date="unreleased">
+ <release version="${seed.antlib.version}" date="unreleased">
</release>
</document>
-```
-* add `version.properties` to the top level directory of your antlib
- which must at least contain a definition of
- `artifact.version`. Something like
-```
-# Licensed to the Apache Software Foundation (ASF) under one or more
+]]></echo>
+ <echo file="version.properties"># 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
@@ -158,15 +185,10 @@ under the License.
# 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.
-artifact.version=0.1alpha
-```
-* if you want to use Ivy to manage your dependencies, add a file
- `ivy.xml` to the root directory of your antlib and set it up.
- A starting point may be
-```xml
-<?xml version="1.0" encoding="UTF-8"?>
+artifact.version=${seed.antlib.version}alpha
+</echo>
+ <echo file="ivy.xml"><![CDATA[<?xml version="1.0"?>
<!--
-
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.
@@ -185,54 +207,44 @@ artifact.version=0.1alpha
-->
<ivy-module version="2.0">
<info organisation="org.apache.ant"
- module="${artifact.name}"
- revision="${artifact.version}"
- publication="${artifact.publication.datetime}">
+ module="$${artifact.name}"
+ revision="$${artifact.version}"
+ publication="$${artifact.publication.datetime}">
<license name="Apache Software License 2.0"
url="https://www.apache.org/licenses/LICENSE-2.0"/>
<ivyauthor name="Apache Ant Development Team"
url="https://ant.apache.org/"/>
- <description homepage="YOUR-ANTLIB_HOMEPAGE">
- YOUR_DESCRIPTION
+ <description
homepage="https://ant.apache.org/antlibs/${seed.antlib.name}/">
+ Apache ${seed.antlib.name} Ant Library
</description>
</info>
<configurations>
- <conf name="default" description="full antlib with all
dependencies"/>
- <conf name="provided" description="Ant must be present at runtime"/>
- <conf name="test" description="dependencies used for tests of
the antlib" transitive="false" visibility="private"/>
+ <conf name="default" description="full antlib with all dependencies"/>
+ <conf name="provided" description="Ant must be present at runtime"/>
+ <conf name="test" description="dependencies used for tests of the antlib"
transitive="false" visibility="private"/>
</configurations>
<publications xmlns:e="urn:ant.apache.org:ivy-extras">
- <artifact name="${artifact.name}" type="pom" ext="pom"/>
- <artifact name="${artifact.name}" type="pom.asc" ext="pom.asc"/>
- <artifact name="${artifact.name}" type="jar" ext="jar"/>
- <artifact name="${artifact.name}" type="jar.asc" ext="jar.asc"/>
- <artifact name="${artifact.name}" type="source" ext="jar"
+ <artifact name="$${artifact.name}" type="pom" ext="pom"/>
+ <artifact name="$${artifact.name}" type="pom.asc" ext="pom.asc"/>
+ <artifact name="$${artifact.name}" type="jar" ext="jar"/>
+ <artifact name="$${artifact.name}" type="jar.asc" ext="jar.asc"/>
+ <artifact name="$${artifact.name}" type="source" ext="jar"
e:classifier="sources"/>
- <artifact name="${artifact.name}" type="source.asc" ext="jar.asc"
+ <artifact name="$${artifact.name}" type="source.asc" ext="jar.asc"
e:classifier="sources"/>
- <artifact name="${artifact.name}" type="javadoc" ext="jar"
+ <artifact name="$${artifact.name}" type="javadoc" ext="jar"
e:classifier="javadoc"/>
- <artifact name="${artifact.name}" type="javadoc.asc" ext="jar.asc"
+ <artifact name="$${artifact.name}" type="javadoc.asc" ext="jar.asc"
e:classifier="javadoc"/>
- <artifact name="${artifact.name}" type="ivy" ext="xml"
+ <artifact name="$${artifact.name}" type="ivy" ext="xml"
e:classifier="ivy"/>
- <artifact name="${artifact.name}" type="ivy.asc" ext="xml.asc"
+ <artifact name="$${artifact.name}" type="ivy.asc" ext="xml.asc"
e:classifier="ivy"/>
</publications>
<dependencies>
<dependency org="org.apache.ant" name="ant" rev="1.10.17"
conf="provided->default"/>
</dependencies>
</ivy-module>
-```
-* documentation should go to a `docs` directory, copy `style.css` from
- `common` to your `docs` directory if you want to use the commons
- styles.
-* sources are expected to go to `src/main`, test sources to
- `src/tests` (JUnit tests to `src/tests/junit`, AntUnit tests to
- `src/tests/antunit`).
-* if you want to set up a Jenkins build you can copy and adapt the
- `prepare.xml` file from `common` to the root directory of your
- antlib.
-* once you want to publish your antlib, you'll likely need a
- `project-template.pom` like
-
https://github.com/apache/ant-antlibs-compress/blob/master/project-template.pom
+]]></echo>
+ </target>
+</project>