Permalink
Browse files

Getting rid of Ant

  • Loading branch information...
szegedi committed Sep 14, 2010
1 parent 1e7dcf1 commit 3cb6744cd90d9b6a9a6140aadb18f8be178424f1
Showing with 0 additions and 480 deletions.
  1. +0 −71 ant/bootstrap.xml
  2. +0 −20 ant/clean.xml
  3. +0 −111 ant/compile.xml
  4. +0 −35 ant/docs.xml
  5. +0 −126 ant/package.xml
  6. +0 −55 ant/prepare.xml
  7. +0 −56 ant/test.xml
  8. +0 −6 build.xml
View
@@ -1,71 +0,0 @@
-<project xmlns:ivy="antlib:org.apache.ivy.ant">
-
- <!-- defaults for all projects -->
- <property name="source.dir" value="${basedir}/src/main" />
- <property name="test.source.dir" value="${basedir}/src/test" />
- <property name="target.dir" value="${basedir}/target" />
-
- <property environment="env" />
-
- <property name="ivy.install.version" value="2.1.0" />
- <property name="ivy.jar.dir" value="${user.home}/.ivy2" />
- <property name="ivy.jar.file" value="${ivy.jar.dir}/ivy-${ivy.install.version}.jar" />
- <property name="jsch.install.version" value="0.1.29" />
- <property name="jsch.jar.file" value="${ivy.jar.dir}/jsch-${jsch.install.version}.jar" />
-
- <!--
- download ivy from the web site so that it can be used without being
- installed. if the file has already been downloaded, we use a rename
- trick to avoid hitting the website again. (that would be annoying
- when building offline.)
- -->
- <target name="download-ivy" unless="skip.download">
- <mkdir dir="${ivy.jar.dir}"/>
- <condition property="ivy.url" value="file:${ivy.jar.file}">
- <available file="${ivy.jar.file}" />
- </condition>
- <property name="ivy.url" value="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" />
- <get src="${ivy.url}" dest="${ivy.jar.file}.download" usetimestamp="true" />
- <move file="${ivy.jar.file}.download" tofile="${ivy.jar.file}" />
-
- <condition property="jsch.url" value="file:${jsch.jar.file}">
- <available file="${jsch.jar.file}" />
- </condition>
- <property name="jsch.url" value="http://repo1.maven.org/maven2/jsch/jsch/${jsch.install.version}/jsch-${jsch.install.version}.jar" />
- <get src="${jsch.url}" dest="${jsch.jar.file}.download" usetimestamp="true" />
- <move file="${jsch.jar.file}.download" tofile="${jsch.jar.file}" />
- </target>
-
- <!-- import ivy's ant tasks -->
- <target name="install-ivy" depends="download-ivy">
- <path id="ivy.lib.path">
- <fileset dir="${ivy.jar.dir}" includes="ivy-${ivy.install.version}.jar jsch-${jsch.install.version}.jar"/>
- </path>
- <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path" />
- </target>
-
- <!-- define filename-friendly names for the OS variants -->
- <condition property="os.libsname" value="osx">
- <os name="Mac OS X" />
- </condition>
- <condition property="os.jni.ext" value="jnilib">
- <os name="Mac OS X" />
- </condition>
- <condition property="os.libsname" value="linux">
- <os name="Linux" />
- </condition>
- <condition property="os.jni.ext" value="so">
- <os name="Linux" />
- </condition>
-
- <!-- where to look for the ivy config -->
- <property name="ivy.dep.file" value="${basedir}/ivy/ivy.xml" />
- <property name="ivy.settings.file" value="${basedir}/ivy/ivysettings.xml" />
-
- <import file="clean.xml" />
- <import file="prepare.xml" />
- <import file="compile.xml" />
- <import file="test.xml" />
- <import file="docs.xml" />
- <import file="package.xml" />
-</project>
View
@@ -1,20 +0,0 @@
-<project xmlns:ivy="antlib:org.apache.ivy.ant">
-
- <target name="clean" depends="init" description="erase built files and targets">
- <delete dir="${target.dir}" />
- <delete dir="${dist.dir}" />
- <!-- i dont think this is really a good idea: -->
- <!-- delete dir="${ivy.jar.dir}/cache/${ivy.organisation}" /-->
- </target>
-
- <target name="clean-ivy" depends="prepare" description="erase ivy cache of downloaded packages">
- <ivy:cleancache />
- </target>
-
- <target name="clean-jni" depends="prepare" description="clean out any built jni targets" if="build.jni">
- <ant dir="src/main/jni" target="clean" />
- </target>
-
- <target name="distclean" depends="clean, clean-jni, clean-ivy" />
-
-</project>
View
@@ -1,111 +0,0 @@
-<project xmlns:ivy="antlib:org.apache.ivy.ant">
-
- <!-- compile old-skool java -->
-
- <target name="compile-java" if="build.java">
- <javac srcdir="${source.dir}/java" destdir="${target.dir}/classes">
- <classpath>
- <path refid="deps.path" />
- </classpath>
- <include name="**/*.java" />
- </javac>
- </target>
-
-
- <!-- compile scala -->
-
- <target name="compile-scala" if="build.scala">
- <scalac srcdir="${source.dir}/scala" destdir="${target.dir}/classes" force="changed">
- <classpath>
- <path refid="deps.path" />
- </classpath>
- <include name="**/*.scala" />
- </scalac>
- </target>
-
-
- <!-- create properties file with build info -->
-
- <target name="find-git-revision" unless="no.git">
- <!-- ask git for the current "head" commit-id, for memoizing inside the built jar -->
- <exec outputproperty="revision" executable="git" failifexecutionfails="false">
- <arg value="rev-parse" />
- <arg value="HEAD" />
- </exec>
- <exec executable="git" failifexecutionfails="false">
- <arg value="rev-parse" />
- <arg value="HEAD" />
- <redirector outputproperty="revision-short">
- <outputfilterchain>
- <tokenfilter>
- <filetokenizer />
- <replaceregex pattern="(.{8}).*" replace="\1"/>
- </tokenfilter>
- </outputfilterchain>
- </redirector>
- </exec>
- </target>
-
- <target name="write-build-info" depends="init, find-git-revision" if="ivy.extra.buildpackage">
- <tstamp>
- <format property="build.timestamp.time" pattern="yyyyMMdd-HHmmss" />
- <format property="build.timestamp.date" pattern="yyyyMMdd" />
- </tstamp>
- <pathconvert property="build.properties.path">
- <path location="${ivy.extra.buildpackage}" />
- <unpackagemapper from="${basedir}/*" to="${target.dir}/classes/*" />
- </pathconvert>
- <propertyfile file="${build.properties.path}/build.properties">
- <entry key="name" value="${ivy.module}" />
- <entry key="version" value="${ivy.revision}" />
- <entry key="build_name" value="${build.timestamp.time}" />
- <entry key="build_revision" value="${revision}" />
- </propertyfile>
- </target>
-
-
- <!-- copy resources needed by tests and jar -->
-
- <target name="copy-resources">
- <copy todir="${dist.dir}/libs" flatten="true">
- <path refid="deps.path" />
- </copy>
- <copy todir="${target.dir}/test-classes/" failonerror="false">
- <fileset dir="${test.source.dir}/resources" />
- </copy>
- <copy todir="${target.dir}/classes/" overwrite="true" failonerror="false">
- <fileset dir="${source.dir}/resources" />
- </copy>
- </target>
-
- <target name="copy-config" if="copy.config">
- <copy todir="${dist.dir}/config">
- <fileset dir="${basedir}/config" />
- </copy>
- </target>
-
- <target name="copy-extra-config" if="config.extra">
- <copy todir="${dist.dir}/config">
- <fileset dir="${config.extra}" />
- </copy>
- </target>
-
- <target name="copy-extra-libs" if="libs.extra">
- <copy todir="${dist.dir}/libs">
- <path refid="libs.extra" />
- </copy>
- </target>
-
- <target name="copy-extra-dist" if="dist.extra">
- <copy todir="${dist.dir}">
- <path refid="dist.extra" />
- </copy>
- </target>
-
- <target name="copy-extra" depends="copy-resources, copy-config, copy-extra-config, copy-extra-libs, copy-extra-dist" />
-
-
- <target name="compile" depends="prepare, find-source, compile-java, compile-scala, write-build-info, copy-extra"
- description="compile java and scala code" />
-
-</project>
View
@@ -1,35 +0,0 @@
-<project xmlns:ivy="antlib:org.apache.ivy.ant">
-
- <target name="vscaladoc" depends="prepare" unless="skip.docs">
- <delete dir="${docs.target.dir}/scaladoc" />
- <mkdir dir="${docs.target.dir}/scaladoc" />
- <pathconvert property="doc.sources" pathsep=" ">
- <fileset dir="${source.dir}" includes="**/*.scala" />
- </pathconvert>
- <path id="docs.path">
- <path refid="bootstrap.path" />
- <pathelement location="${target.dir}/classes" />
- </path>
- <echo message="Building vscaladoc..." />
- <java classname="org.scala_tools.vscaladoc.Main" fork="true" failonerror="true">
- <classpath>
- <path refid="bootstrap.path" />
- </classpath>
- <arg value="-classpath" />
- <arg pathref="docs.path" />
- <arg value="-d" />
- <arg value="${docs.target.dir}/scaladoc" />
- <arg value="-sourcepath" />
- <arg value="${source.dir}/scala" />
- <arg value="-windowtitle" />
- <arg value="${ivy.module} ${ivy.revision}" />
- <arg value="-doctitle" />
- <arg value="${ivy.module} ${ivy.revision}" />
- <arg value="-linksource" />
- <arg line="${doc.sources}" />
- </java>
- </target>
-
- <target name="docs" depends="prepare,vscaladoc" unless="skip.docs" description="build source documentation" />
-
-</project>
View
@@ -1,126 +0,0 @@
-<project xmlns:ivy="antlib:org.apache.ivy.ant">
-
- <!-- unzip all the dependent jars into target/ so that the final jar will depend on nothing. kinda evil. -->
- <target name="pack-deps" if="pack.deps">
- <pathconvert pathsep="," property="deps.path.list">
- <path refid="deps.path" />
- <map from="/" to="" />
- </pathconvert>
- <unzip dest="${target.dir}/classes">
- <fileset dir="/" includes="${deps.path.list}" />
- </unzip>
- <delete dir="${target.dir}/classes/META-INF" />
- </target>
-
- <target name="make-non-executable-jar" unless="ivy.extra.jarclassname" depends="pack-deps">
- <jar destfile="${dist.dir}/${jar.name}.jar">
- <fileset dir="${target.dir}/classes" />
- </jar>
- </target>
-
- <!-- generate a jar that contains all deps inside it, so it can be run with "java -jar" -->
- <target name="make-executable-jar" if="ivy.extra.jarclassname" depends="copy-extra,pack-deps">
- <pathconvert refid="deps.path" pathsep=" " property="deps.path.jar-format">
- <chainedmapper>
- <flattenmapper />
- <globmapper from="*" to="libs/*" />
- </chainedmapper>
- </pathconvert>
- <jar destfile="${dist.dir}/${jar.name}.jar">
- <fileset dir="${target.dir}/classes" />
- <manifest>
- <attribute name="Main-Class" value="${ivy.extra.jarclassname}" />
- <attribute name="Class-Path" value="${deps.path.jar-format}" />
- </manifest>
- </jar>
- </target>
-
- <target name="generate-scripts" depends="prepare" if="generate.scripts">
- <pathconvert refid="deps.path" property="classpath" />
- <pathconvert refid="test.path" property="test.classpath" />
- <pathconvert refid="deps.path" property="deps.path.dist-format">
- <chainedmapper>
- <flattenmapper />
- <globmapper from="*" to="$${DIST_HOME}/libs/*" />
- </chainedmapper>
- </pathconvert>
-
- <!-- delete dir="${basedir}/target/scripts" /-->
- <mkdir dir="${dist.dir}/scripts" />
- <copy todir="${dist.dir}/scripts" overwrite="true">
- <fileset dir="${basedir}/src/scripts" />
- <filterset>
- <filter token="CLASSPATH" value="${classpath}:${target.dir}/classes" />
- <filter token="TEST_CLASSPATH" value="${test.classpath}:${target.dir}/classes:${target.dir}/test-classes" />
- <filter token="DIST_CLASSPATH" value="${deps.path.dist-format}:$${DIST_HOME}/${jar.name}.jar" />
- <filter token="TARGET" value="${target.dir}" />
- <filter token="DIST_NAME" value="${dist.name}" />
- </filterset>
- </copy>
- <copy todir="${dist.dir}/scripts" overwrite="true" failonerror="false">
- <fileset dir="${target.dir}/gen-rb" />
- </copy>
- <chmod dir="${dist.dir}/scripts" includes="*" perm="ugo+x" />
- </target>
-
- <target name="package" depends="test, make-non-executable-jar, make-executable-jar,
- generate-scripts, docs" description="build complete jar(s) and docs">
- <ivy:makepom ivyfile="${basedir}/ivy/ivy.xml" pomfile="${dist.dir}/${dist.name}.pom">
- <mapping conf="*" scope="runtime" />
- <mapping conf="bootstrap" scope="compile" />
- <mapping conf="test" scope="compile" />
- </ivy:makepom>
- <ivy:deliver conf="*(public)" />
- <condition property="dist.tarball.name"
- value="${ivy.module}-${revision-short}.tar.bz2"
- else="${dist.name}.tar.bz2">
- <isset property="dist.build_integration" />
- </condition>
- <tar destfile="${basedir}/dist/${dist.tarball.name}"
- basedir="${basedir}/dist" compression="bzip2">
- <include name="${dist.name}/${jar.name}.jar" />
- <include name="${dist.name}/*.so" />
- <include name="${dist.name}/*.jnilib" />
- <include name="${dist.name}/libs/**" />
- <include name="${dist.name}/config/**" />
- <tarfileset dir="${basedir}/dist" mode="755">
- <include name="${dist.name}/scripts/**" />
- </tarfileset>
- </tar>
- <ivy:publish resolver="local" overwrite="true">
- <artifacts pattern="${dist.dir}/[artifact]-[revision].[ext]" />
- </ivy:publish>
- </target>
-
- <target name="jars" depends="package" />
-
- <target name="dist" depends="package" description="create a source distribution zipfile">
- <copy todir="${dist.dir}" failonerror="false">
- <fileset dir="${basedir}" includes="INSTALL* LICENSE* README* build.xml" />
- </copy>
- <copy todir="${dist.dir}/src">
- <fileset dir="src" />
- </copy>
- <copy todir="${dist.dir}/ivy">
- <fileset dir="ivy" />
- </copy>
- <copy todir="${dist.dir}/ant">
- <fileset dir="ant" />
- </copy>
- <zip destfile="${basedir}/dist/${ivy.module}-${ivy.revision}-src.zip"
- basedir="${basedir}/dist"
- includes="${ivy.module}-${ivy.revision}/**"
- excludes="${ivy.module}-${ivy.revision}/libs/** ${ivy.module}-${ivy.revision}/*.jar" />
- </target>
-
- <target name="push" depends="package" description="push built jar(s) to the repository">
- <condition property="pubrevision"
- value="${ivy.revision}-${build.timestamp.date}-${revision-short}"
- else="${ivy.revision}">
- <isset property="push.build_name" />
- </condition>
- <ivy:publish resolver="push" overwrite="true" pubrevision="${pubrevision}" update="true">
- <artifacts pattern="${dist.dir}/[artifact]-${ivy.revision}.[ext]" />
- </ivy:publish>
- </target>
-</project>
Oops, something went wrong.

0 comments on commit 3cb6744

Please sign in to comment.