HHH-5616 - Switch to Gradle for builds .. em

This commit is contained in:
Steve Ebersole 2010-10-09 13:02:49 -05:00
parent 239927e376
commit 89298608b0
488 changed files with 70 additions and 299 deletions

View File

@ -72,18 +72,18 @@ subprojects { subProject ->
group = 'org.hibernate'
version = '4.0.0-SNAPSHOT'
defaultTasks 'build'
// 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'
// if ( 'hibernate-release' == subProject.name ) {
// apply plugin : 'base'
// }
// else {
if ( 'hibernate-release' != subProject.name ) {
apply plugin: 'maven' // for install task as well as deploy dependencies
defaultTasks 'build'
configurations {
provided {
// todo : need to make sure these are non-exported

View File

@ -1,4 +0,0 @@
build.properties
build
target
test_output

View File

@ -1,208 +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-entitymanager</artifactId>
<packaging>jar</packaging>
<name>Hibernate Entity Manager</name>
<description>Hibernate Entity Manager</description>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>hibernate-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
</dependency>
<dependency>
<groupId>javassist</groupId>
<artifactId>javassist</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>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${groupId}</groupId>
<artifactId>hibernate-testing</artifactId>
<version>${version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-api</artifactId>
<version>1.0.0-alpha-6</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-base</artifactId>
<version>1.0.0-alpha-6</version>
<scope>test</scope>
</dependency>
<dependency>
<!--
Only really needed for the antrun plugin defined below (which in turn is only really needed
to work around a missing feature on the compile plugin; lovely no?). However I have not
found a way to declare this dependency local to the antrun plugin and then reference it
from the <javac />'s <classpath /> :(
-->
<groupId>${project.groupId}</groupId>
<artifactId>hibernate-jpamodelgen</artifactId>
<version>1.0.0.Final</version>
<scope>test</scope>
<exclusions>
<exclusion>
<!-- Use the jpa-api defined here, crossing fingers they match up signature-wise -->
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<testResources>
<testResource>
<filtering>true</filtering>
<directory>src/test/resources</directory>
</testResource>
<testResource>
<filtering>true</filtering>
<directory>src/test/bundles</directory>
<targetPath>../bundles</targetPath>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.jboss.maven.plugins</groupId>
<artifactId>maven-injection-plugin</artifactId>
<configuration>
<bytecodeInjections>
<bytecodeInjection>
<expression>${pom.version}</expression>
<targetMembers>
<methodBodyReturn>
<className>org.hibernate.ejb.Version</className>
<methodName>getVersionString</methodName>
</methodBodyReturn>
</targetMembers>
</bytecodeInjection>
</bytecodeInjections>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<!-- Define one configuration outside executions and without a phase in order to allow 'mvn antrun:run' -->
<configuration>
<tasks>
<property name="target.dir" value="${project.build.directory}/generated-src/jpamodelgen"/>
<property name="src.dir" value="${project.build.testSourceDirectory}"/>
<property name="classpath" refid="maven.test.classpath"/>
<ant antfile="${basedir}/build.xml">
<target name="generate-metamodel"/>
</ant>
</tasks>
</configuration>
<executions>
<execution>
<id>process_annotations</id>
<phase>process-test-sources</phase>
<configuration>
<!-- No additional configuration needed. Unbound configuration gets inherited. (Feels wrong, but that's how it is) -->
<testSourceRoot>${project.build.directory}/generated-src/jpamodelgen</testSourceRoot>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/*TestCase.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>doc</id>
<build>
<plugins>
<plugin>
<groupId>org.jboss.maven.plugins</groupId>
<artifactId>maven-jdocbook-plugin</artifactId>
<configuration>
<sourceDocumentName>master.xml</sourceDocumentName>
<sourceDirectory>${basedir}/src/main/docbook</sourceDirectory>
<masterTranslation>en</masterTranslation>
<imageResource>
<directory>${basedir}/src/main/docbook/en/images</directory>
</imageResource>
</configuration>
<executions>
<execution>
<id>make-doc</id>
<phase>package</phase>
<goals>
<goal>resources</goal>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>jaxb</id>
<activation>
<jdk>1.5</jdk>
</activation>
<dependencies>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.1.3</version>
<scope>test</scope>
</dependency>
</dependencies>
</profile>
</profiles>
</project>

View File

@ -1,5 +0,0 @@
hibernate.connection.driver_class ${jdbc.driver}
hibernate.connection.url ${jdbc.url}
hibernate.connection.username ${jdbc.user}
hibernate.connection.password ${jdbc.pass}
hibernate.connection.isolation ${jdbc.isolation}

View File

@ -1,33 +0,0 @@
################################################################################
# Copyright (c) 2007, Red Hat Middleware, LLC. All rights reserved. #
# #
# 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, v. 2.1. This program is distributed in the #
# hope that it will be useful, but WITHOUT A 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, v.2.1 along with this #
# distribution; if not, write to the Free Software Foundation, Inc., #
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #
# #
# Red Hat Author(s): Steve Ebersole #
################################################################################
hibernate.dialect ${db.dialect}
hibernate.connection.driver_class ${jdbc.driver}
hibernate.connection.url ${jdbc.url}
hibernate.connection.username ${jdbc.user}
hibernate.connection.password ${jdbc.pass}
hibernate.connection.isolation ${jdbc.isolation}
hibernate.connection.pool_size 5
hibernate.show_sql true
hibernate.format_sql true
hibernate.max_fetch_depth 5
hibernate.cache.region_prefix hibernate.test
hibernate.cache.provider_class org.hibernate.cache.HashtableCacheProvider
hibernate.jdbc.batch_size 0

View File

@ -1,39 +0,0 @@
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=warn, stdout
log4j.logger.org.hibernate=debug
#log4j.logger.org.hibernate=debug
log4j.logger.org.hibernate.ejb=debug
log4j.logger.org.hibernate.ejb.packaging=debug
log4j.logger.org.hibernate.reflection=debug
#log4j.logger.org.hibernate.engine.Cascades=debug
#log4j.logger.org.hibernate.hql=debug
### log just the SQL
log4j.logger.org.hibernate.SQL=debug
### log JDBC bind parameters ###
#log4j.logger.org.hibernate.type=info
log4j.logger.org.hibernate.type=trace
### log schema export/update ###
log4j.logger.org.hibernate.tool.hbm2ddl=debug
### log HQL parse trees
#log4j.logger.org.hibernate.hql=debug
### log cache activity ###
#log4j.logger.org.hibernate.cache=debug
### log JDBC resource acquisition
#log4j.logger.org.hibernate.jdbc=debug
### enable the following line if you want to track down connection ###
### leakages when using DriverManagerConnectionProvider ###
#log4j.logger.org.hibernate.connection.DriverManagerConnectionProvider=trace

View File

@ -0,0 +1,58 @@
apply plugin: 'java'
// todo : there are test failures due to issues with how 'bundles' are handled.
// My guess is using TCCL as the tests try to is not valid in Gradle.
// not needed if we rename the directories to match the sourceSet name
sourceSets {
test {
// resources inherently exclude sources
resources {
setSrcDirs( ['src/test/java','src/test/resources'] )
}
}
}
dependencies {
shrinkwrapVersion = '1.0.0-alpha-6'
compile( project(':hibernate-core') )
compile( libraries.dom4j )
compile( libraries.commons_annotations )
compile( libraries.jpa )
compile( libraries.jta )
compile( libraries.javassist )
testCompile( project(':hibernate-core').sourceSets.test.classes )
testCompile( libraries.junit )
testCompile( libraries.jpa_modelgen )
testCompile( libraries.shrinkwrap_api )
testCompile( libraries.shrinkwrap )
testCompile( libraries.validation )
testCompile( libraries.slf4j_api )
testRuntime( libraries.validator )
}
procTargetDirName = buildDirName + "/generated-src/jpamodelgen"
procTargetDir = dir( procTargetDirName )
compileJava {
configure( options ) {
compilerArgs = [ "-s", "$procTargetDir.dir.absolutePath" ]
}
}
compileJava.dependsOn procTargetDir
bundlesTargetDirName = "$buildDirName/bundles"
bundlesTargetDir = dir( bundlesTargetDirName )
task processBundleResources {
copy {
from 'src/test/bundles'
into bundlesTargetDir.dir
}
}
processBundleResources.dependsOn bundlesTargetDir
//ideaModule {
// testSourceDirs.add( file( procTargetDirName ) )
//}

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