HHH-5616 - Switch to Gradle for builds

This commit is contained in:
Steve Ebersole 2010-10-08 20:20:10 -05:00
parent 0bfe7869e4
commit 34c2839dcc
1658 changed files with 163 additions and 271 deletions

155
build.gradle Normal file
View File

@ -0,0 +1,155 @@
apply plugin: 'eclipse'
apply plugin: 'idea'
allprojects {
repositories {
mavenCentral()
mavenRepo name: 'jboss-nexus', urls: "https://repository.jboss.org/nexus/content/groups/public/"
mavenRepo name: "jboss-snapshots", urls: "http://snapshots.jboss.org/maven2/"
mavenRepo urls: "file://" + System.getProperty('user.home') + "/.m2/repository/"
}
}
ideaProject {
javaVersion = "1.6"
}
// build a map of the dependency artifacts to use. Allows centralized definition of the version of artifacts to
// use. In that respect it serves a role similar to <dependencyManagement> in Maven
slf4jVersion = '1.5.8'
libraries = [
// Ant
ant: 'ant:ant:1.6.5',
// Antlr
antlr: 'antlr:antlr:2.7.7',
// Annotations
commons_annotations:
'org.hibernate:hibernate-commons-annotations:3.2.0.Final',
// CGLIB
cglib: 'cglib:cglib:2.2',
// Jakarta commons-collections todo : get rid of commons-collections dependency
commons_collections:
'commons-collections:commons-collections:3.1',
// Dom4J
dom4j: 'dom4j:dom4j:1.6.1@jar',
// h2
h2: 'com.h2database:h2:1.2.134',
// Javassist
javassist: 'javassist:javassist:3.12.0.GA',
// javax
jpa: 'org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.0.Final',
jta: 'javax.transaction:jta:1.1',
validation: 'javax.validation:validation-api:1.0.0.GA',
validator: 'org.hibernate:hibernate-validator:4.0.2.GA',
jacc: 'org.jboss.javaee:jboss-jacc-api:1.1.0.GA',
// logging
slf4j_api: 'org.slf4j:slf4j-api:' + slf4jVersion,
slf4j_simple: 'org.slf4j:slf4j-simple:' + slf4jVersion,
jcl_slf4j: 'org.slf4j:jcl-over-slf4j:' + slf4jVersion,
jcl_api: 'commons-logging:commons-logging-api:99.0-does-not-exist',
jcl: 'commons-logging:commons-logging:99.0-does-not-exist',
// testing
junit: 'junit:junit:3.8.2',
testng: 'org.testng:testng:5.8:jdk15',
jpa_modelgen: 'org.hibernate:hibernate-jpamodelgen:1.0.0.Final',
shrinkwrap_api: 'org.jboss.shrinkwrap:shrinkwrap-api:1.0.0-alpha-6',
shrinkwrap: 'org.jboss.shrinkwrap:shrinkwrap-impl-base:1.0.0-alpha-6'
]
subprojects { subProject ->
group = 'org.hibernate'
version = '4.0.0-SNAPSHOT'
// minimize changes, at least for now (gradle uses 'build' by default)..
buildDirName = "target"
if ( 'hibernate-release' == subProject.name ) {
apply plugin : 'base'
}
else {
apply plugin: 'java'
apply plugin: 'maven' // for install task as well as deploy dependencies
defaultTasks 'build'
configurations {
provided {
// todo : need to make sure these are non-exported
description = 'Non-exported compile-time dependencies.'
}
}
// appropriately inject the common dependencies into each sub-project
dependencies {
compile( libraries.slf4j_api )
testCompile( libraries.junit )
testRuntime( libraries.slf4j_simple )
testRuntime( libraries.jcl_slf4j )
testRuntime( libraries.jcl_api )
testRuntime( libraries.jcl )
testRuntime( libraries.h2 )
}
sourceSets {
main {
compileClasspath += configurations.provided
}
}
manifest.mainAttributes(
provider: 'gradle',
'Implementation-Url': 'http://hibernate.org',
'Implementation-Version': version,
'Implementation-Vendor': 'Hibernate.org',
'Implementation-Vendor-Id': 'org.hibernate'
)
test {
// ignoreFailures = true
environment['hibernate.test.validatefailureexpected'] = true
maxHeapSize = "1024m"
}
processTestResources.doLast(
{
copy {
from( sourceSets.test.java.srcDirs ) {
include '**/*.properties'
include '**/*.xml'
}
into sourceSets.test.classesDir
}
}
)
assemble.doLast( { install } )
uploadArchives.dependsOn install
targetCompatibility = "1.6"
sourceCompatibility = "1.6"
ideaModule {
downloadJavadoc = false
scopes.COMPILE.plus.add( configurations.provided )
outputDir = subProject.sourceSets.main.classesDir
testOutputDir = subProject.sourceSets.test.classesDir
whenConfigured { module ->
module.dependencies*.exported = true
}
}
}
}
dependsOnChildren()

