You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2011/03/12 21:33:59 UTC

svn commit: r1080997 - /tapestry/tapestry5/trunk/tapestry-core/build.gradle

Author: hlship
Date: Sat Mar 12 20:33:58 2011
New Revision: 1080997

URL: http://svn.apache.org/viewvc?rev=1080997&view=rev
Log:
TAP5-116: Replace Maven build with Gradle build

Get tapestry-core to build Antlr sources and compile them

Modified:
    tapestry/tapestry5/trunk/tapestry-core/build.gradle

Modified: tapestry/tapestry5/trunk/tapestry-core/build.gradle
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/build.gradle?rev=1080997&r1=1080996&r2=1080997&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/build.gradle (original)
+++ tapestry/tapestry5/trunk/tapestry-core/build.gradle Sat Mar 12 20:33:58 2011
@@ -1,19 +1,23 @@
 description="Central module for Tapestry, containing all core services and components"
 
+antlrSource = "src/main/antlr"
 antlrOutput = "$buildDir/generated-sources/antlr"
 
 configurations {
   antlr3
 } 
 
+sourceSets.main.java.srcDir antlrOutput
+
 dependencies {
   compile project(':tapestry-ioc')
   compile project(':tapestry-json')
-
-  testCompile project(':tapestry-test')
+  
+  // Should be "provided" as per Maven POM
+  compile project(":tapestry-test")
+  compile "javax.servlet:servlet-api:2.4"
 
   compile "commons-codec:commons-codec:1.3"
-  compile "javax.servlet:servlet-api:2.4"
 
   // Transitive will bring in the unwanted string template library as well
   compile "org.antlr:antlr-runtime:3.3", { transitive = false }
@@ -27,9 +31,17 @@ dependencies {
 task generateGrammarSource(
   description: "Generates Java sources from Antlr3 grammars."
 ) << {
-  logger.info "GENERATE GRAMMAR SOURCE"
+  // Seems that you have to use error for it to show up normally.
+  logger.error "GENERATE GRAMMAR SOURCE for $project.name"
   
   mkdir(antlrOutput)
+  
+  def grammars = fileTree(antlrSource).include("**/*.g")
+    
+  ant.java(classname: 'org.antlr.Tool', fork: true, classpath: "${configurations.antlr3.asPath}") {
+     arg(line: "-o ${antlrOutput}/org/apache/tapestry5/internal/antlr")
+     arg(line: grammars.files.join(" "))
+  }
 }
 
 compileJava.dependsOn generateGrammarSource
\ No newline at end of file