2010-10-08 21:20:10 -04:00
|
|
|
apply plugin: 'eclipse'
|
|
|
|
apply plugin: 'idea'
|
|
|
|
|
|
|
|
allprojects {
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
2011-02-07 19:20:50 -05:00
|
|
|
mavenLocal()
|
2010-10-08 21:20:10 -04:00
|
|
|
mavenRepo name: 'jboss-nexus', urls: "https://repository.jboss.org/nexus/content/groups/public/"
|
|
|
|
mavenRepo name: "jboss-snapshots", urls: "http://snapshots.jboss.org/maven2/"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ideaProject {
|
|
|
|
javaVersion = "1.6"
|
2010-11-01 14:44:41 -04:00
|
|
|
withXml { provider ->
|
|
|
|
def node = provider.asNode()
|
|
|
|
def vcsConfig = node.component.find { it.'@name' == 'VcsDirectoryMappings' }
|
|
|
|
vcsConfig.mapping[0].'@vcs' = 'Git'
|
2010-10-10 16:06:06 -04:00
|
|
|
}
|
2010-10-08 21:20:10 -04:00
|
|
|
}
|
|
|
|
|
2010-10-11 10:30:26 -04:00
|
|
|
ideaModule {
|
|
|
|
}
|
|
|
|
|
2010-10-08 21:20:10 -04:00
|
|
|
// 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
|
2010-12-02 00:17:23 -05:00
|
|
|
h2: 'com.h2database:h2:1.2.145',
|
2010-10-08 21:20:10 -04:00
|
|
|
|
|
|
|
// 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
|
2011-02-16 17:14:27 -05:00
|
|
|
logging: 'org.jboss.logging:jboss-logging:3.0.0.Beta5',
|
|
|
|
logging_tools: 'org.jboss.logging:jboss-logging-tools:1.0.0.Beta4',
|
2010-10-08 21:20:10 -04:00
|
|
|
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
|
2011-03-03 15:16:58 -05:00
|
|
|
atomikos: 'com.atomikos:transactions-jdbc:3.7.0',
|
2011-03-12 13:19:56 -05:00
|
|
|
junit: 'junit:junit:4.8.2',
|
2010-10-08 21:20:10 -04:00
|
|
|
testng: 'org.testng:testng:5.8:jdk15',
|
2011-03-06 09:46:57 -05:00
|
|
|
jpa_modelgen: 'org.hibernate:hibernate-jpamodelgen:1.1.1.Final',
|
2010-10-08 21:20:10 -04:00
|
|
|
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 ->
|
2010-10-10 16:06:06 -04:00
|
|
|
apply plugin: 'idea'
|
2010-10-12 04:30:02 -04:00
|
|
|
apply plugin: 'eclipse'
|
2010-10-12 16:39:33 -04:00
|
|
|
|
|
|
|
defaultTasks 'build'
|
2010-10-10 16:06:06 -04:00
|
|
|
|
2010-10-08 21:20:10 -04:00
|
|
|
group = 'org.hibernate'
|
2011-03-09 19:40:41 -05:00
|
|
|
version = '4.0.0-SNAPSHOT'
|
2010-10-08 21:20:10 -04:00
|
|
|
|
|
|
|
// minimize changes, at least for now (gradle uses 'build' by default)..
|
2010-10-10 16:06:06 -04:00
|
|
|
buildDir = "target"
|
2010-10-12 16:39:33 -04:00
|
|
|
|
|
|
|
if ( ! subProject.name.startsWith( 'release' ) ) {
|
2010-10-09 14:24:27 -04:00
|
|
|
apply plugin: 'java'
|
2010-10-08 21:20:10 -04:00
|
|
|
apply plugin: 'maven' // for install task as well as deploy dependencies
|
2011-02-07 19:20:50 -05:00
|
|
|
apply plugin: org.hibernate.build.gradle.upload.UploadAuthenticationManager
|
2010-10-08 21:20:10 -04:00
|
|
|
|
|
|
|
configurations {
|
|
|
|
provided {
|
|
|
|
// todo : need to make sure these are non-exported
|
|
|
|
description = 'Non-exported compile-time dependencies.'
|
|
|
|
}
|
2011-03-09 14:15:47 -05:00
|
|
|
jbossLoggingTool {
|
|
|
|
description = "Dependencies for running the JBoss logging AnnotationProcessor tool"
|
|
|
|
}
|
|
|
|
hibernateJpaModelGenTool {
|
|
|
|
description = "Dependencies for running the Hibernate JPA Metamodel Generator AnnotationProcessor tool"
|
|
|
|
}
|
2010-10-10 09:17:52 -04:00
|
|
|
deployerJars {
|
|
|
|
description = 'Jars needed for doing deployment to JBoss Nexus repo'
|
|
|
|
}
|
2010-10-08 21:20:10 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// appropriately inject the common dependencies into each sub-project
|
|
|
|
dependencies {
|
2011-02-16 17:14:27 -05:00
|
|
|
compile( libraries.logging )
|
2010-10-08 21:20:10 -04:00
|
|
|
compile( libraries.slf4j_api )
|
|
|
|
testCompile( libraries.junit )
|
2011-03-02 16:57:28 -05:00
|
|
|
testCompile( libraries.atomikos )
|
2010-10-08 21:20:10 -04:00
|
|
|
testRuntime( libraries.slf4j_simple )
|
|
|
|
testRuntime( libraries.jcl_slf4j )
|
|
|
|
testRuntime( libraries.jcl_api )
|
|
|
|
testRuntime( libraries.jcl )
|
2010-10-09 14:44:08 -04:00
|
|
|
testRuntime( libraries.javassist )
|
2010-10-08 21:20:10 -04:00
|
|
|
testRuntime( libraries.h2 )
|
2011-03-09 14:15:47 -05:00
|
|
|
jbossLoggingTool( libraries.logging_tools )
|
|
|
|
hibernateJpaModelGenTool( libraries.jpa_modelgen )
|
2010-10-10 09:17:52 -04:00
|
|
|
deployerJars "org.apache.maven.wagon:wagon-http:1.0-beta-6"
|
2010-10-08 21:20:10 -04:00
|
|
|
}
|
2011-02-09 14:05:57 -05:00
|
|
|
|
2011-03-09 16:29:16 -05:00
|
|
|
aptDumpDir = file( buildDirName + "/temp/apt" )
|
|
|
|
|
|
|
|
sourceSets.main {
|
|
|
|
compileClasspath += configurations.provided
|
2010-10-08 21:20:10 -04:00
|
|
|
}
|
|
|
|
|
2011-03-09 16:29:16 -05:00
|
|
|
sourceSets.all {
|
|
|
|
originalJavaSrcDirs = java.srcDirs
|
|
|
|
generatedLoggingSrcDir = file( "${buildDir}/generated-src/logging/${name}" )
|
|
|
|
java.srcDir generatedLoggingSrcDir
|
|
|
|
}
|
2011-03-09 14:15:47 -05:00
|
|
|
|
2011-03-09 16:29:16 -05:00
|
|
|
task generateMainLoggingClasses(type: Compile) {
|
2011-03-09 14:15:47 -05:00
|
|
|
classpath = compileJava.classpath + configurations.jbossLoggingTool
|
2011-03-09 16:29:16 -05:00
|
|
|
source = sourceSets.main.originalJavaSrcDirs
|
|
|
|
destinationDir = aptDumpDir
|
2011-03-09 14:15:47 -05:00
|
|
|
options.define(
|
|
|
|
compilerArgs: [
|
|
|
|
"-nowarn",
|
|
|
|
"-proc:only",
|
|
|
|
"-processor", "org.jboss.logging.LoggingToolsProcessor",
|
2011-03-09 16:29:16 -05:00
|
|
|
"-s", "$sourceSets.main.generatedLoggingSrcDir.absolutePath"
|
2011-03-09 14:15:47 -05:00
|
|
|
]
|
2011-03-09 16:29:16 -05:00
|
|
|
);
|
|
|
|
outputs.dir sourceSets.main.generatedLoggingSrcDir;
|
|
|
|
doFirst {
|
|
|
|
sourceSets.main.generatedLoggingSrcDir.mkdirs()
|
|
|
|
}
|
2011-03-09 14:15:47 -05:00
|
|
|
}
|
|
|
|
|
2011-03-09 16:29:16 -05:00
|
|
|
// for the time being eat the annoying output from running the annotation processors
|
|
|
|
generateMainLoggingClasses.logging.captureStandardError(LogLevel.INFO)
|
|
|
|
|
2011-03-09 14:15:47 -05:00
|
|
|
compileJava.dependsOn generateMainLoggingClasses
|
|
|
|
compileJava.options.define(compilerArgs: ["-proc:none"])
|
|
|
|
|
|
|
|
|
2011-03-09 16:29:16 -05:00
|
|
|
task generateTestLoggingClasses(type: Compile) {
|
2011-03-09 14:15:47 -05:00
|
|
|
classpath = compileTestJava.classpath + configurations.jbossLoggingTool
|
2011-03-09 16:29:16 -05:00
|
|
|
source = sourceSets.test.originalJavaSrcDirs
|
|
|
|
destinationDir = aptDumpDir
|
2011-03-09 14:15:47 -05:00
|
|
|
options.define(
|
|
|
|
compilerArgs: [
|
|
|
|
"-nowarn",
|
|
|
|
"-proc:only",
|
|
|
|
"-processor", "org.jboss.logging.LoggingToolsProcessor",
|
2011-03-09 16:29:16 -05:00
|
|
|
"-s", "$sourceSets.test.generatedLoggingSrcDir.absolutePath"
|
2011-03-09 14:15:47 -05:00
|
|
|
]
|
2011-03-09 16:29:16 -05:00
|
|
|
);
|
|
|
|
outputs.dir sourceSets.test.generatedLoggingSrcDir;
|
|
|
|
doFirst {
|
|
|
|
sourceSets.test.generatedLoggingSrcDir.mkdirs()
|
|
|
|
}
|
2011-03-09 14:15:47 -05:00
|
|
|
}
|
|
|
|
|
2011-03-09 16:29:16 -05:00
|
|
|
// for the time being eat the annoying output from running the annotation processors
|
|
|
|
generateTestLoggingClasses.logging.captureStandardError(LogLevel.INFO)
|
|
|
|
|
2011-03-09 14:15:47 -05:00
|
|
|
compileTestJava.dependsOn generateTestLoggingClasses
|
|
|
|
compileTestJava.options.define(compilerArgs: ["-proc:none"])
|
|
|
|
|
|
|
|
|
2010-10-08 21:20:10 -04:00
|
|
|
manifest.mainAttributes(
|
|
|
|
provider: 'gradle',
|
|
|
|
'Implementation-Url': 'http://hibernate.org',
|
|
|
|
'Implementation-Version': version,
|
|
|
|
'Implementation-Vendor': 'Hibernate.org',
|
|
|
|
'Implementation-Vendor-Id': 'org.hibernate'
|
|
|
|
)
|
|
|
|
|
|
|
|
test {
|
2010-10-10 09:17:52 -04:00
|
|
|
systemProperties['hibernate.test.validatefailureexpected'] = true
|
2010-10-08 21:20:10 -04:00
|
|
|
maxHeapSize = "1024m"
|
|
|
|
}
|
|
|
|
|
2010-10-10 09:17:52 -04:00
|
|
|
processTestResources.doLast( {
|
|
|
|
copy {
|
|
|
|
from( sourceSets.test.java.srcDirs ) {
|
|
|
|
include '**/*.properties'
|
|
|
|
include '**/*.xml'
|
2010-10-08 21:20:10 -04:00
|
|
|
}
|
2010-10-10 09:17:52 -04:00
|
|
|
into sourceSets.test.classesDir
|
|
|
|
}
|
|
|
|
} )
|
2010-10-08 21:20:10 -04:00
|
|
|
|
|
|
|
assemble.doLast( { install } )
|
|
|
|
uploadArchives.dependsOn install
|
|
|
|
|
|
|
|
targetCompatibility = "1.6"
|
|
|
|
sourceCompatibility = "1.6"
|
|
|
|
|
|
|
|
ideaModule {
|
2011-03-02 16:57:28 -05:00
|
|
|
// treat our "provided" configuration dependencies as "compile" scope dependencies in IntelliJ
|
2010-10-10 16:06:06 -04:00
|
|
|
scopes.COMPILE.plus.add( configurations.provided )
|
2010-10-08 21:20:10 -04:00
|
|
|
whenConfigured { module ->
|
|
|
|
module.dependencies*.exported = true
|
|
|
|
}
|
2011-03-09 14:15:47 -05:00
|
|
|
// testSourceDirs.add( file( generatedSrcDirName ) )
|
|
|
|
// testSourceDirs.add( file( generatedTestSrcDirName ) )
|
2010-10-08 21:20:10 -04:00
|
|
|
}
|
2010-10-12 04:30:02 -04:00
|
|
|
eclipseClasspath {
|
|
|
|
plusConfigurations.add( configurations.provided )
|
|
|
|
}
|
2010-10-10 09:17:52 -04:00
|
|
|
|
|
|
|
// elements used to customize the generated POM used during upload
|
|
|
|
def pomConfig = {
|
|
|
|
url 'http://hibernate.org'
|
2010-10-10 16:06:06 -04:00
|
|
|
organization {
|
|
|
|
name 'Hibernate.org'
|
|
|
|
url 'http://hibernate.org'
|
|
|
|
}
|
2010-10-10 09:17:52 -04:00
|
|
|
issueManagement {
|
|
|
|
system 'jira'
|
|
|
|
url 'http://opensource.atlassian.com/projects/hibernate/browse/HHH'
|
|
|
|
}
|
|
|
|
scm {
|
|
|
|
url "http://github.com/hibernate/hibernate-core"
|
|
|
|
connection "scm:git:http://github.com/hibernate/hibernate-core.git"
|
|
|
|
developerConnection "scm:git:git@github.com:hibernate/hibernate-core.git"
|
|
|
|
}
|
|
|
|
licenses {
|
|
|
|
license {
|
|
|
|
name 'GNU Lesser General Public License'
|
|
|
|
url 'http://www.gnu.org/licenses/lgpl-2.1.html'
|
2011-03-09 06:50:31 -05:00
|
|
|
comments 'See discussion at http://hibernate.org/license for more details.'
|
2010-10-10 09:17:52 -04:00
|
|
|
distribution 'repo'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
developers {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-02-10 10:45:28 -05:00
|
|
|
subProject.basePomConfig = pomConfig
|
|
|
|
|
2010-10-10 09:17:52 -04:00
|
|
|
configure(install.repositories.mavenInstaller) {
|
|
|
|
pom.project pomConfig
|
|
|
|
}
|
|
|
|
|
|
|
|
uploadArchives {
|
|
|
|
repositories.mavenDeployer {
|
|
|
|
name = 'jbossDeployer'
|
|
|
|
configuration = configurations.deployerJars
|
|
|
|
pom.project pomConfig
|
2011-02-10 10:45:28 -05:00
|
|
|
repository(id: "jboss-releases-repository", url: "https://repository.jboss.org/nexus/service/local/staging/deploy/maven2/")
|
|
|
|
snapshotRepository(id: "jboss-snapshots-repository", url: "https://repository.jboss.org/nexus/content/repositories/snapshots")
|
2010-10-10 09:17:52 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-10-11 10:30:26 -04:00
|
|
|
task sourcesJar(type: Jar, dependsOn: compileJava) {
|
|
|
|
from sourceSets.main.allSource
|
|
|
|
classifier = 'sources'
|
|
|
|
}
|
|
|
|
|
|
|
|
artifacts {
|
|
|
|
archives sourcesJar
|
|
|
|
}
|
|
|
|
|
|
|
|
uploadArchives.dependsOn sourcesJar
|
2010-10-08 21:20:10 -04:00
|
|
|
}
|
2010-10-10 09:17:52 -04:00
|
|
|
|
2010-10-08 21:20:10 -04:00
|
|
|
}
|
|
|
|
|
2010-10-11 08:47:31 -04:00
|
|
|
dependsOnChildren()
|
|
|
|
|
|
|
|
// This is a task that generates the gradlew scripts, allowing users to run gradle without having gradle installed
|
|
|
|
// on their system.
|
|
|
|
// This task should be run by "build master" and the resulting ouput committed to source control. Its outputs include:
|
|
|
|
// 1) /gradlew which is the *NIX shell script for executing builds
|
|
|
|
// 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) {
|
2011-02-08 12:19:50 -05:00
|
|
|
gradleVersion = '0.9.2'
|
2010-10-12 16:20:06 -04:00
|
|
|
}
|