Here's a decent start for an ant build.  If anyone is interested in helping
flesh out this build file more, let's start up a github project/node and
crank it out.

Note: This will compile a lift project (I only tested with an archetype),
but not package or anything else.

-Josh



On Fri, Apr 17, 2009 at 7:14 AM, Josh Suereth <joshua.suer...@gmail.com>wrote:

>
>
> On Thu, Apr 16, 2009 at 10:40 PM, Sean Reque <seanre...@gmail.com> wrote:
>
>>
>> I am a newcomer to Scala and Lift, and I plan on trying to figure out
>> how to use either Buildr or Raven, to run Lift, and if I can
>> successfully do so I will try to share my work. If I cannot, I will
>> probably stop pursuing Lift and start looking at other areas of Scala.
>> I say this simply to state you will drive many potential users of Lift
>> away by enforcing the use of Maven without even giving sufficient
>> documentation to allow other build tools to be used. I cannot see any
>> productivity gain from any web framework over other existing
>> competitors that could offset the productivity loss from using Maven.
>>
>
>
> Wow, strong words.  I'm wondering what it was about maven that caused this
> productivity loss?  So far my shop has not run into this, in fact, we've had
> the opposite vs. Ant.  Granted, Raven and Buildr are different beasts.
>
> I posted a blog article earlier on how to use the scala maven
> infrastructure + the maven-ant-tasks to bootstrap a scala project.  I think
> the same would be possible if you wanted to use Lift with ant, and (AFAIK)
> easier in Buildr or Raven (as I believe they support Ivy/Maven repo
> materialization directly).  Perhaps I'll spend some time and make an ant
> file that you can raven-ify or buildr-ize.  What would you need to be able
> to get Buildr or Raven up and working?
>
>
> In the meantime, if maven is keeping you from contributing/working with
> lift, then that's your loss.
>
>
> -Josh
>
>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

<?xml version="1.0" encoding="UTF-8"?>
<project name="lift-ant-starter" default="package"  xmlns:artifact="urn:maven-artifact-ant">
    <description>
            This is an example build file for building lift applications
    </description>
	<property name="scala.version" value="2.7.3"/>
	<property name="lift.version" value="1.0"/>
	<property name="src.dir" value="${basedir}/src/main/scala"/>
	<property name="resources.dir" value="${basedir}/src/main/resources"/>
	<property name="test.src.dir" value="${basedir}/src/test/scala"/>
	<property name="test.resources.dir" value="${basedir}/src/main/resources"/>
	
	<property name="target.dir" value="${basedir}/target"/>
	<property name="target.classes.dir" value="${target.dir}/classes"/>
	<property name="target.test-classes.dir" value="${target.dir}/classes"/>
	<property name="lib.dir" value="${target.dir}/lib"/>
	
	
	
   <property name="maven.ant.tasks.jar" value="${lib.dir}${file.separator}maven-ant-tasks-2.0.9.jar"/>
   <property name="maven.ant.tasks.bootstrap.location" value="http://apache.inetbridge.net/maven/binaries/maven-ant-tasks-2.0.9.jar"/>
   <available property="maven.ant.tasks.jar.exists" file="${maven.ant.tasks.jar}"/>

	
   <!-- This will download the "latest version" of the maven-ant-tasks if needed -->
   <target name="bootstrap.maven.tasks" unless="maven.ant.tasks.jar.exists">
	  <mkdir dir="${lib.dir}"/>
	  <get src="${maven.ant.tasks.bootstrap.location}" dest="${maven.ant.tasks.jar}"/>
   </target>

   <!-- This will initialize all the maven ant tasks -->
   <target name="init.maven.tasks" depends="bootstrap.maven.tasks">
	  <path 
	   id="maven.ant.tasks.classpath" 
	   path="${maven.ant.tasks.jar}" />
	  <typedef 
	   resource="org/apache/maven/artifact/ant/antlib.xml" 
	   uri="urn:maven-artifact-ant" 
	   classpathref="maven.ant.tasks.classpath" /> 
   	
   </target>

	<!-- This bootstraps the scala ant tasks from the maven repository and initializes them -->
	<target name="init.scala.tasks" depends="init.maven.tasks">

	  <artifact:dependencies pathId="scala.tasks.classpath">
	   <dependency groupId="org.scala-lang" artifactId="scala-compiler" version="${scala.version}" scope="compile" />
	   <remoteRepository id="scala-tools.repository" url="http://scala-tools.org/repo-releases"; />
	  </artifact:dependencies>

	  <taskdef resource="scala/tools/ant/antlib.xml">
	   <classpath refid="scala.tasks.classpath" />
	  </taskdef>

	 </target>
	
    <!-- Resolves the compile-time + test-time dependencies -->
    <target name="resolve-dependencies" depends="init.maven.tasks">
      <artifact:dependencies pathId="compile.classpath" >
    	   <dependency groupId="org.scala-lang" artifactId="scala-library" version="${scala.version}" scope="compile" />
		   <dependency groupId="net.liftweb" artifactId="lift-util" version="${lift.version}" scope="compile" />
		   <dependency groupId="net.liftweb" artifactId="lift-webkit" version="${lift.version}" scope="compile" />
		   <dependency groupId="net.liftweb" artifactId="lift-mapper" version="${lift.version}" scope="compile" />
    	   <remoteRepository id="scala-tools.repository" url="http://scala-tools.org/repo-releases"; />
      </artifact:dependencies>
    	
    	
    	<artifact:dependencies pathId="test.classpath" >
    	   <dependency groupId="junit" artifactId="junit" version="4.5" scope="test" />
    	   <remoteRepository id="scala-tools.repository" url="http://scala-tools.org/repo-releases"; />
   	    </artifact:dependencies>
    </target>
	
	<target name="compile" depends="resolve-dependencies,init.scala.tasks" description="compiles the source code">
	  <mkdir dir="${target.classes.dir}"/>
	  <scalac srcdir="${src.dir}" destdir="${target.classes.dir}" classpathref="compile.classpath" force="changed">
		   <include name="**/*.scala" />
		   <include name="**/*.java" />
	  </scalac>
    </target>
	
	<target name="test-compile" depends="compile" description="compiles the test code">
		<path id="test.classpath.full">
			<path refid="compile.classpath"/>
			<path refid="test.classpath"/>
		</path>
		<mkdir dir="${target.test-classes.dir}"/>
		  <scalac srcdir="${src.dir}" destdir="${target.test-classes.dir}" classpathref="test.classpath.full" force="changed">
			   <include name="**/*.scala" />
			   <include name="**/*.java" />
		  </scalac>
	</target>
	
    <target name="test" depends="test-compile" description="runs the unit tests for this application">
        
    </target>

	
    <target name="package" depends="test" description="description">
        
    </target>


	<target name="clean" description="Cleans the project">
		<delete dir="${target.dir}"/>
	</target>
</project>

Reply via email to