View File

@ -1,238 +0,0 @@
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-parent</artifactId>
<version>3.6.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<packaging>jar</packaging>
<name>Hibernate Core</name>
<description>The core functionality of Hibernate</description>
<dependencies>
<dependency>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<exclusions>
<exclusion>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-commons-annotations</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.2</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>stax-api</artifactId>
<groupId>javax.xml.stream</groupId>
</exclusion>
<exclusion>
<artifactId>activation</artifactId>
<groupId>javax.activation</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.1.12</version>
<scope>test</scope>
</dependency>
<!-- optional deps for bytecode providers until those are finally properly scoped -->
<dependency>
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<!-- YUCK, YUCK, YUCK!!!! -->
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>org.jboss.javaee</groupId>
<artifactId>jboss-jacc-api_JDK4</artifactId>
<version>1.1.0</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>org.jboss.javaee</groupId>
<artifactId>jboss-servlet-api_3.0</artifactId>
</exclusion>
<exclusion>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-spi</artifactId>
</exclusion>
<exclusion>
<groupId>org.jboss</groupId>
<artifactId>jboss-common-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>ant</groupId>
<artifactId>ant</artifactId>
<version>1.6.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<testResources>
<testResource>
<filtering>false</filtering>
<directory>src/test/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</testResource>
<testResource>
<filtering>true</filtering>
<directory>src/test/resources</directory>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>antlr-maven-plugin</artifactId>
<version>${antlrPluginVersion}</version>
<configuration>
<grammars>hql.g,hql-sql.g,sql-gen.g,order-by.g,order-by-render.g</grammars>
<traceParser>true</traceParser>
<traceTreeParser>true</traceTreeParser>
</configuration>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jboss.maven.plugins</groupId>
<artifactId>maven-injection-plugin</artifactId>
<configuration>
<bytecodeInjections>
<bytecodeInjection>
<expression>${pom.version}</expression>
<targetMembers>
<methodBodyReturn>
<className>org.hibernate.Version</className>
<methodName>getVersionString</methodName>
</methodBodyReturn>
</targetMembers>
</bytecodeInjection>
</bytecodeInjections>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>org.hibernate.Version</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>antlr-maven-plugin</artifactId>
<version>${antlrPluginVersion}</version>
<configuration>
<!-- eventually should be based on the second phase grammar -->
<grammars>hql.g</grammars>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<!--
for the time being, gonna ignore the custom stylesheet (what did it do anyway???)
<stylesheetfile>xyz</stylesheetfile>
-->
<groups>
<group>
<title>Core API</title>
<packages>org.hibernate:org.hibernate.classic:org.hibernate.criterion:org.hibernate.metadata:org.hibernate.cfg:org.hibernate.usertype</packages>
</group>
<group>
<title>Extension API</title>
<packages>org.hibernate.id:org.hibernate.connection:org.hibernate.transaction:org.hibernate.type:org.hibernate.dialect*:org.hibernate.cache*:org.hibernate.event*:org.hibernate.action:org.hibernate.property:org.hibernate.loader*:org.hibernate.persister*:org.hibernate.proxy:org.hibernate.tuple:org.hibernate.transform:org.hibernate.collection:org.hibernate.jdbc</packages>
</group>
<group>
<title>Miscellaneous API</title>
<packages>org.hibernate.stat:org.hibernate.tool.hbm2ddl:org.hibernate.jmx:org.hibernate.mapping:org.hibernate.tool.instrument</packages>
</group>
<group>
<title>Internal Implementation</title>
<packages>org.hibernate.engine:org.hibernate.impl:org.hibernate.sql:org.hibernate.lob:org.hibernate.util:org.hibernate.exception:org.hibernate.hql:org.hibernate.hql.ast:org.hibernate.hql.antlr:org.hibernate.hql.classic:org.hibernate.intercept:org.hibernate.secure:org.hibernate.pretty</packages>
</group>
</groups>
</configuration>
</plugin>
</plugins>
</reporting>
<properties>
<antlrPluginVersion>2.1</antlrPluginVersion>
</properties>
</project>

View File

@ -1,33 +0,0 @@
#
# Hibernate, Relational Persistence for Idiomatic Java
#
# Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
# indicated by the @author tags or express copyright attribution
# statements applied by the authors. All third-party contributions are
# distributed under license by Red Hat Middleware LLC.
#
# This copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the GNU
# Lesser General Public License, as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
# for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this distribution; if not, write to:
# Free Software Foundation, Inc.
# 51 Franklin Street, Fifth Floor
# Boston, MA 02110-1301 USA
#
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
log4j.rootLogger=info, stdout
log4j.logger.org.hibernate.test=info
log4j.logger.org.hibernate.tool.hbm2ddl=debug
log4j.logger.org.hibernate.sql.ordering.antlr.OrderByFragmentTranslator=trace

View File

Some files were not shown because too many files have changed in this diff Show More