[hibernate-commits] Hibernate SVN: r17711 - in core/branches/gradle: hibernate-core and 1 other directory.

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Mon Oct 12 18:43:50 EDT 2009


Author: steve.ebersole at jboss.com
Date: 2009-10-12 18:43:49 -0400 (Mon, 12 Oct 2009)
New Revision: 17711

Modified:
   core/branches/gradle/build.gradle
   core/branches/gradle/hibernate-core/build.gradle
Log:
initial working build

Modified: core/branches/gradle/build.gradle
===================================================================
--- core/branches/gradle/build.gradle	2009-10-12 18:45:43 UTC (rev 17710)
+++ core/branches/gradle/build.gradle	2009-10-12 22:43:49 UTC (rev 17711)
@@ -33,6 +33,9 @@
 
     // minimize changes, at least for now..
     buildDirName = "target"
+
+    // by default, compile to 1.4 compatibility
+    sourceTarget = "1.4"
 }
 
 dependsOnChildren()
\ No newline at end of file

Modified: core/branches/gradle/hibernate-core/build.gradle
===================================================================
--- core/branches/gradle/hibernate-core/build.gradle	2009-10-12 18:45:43 UTC (rev 17710)
+++ core/branches/gradle/hibernate-core/build.gradle	2009-10-12 22:43:49 UTC (rev 17711)
@@ -1,3 +1,10 @@
+configurations {
+    compile {
+        transitive = true
+    }
+    antAntlr
+}
+
 dependencies {
     compile (
             // need to be transitive...
@@ -13,8 +20,71 @@
             'javax.security:jaas:1.0.01',
             'javax.security:jacc:1.0'
     )
+    antAntlr (
+            'ant:ant-antlr:1.6.5',
+            'antlr:antlr:2.7.6'
+    )
 }
 
 manifest.mainAttributes(
     mainClass: 'org.hibernate.Version'
-)
\ No newline at end of file
+)
+
+antlrSourceDirName = "src/main/antlr"
+antlrJavaTargetDirName = "$buildDir/generated-src/antlr"
+
+antlrJavaTargetDir = new File( antlrJavaTargetDirName )
+
+task antlrInit << {
+    antlrJavaTargetDir.mkdirs()
+}
+
+task antlr(dependsOn: antlrInit) << {
+    ant.taskdef(
+            name: 'antlrtask',
+            classname: 'org.apache.tools.ant.taskdefs.optional.ANTLR',
+            classpath: configurations.antAntlr.asPath
+    )
+
+    outputDir = new File( "$antlrJavaTargetDirName/org/hibernate/hql/antlr" )
+    outputDir.mkdirs()
+
+    ant.antlrtask(
+            target: "${antlrSourceDirName}/hql.g",
+            outputdirectory: outputDir
+    )
+
+    ant.antlrtask(
+            target: "${antlrSourceDirName}/hql-sql.g",
+            outputdirectory: outputDir,
+            tracetreewalker: true
+    )
+
+    ant.antlrtask(
+            target: "${antlrSourceDirName}/sql-gen.g",
+            outputdirectory: outputDir,
+            tracetreewalker: true
+    )
+
+    outputDir = new File( "$antlrJavaTargetDirName/org/hibernate/sql/ordering/antlr" )
+    outputDir.mkdirs()
+
+    ant.antlrtask(
+            target: "${antlrSourceDirName}/order-by.g",
+            outputdirectory: outputDir
+    )
+
+    ant.antlrtask(
+            target: "${antlrSourceDirName}/order-by-render.g",
+            outputdirectory: outputDir,
+            tracetreewalker: true
+    )
+
+}
+
+def antlrGeneratedSourceFiles = files( antlrJavaTargetDir ) {
+    builtBy 'antlr'
+}
+
+compileJava.dependsOn antlrGeneratedSourceFiles.builtBy
+sourceSets.main.java.srcDir( antlrGeneratedSourceFiles )
\ No newline at end of file



More information about the hibernate-commits mailing list