Skip to content
Browse files

Project is now also compilable using ANT

  • Loading branch information...
1 parent f9d6a62 commit 74d6195054aee4c60ae49a665881a09ea0cce2a5 @quintesse quintesse committed Jan 16, 2012
Showing with 231 additions and 1 deletion.
  1. +12 −0 .classpath
  2. +1 −1 .gitignore
  3. +17 −0 .project
  4. +16 −0 build.properties
  5. +185 −0 build.xml
  6. BIN lib/junit-4.9b2.jar
  7. BIN lib/sardine-314.jar
View
12 .classpath
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="api/src/main/java"/>
+ <classpathentry kind="src" path="impl/src/main/java"/>
+ <classpathentry kind="src" path="impl/src/test/java"/>
+ <classpathentry kind="src" path="spi/src/main/java"/>
+ <classpathentry kind="src" path="webdav/src/main/java"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
+ <classpathentry kind="lib" path="lib/sardine-314.jar"/>
+ <classpathentry kind="output" path="build/classes"/>
+</classpath>
View
2 .gitignore
@@ -7,4 +7,4 @@ spi/target/
api/target/
impl/target/
webdav/target/
-
+build/
View
17 .project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>ceylon-module-resolver</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
View
16 build.properties
@@ -0,0 +1,16 @@
+# ----- Version Control Flags -----
+module.module-resolver.version=0.1
+
+base.path=${basedir}/lib
+
+# ----- Sardine WebDav lib ---
+sardine.version=314
+sardine.jar=sardine-${sardine.version}.jar
+sardine.url=http://sardine.googlecode.com/files/sardine-${sardine.version}.zip
+sardine.lib=${base.path}/${sardine.jar}
+
+# ----- JUnit Unit Test Suite, version 4.9 or later ---
+junit.version=4.9b2
+junit.jar=junit-${junit.version}.jar
+junit.url=http://cloud.github.com/downloads/KentBeck/junit/junit${junit.version}.zip
+junit.lib=${base.path}/${junit.jar}
View
185 build.xml
@@ -0,0 +1,185 @@
+<project name="Ceylon module-resolver module" default="publish" basedir=".">
+ <property file="build.properties"/>
+
+ <!-- Set build directories for all formats. -->
+ <property name="build.dir" value="${basedir}/build"/>
+ <property name="build.classes" location="${build.dir}/classes"/>
+ <property name="build.dist" location="${build.dir}/dist"/>
+ <property name="build.lib" location="${build.dir}/lib"/>
+ <property name="build.test" location="${build.dir}/test"/>
+ <property name="test.reports" location="${build.dir}/test-reports"/>
+
+ <!-- The Java source files for the module-resolver -->
+ <property name="cmr-api.src" location="${basedir}/api/src/main/java"/>
+ <property name="cmr-impl.src" location="${basedir}/impl/src/main/java"/>
+ <property name="cmr-spi.src" location="${basedir}/spi/src/main/java"/>
+ <property name="cmr-webdav.src" location="${basedir}/webdav/src/main/java"/>
+
+ <!-- jar generated -->
+ <property name="module-resolver.jar" location="${build.lib}/module-resolver.jar"/>
+
+ <property name="cmr-impl-test.src" location="${basedir}/impl/src/test/java"/>
+
+ <tstamp/>
+
+ <!-- Local repository -->
+ <property name="ceylon.repo.dir" location="${user.home}/.ceylon/repo"/>
+
+ <!-- ceylon.module-resolver -->
+ <property name="module.module-resolver.dir" value="com/redhat/ceylon/module-resolver"/>
+ <property name="module.module-resolver.name" value="com.redhat.ceylon.module-resolver"/>
+
+ <!-- module archives -->
+ <property name="ceylon.module-resolver.dir" value="${module.module-resolver.dir}/${module.module-resolver.version}"/>
+ <property name="ceylon.module-resolver.src" value="${ceylon.module-resolver.dir}/${module.module-resolver.name}-${module.module-resolver.version}.src"/>
+ <property name="ceylon.module-resolver.jar" value="${ceylon.module-resolver.dir}/${module.module-resolver.name}-${module.module-resolver.version}.jar"/>
+ <property name="ceylon.module-resolver.repo" value="${ceylon.repo.dir}/${ceylon.module-resolver.dir}"/>
+ <property name="ceylon.module-resolver.dist" value="${build.dist}/${ceylon.module-resolver.dir}"/>
+
+ <path id="compiler.classpath">
+ <pathelement path="${sardine.lib}"/>
+ </path>
+
+ <path id="test.build.classpath">
+ <path refid="compiler.classpath"/>
+ <pathelement path="${build.classes}"/>
+ <pathelement path="${junit.lib}"/>
+ </path>
+
+ <path id="test.run.classpath">
+ <path refid="test.build.classpath"/>
+ <pathelement path="${build.test}"/>
+ </path>
+
+ <!-- ################################################################## -->
+ <!-- constant to declare a file binary for checksumsum -->
+ <property name="checksum.binary-prefix" value=" *" />
+ <!-- Helper target, used to create a sha1 checksum file -->
+ <!-- Requires 'file' as a parameter. -->
+ <target name="sha1sum">
+ <fail unless="file"/>
+ <fail if="filename"/>
+ <fail if="value"/>
+ <basename file="${file}" property="filename"/>
+ <checksum file="${file}" property="value" algorithm="sha1"/>
+ <echo file="${file}.sha1" message="${value}"/>
+ </target>
+
+ <!-- Rule to clean everything up -->
+ <target name="clean" description="Clean up everything">
+ <delete dir="${build.dir}"/>
+ </target>
+
+ <target name="dist"
+ depends="build"
+ description="Create Ceylon module-resolver distribution">
+ <mkdir dir="${ceylon.module-resolver.dist}"/>
+ <zip destfile="${build.dist}/${ceylon.module-resolver.src}">
+ <fileset dir="${cmr-api.src}">
+ <include name="**/*.java"/>
+ </fileset>
+ <fileset dir="${cmr-impl.src}">
+ <include name="**/*.java"/>
+ </fileset>
+ <fileset dir="${cmr-spi.src}">
+ <include name="**/*.java"/>
+ </fileset>
+ <fileset dir="${cmr-webdav.src}">
+ <include name="**/*.java"/>
+ </fileset>
+ </zip>
+ <antcall target="sha1sum">
+ <param name="file" value="${build.dist}/${ceylon.module-resolver.src}" />
+ </antcall>
+ <copy file="${module-resolver.jar}" tofile="${build.dist}/${ceylon.module-resolver.jar}"/>
+ <antcall target="sha1sum">
+ <param name="file" value="${build.dist}/${ceylon.module-resolver.jar}" />
+ </antcall>
+ </target>
+
+ <!-- Repository targets -->
+ <target name="publish"
+ depends="dist,clean.repo,init.repo"
+ description="Publish Ceylon module-resolver module to default repo">
+ <copy todir="${ceylon.module-resolver.repo}">
+ <fileset dir="${ceylon.module-resolver.dist}"/>
+ </copy>
+ </target>
+
+ <target name="init.repo"
+ description="Create default local Ceylon module repository">
+ <mkdir dir="${ceylon.module-resolver.repo}"/>
+ </target>
+
+ <target name="clean.repo"
+ description="Clean default local Ceylon module repository">
+ <delete dir="${ceylon.module-resolver.repo}"/>
+ </target>
+
+ <!-- Tasks related to building the module-resolver -->
+ <!-- Rule to build module-resolver classes from their Java sources -->
+ <target name="module-resolver.classes" >
+ <mkdir dir="${build.classes}"/>
+ <javac debug="true"
+ srcdir="${cmr-spi.src}"
+ destdir="${build.classes}"
+ classpathref="compiler.classpath"
+ includeantruntime="false"/>
+ <javac debug="true"
+ srcdir="${cmr-api.src}"
+ destdir="${build.classes}"
+ classpathref="compiler.classpath"
+ includeantruntime="false"/>
+ <javac debug="true"
+ srcdir="${cmr-impl.src}"
+ destdir="${build.classes}"
+ classpathref="compiler.classpath"
+ includeantruntime="false"/>
+ <javac debug="true"
+ srcdir="${cmr-webdav.src}"
+ destdir="${build.classes}"
+ classpathref="compiler.classpath"
+ includeantruntime="false"/>
+ </target>
+
+ <!-- Rule to build module-resolver jar -->
+ <target name="module-resolver.jar" depends="module-resolver.classes">
+ <mkdir dir="${build.lib}"/>
+ <jar destfile="${module-resolver.jar}">
+ <fileset dir="${build.classes}">
+ </fileset>
+ </jar>
+ </target>
+
+ <!-- Rule to compile and test -->
+ <target name="build" depends="module-resolver.jar"/>
+
+ <target name="compile.tests" depends="build">
+ <mkdir dir="${build.test}"/>
+ <javac debug="true"
+ srcdir="${cmr-impl-test.src}"
+ destdir="${build.test}"
+ classpathref="test.build.classpath"
+ includeantruntime="false"/>
+ </target>
+
+ <target name="test" depends="compile.tests" description="Runs the JUnit tests">
+ <mkdir dir="${test.reports}"/>
+ <junit printsummary="yes" haltonfailure="no">
+ <classpath refid="test.run.classpath"/>
+ <formatter type="xml"/>
+ <batchtest fork="yes" todir="${test.reports}">
+ <fileset dir="${cmr-impl-test.src}">
+ <include name="**/*TestCase.java"/>
+ </fileset>
+ </batchtest>
+ </junit>
+
+ <junitreport todir="${test.reports}">
+ <fileset dir="${test.reports}">
+ <include name="TEST-*.xml"/>
+ </fileset>
+ <report format="frames" todir="${test.reports}"/>
+ </junitreport>
+ </target>
+</project>
View
BIN lib/junit-4.9b2.jar
Binary file not shown.
View
BIN lib/sardine-314.jar
Binary file not shown.

0 comments on commit 74d6195

Please sign in to comment.
Something went wrong with that request. Please try again.