1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213
|
<?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
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.
-->
<!--
This file was modified from the Apache Cayenne project's build system
to suit the needs of the Jython project's build system.
-->
<!-- ================================================= -->
<!-- Maven Bundle Buildfile -->
<!-- ================================================= -->
<project name="jython-maven" default="bundle-all" basedir="..">
<property file="${user.home}/ant.properties" />
<property file="${basedir}/default.properties"/>
<property name="project.version" value="2.5.3-SNAPSHOT"/>
<property name="m2.repo" value="${user.home}/.m2/repository"/>
<property name="m2.groupDir" value="org/python"/>
<property name="build.base" value="${basedir}/build"/>
<property name="build.dir" value="${build.base}/maven"/>
<property name="dist.base" value="${basedir}/dist"/>
<property name="src.dir" value="${basedir}/src"/>
<condition property="do.build">
<not>
<and>
<available file="${dist.base}/jython.jar"/>
<available file="${dist.base}/jython-standalone.jar"/>
<available file="${dist.base}/jython-installer.jar"/>
</and>
</not>
</condition>
<target name="install" depends="prep">
<m2-install artifactId="jython"/>
</target>
<target name="install-standalone" depends="prep">
<m2-install artifactId="jython-standalone"/>
</target>
<target name="bundle" depends="prep">
<m2-bundle artifactId="jython"/>
</target>
<target name="bundle-standalone" depends="prep">
<m2-bundle artifactId="jython-standalone"/>
</target>
<target name="bundle-installer" depends="prep">
<m2-bundle artifactId="jython-installer"/>
</target>
<target name="install-all" depends="install, install-standalone"/>
<target name="bundle-all" depends="bundle, bundle-installer, bundle-standalone"/>
<target name="clean">
<delete dir="${build.dir}"/>
<delete>
<fileset dir="${dist.base}" includes="*-bundle.jar"/>
</delete>
</target>
<!--
Installs artifact to the local repo specified.
-->
<macrodef name="m2-install">
<attribute name="artifactId"/>
<attribute name="install.dir"
default="${m2.repo}/${m2.groupDir}/@{artifactId}/${project.version}"/>
<attribute name="install.name"
default="@{artifactId}-${project.version}"/>
<sequential>
<stage artifactId="@{artifactId}"/>
<mkdir dir="@{install.dir}"/>
<copy file="maven/pom-template.xml"
tofile="@{install.dir}/@{install.name}.pom">
<filterset>
<filter token="PROJECT-VERSION" value="${project.version}"/>
<filter token="ARTIFACT-ID" value="@{artifactId}"/>
</filterset>
</copy>
<move file="${build.dir}/@{install.name}.jar"
tofile="@{install.dir}/@{install.name}.jar"/>
<move file="${build.dir}/@{install.name}-sources.jar"
tofile="@{install.dir}/@{install.name}-sources.jar"/>
<checksum algorithm="SHA1" fileext=".sha1">
<fileset dir="@{install.dir}" excludes="*.sha1,*.md5,*.tmp"/>
</checksum>
<checksum algorithm="MD5" fileext=".md5">
<fileset dir="@{install.dir}" excludes="*.sha1,*.md5,*.tmp"/>
</checksum>
</sequential>
</macrodef>
<!--
Bundles staged artifact to release to ibiblio
-->
<macrodef name="m2-bundle">
<attribute name="artifactId"/>
<sequential>
<stage artifactId="@{artifactId}"/>
<jar jarfile="${dist.base}/@{artifactId}-${project.version}-bundle.jar">
<fileset dir="${build.dir}"/>
</jar>
</sequential>
</macrodef>
<!--
Performs Maven build staging
-->
<macrodef name="stage">
<attribute name="artifactId"/>
<sequential>
<delete dir="${build.dir}"/>
<mkdir dir="${build.dir}"/>
<copy file="maven/pom-template.xml"
tofile="${build.dir}/@{artifactId}-${project.version}.pom">
<filterset>
<filter token="PROJECT-VERSION" value="${project.version}"/>
<filter token="ARTIFACT-ID" value="@{artifactId}"/>
</filterset>
</copy>
<!-- XXX: License is already in the jars and maven central is
rejecting this in the bundle - investigate.
<copy file="LICENSE.txt" tofile="${build.dir}/LICENSE.txt"/>
-->
<copy file="${dist.base}/@{artifactId}.jar"
tofile="${build.dir}/@{artifactId}-${project.version}.jar"/>
<copy file="dist/sources.jar" tofile="${build.dir}/@{artifactId}-${project.version}-sources.jar"/>
<copy file="dist/javadoc.jar" tofile="${build.dir}/@{artifactId}-${project.version}-javadoc.jar"/>
<!-- TODO: make the gpg sign step optional -->
<exec executable="gpg">
<arg value="-ab"/>
<arg value="${build.dir}/@{artifactId}-${project.version}.jar"/>
</exec>
<exec executable="gpg">
<arg value="-ab"/>
<arg value="${build.dir}/@{artifactId}-${project.version}-javadoc.jar"/>
</exec>
<exec executable="gpg">
<arg value="-ab"/>
<arg value="${build.dir}/@{artifactId}-${project.version}.pom"/>
</exec>
<exec executable="gpg">
<arg value="-ab"/>
<arg value="${build.dir}/@{artifactId}-${project.version}-sources.jar"/>
</exec>
</sequential>
</macrodef>
<!--
Performs POM Schema validation.
-->
<target name="validate-pom">
<xmlvalidate failonerror="true" file="maven/pom-template.xml">
<attribute name="http://xml.org/sax/features/validation"
value="true"/>
<attribute name="http://apache.org/xml/features/validation/schema"
value="true"/>
<attribute name="http://xml.org/sax/features/namespaces"
value="true"/>
<property
name="http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation"
value="maven/maven-v4_0_0.xsd"/>
</xmlvalidate>
</target>
<target name="build-jython" if="do.build">
<ant antfile="build.xml" target="all-jars"/>
</target>
<target name="prep" depends="build-jython, validate-pom"/>
</project>
|