HHH-7385 change to use gradle 1.1

This commit is contained in:
Strong Liu 2012-08-08 17:53:17 +08:00
parent e422250076
commit cc7d8d8e08
15 changed files with 137 additions and 134 deletions

View File

@ -1,20 +1,20 @@
apply plugin: 'eclipse'
apply plugin: 'idea'
apply from: "./libraries.gradle"
allprojects {
repositories {
mavenCentral()
mavenLocal()
mavenRepo name: 'jboss-nexus', url: "https://repository.jboss.org/nexus/content/groups/public/"
mavenCentral()
mavenLocal()
mavenRepo name: 'jboss-nexus', url: "http://repository.jboss.org/nexus/content/groups/public/"
mavenRepo name: "jboss-snapshots", url: "http://snapshots.jboss.org/maven2/"
}
}
buildscript {
repositories {
mavenCentral()
mavenLocal()
mavenRepo name: 'jboss-nexus', url: "https://repository.jboss.org/nexus/content/groups/public/"
mavenCentral()
mavenLocal()
mavenRepo name: 'jboss-nexus', url: "http://repository.jboss.org/nexus/content/groups/public/"
mavenRepo name: "jboss-snapshots", url: "http://snapshots.jboss.org/maven2/"
}
dependencies {
@ -24,7 +24,7 @@ buildscript {
idea {
project {
jdkName = "1.6"
languageLevel = "1.6"
ipr {
withXml { provider ->
provider.node.component.find { it.@name == 'VcsDirectoryMappings' }.mapping.@vcs = 'Git'
@ -44,69 +44,6 @@ idea {
}
}
// 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.6.1'
junitVersion = '4.10'
h2Version = '1.2.145'
bytemanVersion = '1.5.2'
libraries = [
// Ant
ant: 'org.apache.ant:ant:1.8.2',
// Antlr
antlr: 'antlr:antlr:2.7.7',
// Annotations
commons_annotations:
'org.hibernate.common:hibernate-commons-annotations:4.0.1.Final@jar',
jandex: 'org.jboss:jandex:1.0.3.Final',
classmate: 'com.fasterxml:classmate:0.5.4',
// Dom4J
dom4j: 'dom4j:dom4j:1.6.1@jar',
// Javassist
javassist: 'org.javassist:javassist:3.15.0-GA',
// javax
jpa: 'org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.1.Final',
jta: 'org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:1.0.0.Final',
validation: 'javax.validation:validation-api:1.0.0.GA',
jacc: 'org.jboss.spec.javax.security.jacc:jboss-jacc-api_1.4_spec:1.0.0.Final',
// logging
logging: 'org.jboss.logging:jboss-logging:3.1.0.GA',
logging_processor: 'org.jboss.logging:jboss-logging-processor:1.0.0.Final',
// jaxb task
jaxb: 'com.sun.xml.bind:jaxb-xjc:2.1.6',
jaxb2_basics: 'org.jvnet.jaxb2_commons:jaxb2-basics:0.6.0',
jaxb2_ant: 'org.jvnet.jaxb2_commons:jaxb2-basics-ant:0.6.0',
// ~~~~~~~~~~~~~~~~~~~~~~~~~~ testing
// logging for testing
slf4j_api: "org.slf4j:slf4j-api:${slf4jVersion}",
slf4j_log4j12: "org.slf4j:slf4j-log4j12:${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',
junit: "junit:junit:${junitVersion}",
byteman: "org.jboss.byteman:byteman:${bytemanVersion}",
byteman_install: "org.jboss.byteman:byteman-install:${bytemanVersion}",
byteman_bmunit: "org.jboss.byteman:byteman-bmunit:${bytemanVersion}",
jpa_modelgen: 'org.hibernate:hibernate-jpamodelgen:1.1.1.Final',
shrinkwrap_api: 'org.jboss.shrinkwrap:shrinkwrap-api:1.0.0-beta-6',
shrinkwrap: 'org.jboss.shrinkwrap:shrinkwrap-impl-base:1.0.0-beta-6',
validator: 'org.hibernate:hibernate-validator:4.2.0.Final',
h2: "com.h2database:h2:${h2Version}",
mockito: 'org.mockito:mockito-core:1.9.0'
]
subprojects { subProject ->
apply plugin: 'idea'
apply plugin: 'eclipse'
@ -145,7 +82,8 @@ subprojects { subProject ->
}
}
toolsJar = file("${System.getProperty('java.home')}/../lib/tools.jar")
ext.toolsJar = file("${System.getProperty('java.home')}/../lib/tools.jar")
// appropriately inject the common dependencies into each sub-project
dependencies {
compile( libraries.logging )
@ -153,7 +91,7 @@ subprojects { subProject ->
testCompile( libraries.byteman )
testCompile( libraries.byteman_install )
testCompile( libraries.byteman_bmunit )
testCompile files( toolsJar )
testRuntime( libraries.slf4j_api )
testRuntime( libraries.slf4j_log4j12 )
testRuntime( libraries.jcl_slf4j )
@ -163,21 +101,25 @@ subprojects { subProject ->
testRuntime( libraries.h2 )
jbossLoggingTool( libraries.logging_processor )
hibernateJpaModelGenTool( libraries.jpa_modelgen )
jaxb( libraries.jaxb )
jaxb( libraries.jaxb ){exclude group: "javax.xml.stream"}
jaxb( libraries.jaxb2_basics )
jaxb( libraries.jaxb2_ant )
deployerJars "org.apache.maven.wagon:wagon-http:1.0"
}
aptDumpDir = file( "${buildDir}/tmp/apt" )
if(ext.toolsJar.exists()){
dependencies{
testCompile files( toolsJar )
}
}
ext.aptDumpDir = file( "${buildDir}/tmp/apt" )
sourceSets.main {
compileClasspath += configurations.provided
}
sourceSets.all {
originalJavaSrcDirs = java.srcDirs
generatedLoggingSrcDir = file( "${buildDir}/generated-src/logging/${name}" )
ext.originalJavaSrcDirs = java.srcDirs
ext.generatedLoggingSrcDir = file( "${buildDir}/generated-src/logging/${name}" )
java.srcDir generatedLoggingSrcDir
}
@ -226,6 +168,8 @@ subprojects { subProject ->
maxHeapSize = "1024m"
}
processTestResources.doLast( {
copy {
from( sourceSets.test.java.srcDirs ) {
@ -311,7 +255,7 @@ subprojects { subProject ->
}
}
subProject.basePomConfig = pomConfig
subProject.ext.basePomConfig = pomConfig
configure(install.repositories.mavenInstaller) {
pom.project pomConfig
@ -340,7 +284,6 @@ subprojects { subProject ->
}
}
dependsOnChildren()
// This is a task that generates the gradlew scripts, allowing users to run gradle without having gradle installed
@ -350,5 +293,5 @@ dependsOnChildren()
// 2) /gradlew.bat which is the windows bat script for for executing builds
// 3) /wrapper which is a directory named by the "jarPath" config which contains other needed files.
task wrapper(type: Wrapper) {
gradleVersion = '1.0-milestone-8a'
gradleVersion = '1.1'
}

View File

@ -49,11 +49,10 @@ dependencies {
idea {
project {
jdkName = "1.6"
languageLevel = '1.6'
}
module {
downloadSources = true
downloadJavadoc = true
javaVersion = '1.6'
}
}

View File

@ -93,7 +93,7 @@ class DatabaseAllocator {
public static DatabaseAllocator locate(Project project) {
if ( ! project.rootProject.hasProperty( DB_ALLOCATOR_KEY ) ) {
project.rootProject.setProperty( DB_ALLOCATOR_KEY, new DatabaseAllocator( project.rootProject ) );
project.rootProject.ext.setProperty( DB_ALLOCATOR_KEY, new DatabaseAllocator( project.rootProject ) );
}
return (DatabaseAllocator) project.rootProject.properties[ DB_ALLOCATOR_KEY ];
}

View File

@ -2,18 +2,18 @@ buildscript {
repositories {
mavenCentral()
mavenLocal()
mavenRepo name: 'jboss-nexus', url: "https://repository.jboss.org/nexus/content/groups/public/"
mavenRepo name: 'jboss-nexus', url: "http://repository.jboss.org/nexus/content/groups/public/"
}
dependencies {
classpath "org.jboss.jdocbook:gradle-jdocbook:1.2.0"
classpath "org.jboss.jdocbook:gradle-jdocbook:1.2.1"
}
}
apply plugin: "java"
apply plugin: "jdocbook"
ext.pressgangVersion = '3.0.0'
dependencies {
pressgangVersion = '3.0.0'
jdocbookXsl "org.jboss.pressgang:pressgang-xslt-ns:${pressgangVersion}"
jdocbookXsl "org.jboss.pressgang:pressgang-fonts:${pressgangVersion}"
jdocbookStyles "org.jboss.pressgang:pressgang-jdocbook-style:${pressgangVersion}"

View File

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.0-milestone-8a-bin.zip
distributionUrl=http\://services.gradle.org/distributions/gradle-1.1-bin.zip

View File

@ -1,9 +1,7 @@
apply plugin: 'java'
dependencies {
provided( libraries.validation )
compile project( ':hibernate-core' )
compile "c3p0:c3p0:0.9.1"
compile( libraries.c3p0 )
testCompile( libraries.validator ) {
// for test runtime

View File

@ -1,4 +1,3 @@
apply plugin: 'java'
apply plugin: 'antlr'
apply plugin: org.hibernate.build.gradle.inject.InjectionPlugin
apply plugin: org.hibernate.build.gradle.testing.matrix.MatrixTestingPlugin
@ -39,7 +38,7 @@ manifest.mainAttributes(
)
sourceSets.main {
jaxbTargetDir = file( "${buildDir}/generated-src/jaxb/main" )
ext.jaxbTargetDir = file( "${buildDir}/generated-src/jaxb/main" )
java.srcDir jaxbTargetDir
originalJavaSrcDirs = java.srcDirs
}
@ -56,6 +55,7 @@ idea {
}
task jaxb {
ext {
// output directory
jaxbTargetDir = file( "${buildDir}/generated-src/jaxb/main" )
@ -68,7 +68,7 @@ task jaxb {
cfgXjb = file( 'src/main/xjb/hbm-configuration-bindings.xjb' )
hbmXjb = file( 'src/main/xjb/hbm-mapping-bindings.xjb' )
ormXjb = file( 'src/main/xjb/orm-bindings.xjb' )
}
// configure Gradle up-to-date checking
inputs.files( [cfgXsd, hbmXsd, ormXsd, cfgXjb, hbmXjb, ormXjb] )
outputs.dir( jaxbTargetDir )

View File

@ -1,9 +1,6 @@
apply plugin: 'java'
dependencies {
compile project( ':hibernate-core' )
compile "net.sf.ehcache:ehcache-core:2.4.3"
compile( libraries.ehcache )
testCompile project( ':hibernate-testing' )
testCompile libraries.h2
}

View File

@ -1,6 +1,5 @@
import org.apache.tools.ant.filters.ReplaceTokens
apply plugin: 'java'
apply plugin: org.hibernate.build.gradle.testing.matrix.MatrixTestingPlugin
dependencies {
@ -11,7 +10,6 @@ dependencies {
compile( libraries.jta )
compile( libraries.javassist )
testCompile( project(':hibernate-testing') )
testCompile( libraries.junit )
testCompile( libraries.shrinkwrap_api )
testCompile( libraries.shrinkwrap )
testCompile( libraries.validation )
@ -21,11 +19,11 @@ dependencies {
////////////////////////////////////////////////////////////////////////////////////////////////////////
// JPA model-gen set up
////////////////////////////////////////////////////////////////////////////////////////////////////////
aptDumpDir = file( "${buildDir}/tmp/apt" )
ext.aptDumpDir = file( "${buildDir}/tmp/apt" )
sourceSets.test {
originalJavaSrcDirs = java.srcDirs
generatedJpaMetamodelSrcDir = file( "${buildDir}/generated-src/jpamodelgen/${name}" )
ext.generatedJpaMetamodelSrcDir = file( "${buildDir}/generated-src/jpamodelgen/${name}" )
java.srcDir generatedJpaMetamodelSrcDir
}
task generateTestJpaMetamodelClasses(type: Compile) {
@ -53,8 +51,8 @@ compileTestJava.options.define(compilerArgs: ["-proc:none"])
////////////////////////////////////////////////////////////////////////////////////////////////////////
// Process 'bundle resources' for the packaging tests
////////////////////////////////////////////////////////////////////////////////////////////////////////
bundlesTargetDir = file( "${buildDir}/bundles" )
task copyBundleResources (type: Copy) {
ext.bundlesTargetDir = file( "${buildDir}/bundles" )
from file('src/test/bundles')
into bundlesTargetDir
filter(ReplaceTokens, tokens: [

View File

@ -1,23 +1,17 @@
apply plugin: 'java'
apply plugin: org.hibernate.build.gradle.testing.matrix.MatrixTestingPlugin
dependencies {
compile( project( ':hibernate-core' ) )
compile( project( ':hibernate-entitymanager' ) )
compile( libraries.commons_annotations )
provided( [group: 'org.hibernate', name: 'hibernate-tools', version: '3.2.0.ga'] )
compile( libraries.dom4j )
provided( libraries.ant )
testCompile( libraries.junit )
testCompile( project(':hibernate-testing') )
testCompile( libraries.jpa )
testRuntime( libraries.h2 )
testRuntime( libraries.javassist )
}
sourceSets {
main {
generatedJpaMetamodelSrcDir = file( "${buildDir}/generated-src/jpamodelgen/${name}" )
ext.generatedJpaMetamodelSrcDir = file( "${buildDir}/generated-src/jpamodelgen/${name}" )
java {
srcDir generatedJpaMetamodelSrcDir
}

View File

@ -1,23 +1,18 @@
apply plugin: 'java'
configurations {
all*.exclude group: 'org.jboss.logging', module: 'jboss-logging-spi'
}
dependencies {
infinispanVersion = '5.1.4.FINAL'
jnpVersion = '5.0.3.GA'
compile project( ':hibernate-core' )
compile "org.infinispan:infinispan-core:${infinispanVersion}"
compile "org.rhq.helpers:rhq-pluginAnnotations:3.0.4"
compile( libraries.infinispan )
compile( libraries.rhq )
testCompile project( ':hibernate-testing' )
testCompile "org.infinispan:infinispan-core:${infinispanVersion}:tests@jar"
testCompile "org.jboss:jboss-common-core:2.2.14.GA"
testCompile "org.jboss.naming:jnp-client:${jnpVersion}"
testCompile "org.jboss.naming:jnpserver:${jnpVersion}"
testCompile "org.rhq.helpers:rhq-pluginAnnotations:1.4.0.B01"
testCompile( libraries.infinispan_test )
testCompile( libraries.jboss_common_core )
testCompile( libraries.jnp_client )
testCompile( libraries.jnp_server )
testCompile( libraries.rhq )
}
test {

View File

@ -1,9 +1,6 @@
apply plugin: 'java'
dependencies {
compile project( ':hibernate-core' )
compile "proxool:proxool:0.8.3"
compile( libraries.proxool )
testCompile project( ':hibernate-testing' )
testRuntime libraries.h2
}

View File

@ -1,13 +1,11 @@
apply plugin: 'java'
dependencies {
compile project( ':hibernate-core' )
compile( libraries.junit )
compile( libraries.byteman )
compile( libraries.byteman_install )
compile( libraries.byteman_bmunit )
compile "com.experlog:xapool:1.5.0"
compile ( "org.jboss.jbossts:jbossjta:4.15.1.Final" ) {
compile( libraries.xapool )
compile ( libraries.jboss_jta ) {
transitive=false;
}
}

84
libraries.gradle Normal file
View File

@ -0,0 +1,84 @@
// 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
ext {
slf4jVersion = '1.6.1'
junitVersion = '4.10'
h2Version = '1.2.145'
bytemanVersion = '1.5.2'
infinispanVersion = '5.1.5.FINAL'
jnpVersion = '5.0.6.CR1'
libraries = [
// Ant
ant: 'org.apache.ant:ant:1.8.2',
// Antlr
antlr: 'antlr:antlr:2.7.7',
// Annotations
commons_annotations:
'org.hibernate.common:hibernate-commons-annotations:4.0.1.Final@jar',
jandex: 'org.jboss:jandex:1.0.3.Final',
classmate: 'com.fasterxml:classmate:0.5.4',
// Dom4J
dom4j: 'dom4j:dom4j:1.6.1@jar',
// Javassist
javassist: 'org.javassist:javassist:3.15.0-GA',
// javax
jpa: 'org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.1.Final',
jta: 'org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:1.0.0.Final',
validation: 'javax.validation:validation-api:1.0.0.GA',
jacc: 'org.jboss.spec.javax.security.jacc:jboss-jacc-api_1.4_spec:1.0.0.Final',
// logging
logging: 'org.jboss.logging:jboss-logging:3.1.0.GA',
logging_processor: 'org.jboss.logging:jboss-logging-processor:1.0.0.Final',
// jaxb task
jaxb: 'com.sun.xml.bind:jaxb-xjc:2.1.6',
jaxb2_basics: 'org.jvnet.jaxb2_commons:jaxb2-basics:0.6.0',
jaxb2_ant: 'org.jvnet.jaxb2_commons:jaxb2-basics-ant:0.6.0',
// ~~~~~~~~~~~~~~~~~~~~~~~~~~ testing
// logging for testing
slf4j_api: "org.slf4j:slf4j-api:${slf4jVersion}",
slf4j_log4j12: "org.slf4j:slf4j-log4j12:${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',
junit: "junit:junit:${junitVersion}",
byteman: "org.jboss.byteman:byteman:${bytemanVersion}",
byteman_install: "org.jboss.byteman:byteman-install:${bytemanVersion}",
byteman_bmunit: "org.jboss.byteman:byteman-bmunit:${bytemanVersion}",
jpa_modelgen: 'org.hibernate:hibernate-jpamodelgen:1.1.1.Final',
shrinkwrap_api: 'org.jboss.shrinkwrap:shrinkwrap-api:1.0.0-beta-6',
shrinkwrap: 'org.jboss.shrinkwrap:shrinkwrap-impl-base:1.0.0-beta-6',
validator: 'org.hibernate:hibernate-validator:4.2.0.Final',
h2: "com.h2database:h2:${h2Version}",
jboss_jta: "org.jboss.jbossts:jbossjta:4.16.4.Final",
xapool: "com.experlog:xapool:1.5.0",
mockito: 'org.mockito:mockito-core:1.9.0',
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ infinsipan
infinispan: "org.infinispan:infinispan-core:${infinispanVersion}",
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ infinispan test
infinispan_test: "org.infinispan:infinispan-core:${infinispanVersion}:tests@jar",
rhq: "org.rhq.helpers:rhq-pluginAnnotations:3.0.4",
jboss_common_core: "org.jboss:jboss-common-core:2.2.16.GA@jar",
jnp_client: "org.jboss.naming:jnp-client:${jnpVersion}",
jnp_server: "org.jboss.naming:jnpserver:${jnpVersion}",
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ c3p0
c3p0: "c3p0:c3p0:0.9.1",
ehcache: "net.sf.ehcache:ehcache-core:2.4.3",
proxool: "proxool:proxool:0.8.3",
]
}

View File

@ -10,7 +10,7 @@ idea.module {
// Javadocs ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
javadocBuildDir = mkdir( "${buildDir}/documentation/javadocs" )
ext.javadocBuildDir = mkdir( "${buildDir}/documentation/javadocs" )
def copyRightYear = new java.util.GregorianCalendar().get( java.util.Calendar.YEAR );
@ -107,11 +107,11 @@ aggregateJavadocs.doLast {
// release bundles ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
releaseBuildDir = mkdir( buildDir )
ext.releaseBuildDir = mkdir( buildDir )
task prepareReleaseBundles( dependsOn: [parent.project( 'documentation' ).tasks.buildDocs,aggregateJavadocs] )
releaseCopySpec = copySpec {
ext.releaseCopySpec = copySpec {
into( "hibernate-release-$project.version" ) {
from new File( parent.projectDir, 'lgpl.txt' )
from new File( parent.projectDir, 'changelog.txt' )