All Downloads are FREE. Search and download functionalities are using the official Maven repository.

maven.build.xml Maven / Gradle / Ivy

Go to download

Jython is an implementation of the high-level, dynamic, object-oriented language Python written in 100% Pure Java, and seamlessly integrated with the Java platform. It thus allows you to run Python on any Java platform.

There is a newer version: 2.7.4
Show newest version
<?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"/>
      </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="install-all" depends="install, install-standalone"/>

  <target name="bundle-all" depends="bundle, 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>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy