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/"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-03-22 09:29:49 -04:00
|
|
|
buildscript {
|
|
|
|
repositories {
|
2011-06-30 22:34:19 -04:00
|
|
|
mavenCentral()
|
2011-03-22 09:29:49 -04:00
|
|
|
mavenLocal()
|
|
|
|
mavenRepo name: 'jboss-nexus', urls: "https://repository.jboss.org/nexus/content/groups/public/"
|
|
|
|
mavenRepo name: "jboss-snapshots", urls: "http://snapshots.jboss.org/maven2/"
|
|
|
|
}
|
|
|
|
dependencies {
|
2011-05-05 16:41:37 -04:00
|
|
|
classpath 'org.hibernate.build.gradle:gradle-upload-auth-plugin:1.0.2'
|
2011-03-22 09:29:49 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-10-08 21:20:10 -04:00
|
|
|
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'
|
2011-09-25 12:37:40 -04:00
|
|
|
def maxHeapSizeConfig = node.component.find { it.'@name' == 'JavacSettings' }
|
|
|
|
if( maxHeapSizeConfig == null ){
|
|
|
|
def javacSettingsNode = node.appendNode('component',[name: 'JavacSettings'])
|
|
|
|
javacSettingsNode.appendNode('option', [name:"MAXIMUM_HEAP_SIZE", value:"512"])
|
|
|
|
}
|
2010-10-10 16:06:06 -04:00
|
|
|
}
|
2011-04-13 23:33:54 -04:00
|
|
|
beforeConfigured { module ->
|
|
|
|
module.modulePaths.removeAll { it.filePath.endsWith('hibernate-core.iml') }
|
|
|
|
}
|
2010-10-08 21:20:10 -04:00
|
|
|
}
|
|
|
|
|
2010-10-11 10:30:26 -04:00
|
|
|
ideaModule {
|
2011-04-13 23:33:54 -04:00
|
|
|
moduleName = 'hibernate-core-root'
|
2010-10-11 10:30:26 -04:00
|
|
|
}
|
|
|
|
|
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
|
2011-06-13 08:31:52 -04:00
|
|
|
slf4jVersion = '1.6.1'
|
2011-12-30 13:15:23 -05:00
|
|
|
junitVersion = '4.8.2'
|
|
|
|
h2Version = '1.2.145'
|
|
|
|
|
2010-10-08 21:20:10 -04:00
|
|
|
libraries = [
|
|
|
|
// Ant
|
2011-09-14 02:25:12 -04:00
|
|
|
ant: 'org.apache.ant:ant:1.8.2',
|
2010-10-08 21:20:10 -04:00
|
|
|
|
|
|
|
// Antlr
|
|
|
|
antlr: 'antlr:antlr:2.7.7',
|
|
|
|
|
|
|
|
// Annotations
|
|
|
|
commons_annotations:
|
2011-11-29 12:21:13 -05:00
|
|
|
'org.hibernate.common:hibernate-commons-annotations:4.0.1.Final',
|
2011-09-06 02:29:38 -04:00
|
|
|
jandex: 'org.jboss:jandex:1.0.3.Final',
|
2011-08-04 11:26:12 -04:00
|
|
|
classmate: 'com.fasterxml:classmate:0.5.4',
|
2010-10-08 21:20:10 -04:00
|
|
|
|
|
|
|
// Jakarta commons-collections todo : get rid of commons-collections dependency
|
|
|
|
commons_collections:
|
2011-09-25 12:29:13 -04:00
|
|
|
'commons-collections:commons-collections:3.2.1',
|
2010-10-08 21:20:10 -04:00
|
|
|
// Dom4J
|
|
|
|
dom4j: 'dom4j:dom4j:1.6.1@jar',
|
|
|
|
|
|
|
|
// Javassist
|
2011-12-15 11:56:28 -05:00
|
|
|
javassist: 'org.javassist:javassist:3.15.0-GA',
|
2010-10-08 21:20:10 -04:00
|
|
|
|
|
|
|
// javax
|
2011-06-14 22:54:40 -04:00
|
|
|
jpa: 'org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.1.Final',
|
2011-09-25 12:29:13 -04:00
|
|
|
jta: 'org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:1.0.0.Final',
|
2010-10-08 21:20:10 -04:00
|
|
|
validation: 'javax.validation:validation-api:1.0.0.GA',
|
2011-09-13 04:46:38 -04:00
|
|
|
jacc: 'org.jboss.spec.javax.security.jacc:jboss-jacc-api_1.4_spec:1.0.0.Final',
|
2010-10-08 21:20:10 -04:00
|
|
|
|
|
|
|
// logging
|
2011-11-26 03:29:01 -05:00
|
|
|
logging: 'org.jboss.logging:jboss-logging:3.1.0.CR2',
|
2011-11-16 02:22:17 -05:00
|
|
|
logging_processor: 'org.jboss.logging:jboss-logging-processor:1.0.0.CR5',
|
2011-11-14 04:38:30 -05:00
|
|
|
|
|
|
|
// 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
|
2010-10-08 21:20:10 -04:00
|
|
|
slf4j_api: 'org.slf4j:slf4j-api:' + slf4jVersion,
|
2011-04-06 12:32:57 -04:00
|
|
|
slf4j_log4j12: 'org.slf4j:slf4j-log4j12:' + slf4jVersion,
|
2010-10-08 21:20:10 -04:00
|
|
|
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',
|
|
|
|
|
2011-11-14 04:38:30 -05:00
|
|
|
|
2011-12-30 13:15:23 -05:00
|
|
|
junit: 'junit:junit:' + junitVersion,
|
2012-03-07 09:29:20 -05:00
|
|
|
jpa_modelgen: 'org.hibernate:hibernate-jpamodelgen:1.2.0.Final',
|
2011-09-25 12:29:13 -04:00
|
|
|
shrinkwrap_api: 'org.jboss.shrinkwrap:shrinkwrap-api:1.0.0-beta-6',
|
2011-11-14 04:38:30 -05:00
|
|
|
shrinkwrap: 'org.jboss.shrinkwrap:shrinkwrap-impl-base:1.0.0-beta-6',
|
2012-03-07 09:29:20 -05:00
|
|
|
validator: 'org.hibernate:hibernate-validator:4.3.0.Alpha1',
|
2011-12-30 13:15:23 -05:00
|
|
|
h2: 'com.h2database:h2:' + h2Version,
|
2010-10-08 21:20:10 -04:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
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'
|
2012-01-11 15:05:37 -05:00
|
|
|
version = '4.1.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"
|
2011-03-22 11:39:53 -04:00
|
|
|
if ( ! subProject.name.startsWith( 'release' ) && ! subProject.name.startsWith( 'documentation' ) ) {
|
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-03-22 09:29:49 -04:00
|
|
|
apply plugin: 'uploadAuth'
|
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'
|
|
|
|
}
|
2011-03-29 07:58:17 -04:00
|
|
|
jaxb {
|
|
|
|
description = 'Dependencies for running ant xjc (jaxb class generation)'
|
|
|
|
}
|
2010-10-08 21:20:10 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// appropriately inject the common dependencies into each sub-project
|
|
|
|
dependencies {
|
2011-04-11 12:51:41 -04:00
|
|
|
compile( libraries.logging )
|
2010-10-08 21:20:10 -04:00
|
|
|
testCompile( libraries.junit )
|
2011-03-24 14:12:51 -04:00
|
|
|
testRuntime( libraries.slf4j_api )
|
2011-04-06 12:32:57 -04:00
|
|
|
testRuntime( libraries.slf4j_log4j12 )
|
2010-10-08 21:20:10 -04:00
|
|
|
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-09-14 22:09:03 -04:00
|
|
|
jbossLoggingTool( libraries.logging_processor )
|
2011-03-09 14:15:47 -05:00
|
|
|
hibernateJpaModelGenTool( libraries.jpa_modelgen )
|
2011-03-29 07:58:17 -04:00
|
|
|
jaxb( libraries.jaxb )
|
2011-07-06 05:44:58 -04:00
|
|
|
jaxb( libraries.jaxb2_basics )
|
|
|
|
jaxb( libraries.jaxb2_ant )
|
2011-09-15 10:07:00 -04:00
|
|
|
deployerJars "org.apache.maven.wagon:wagon-http:1.0"
|
2010-10-08 21:20:10 -04:00
|
|
|
}
|
2011-02-09 14:05:57 -05:00
|
|
|
|
2011-04-13 23:33:54 -04:00
|
|
|
aptDumpDir = file( buildDirName + "/tmp/apt" )
|
2011-03-09 16:29:16 -05:00
|
|
|
|
|
|
|
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-11-01 02:53:31 -04:00
|
|
|
classpath = compileJava.classpath + configurations.jbossLoggingTool
|
|
|
|
source = sourceSets.main.originalJavaSrcDirs
|
2011-03-09 16:29:16 -05:00
|
|
|
destinationDir = aptDumpDir
|
2011-11-01 02:53:31 -04:00
|
|
|
options.define(
|
2011-03-09 14:15:47 -05:00
|
|
|
compilerArgs: [
|
|
|
|
"-nowarn",
|
|
|
|
"-proc:only",
|
2011-11-01 02:53:31 -04:00
|
|
|
"-encoding", "UTF-8",
|
|
|
|
"-processor", "org.jboss.logging.generator.apt.LoggingToolsProcessor",
|
2011-11-10 13:42:57 -05:00
|
|
|
"-s", "$sourceSets.main.generatedLoggingSrcDir.absolutePath",
|
|
|
|
"-AloggingVersion=3.0"
|
2011-03-09 14:15:47 -05:00
|
|
|
]
|
2011-03-09 16:29:16 -05:00
|
|
|
);
|
|
|
|
outputs.dir sourceSets.main.generatedLoggingSrcDir;
|
|
|
|
doFirst {
|
2011-11-01 02:53:31 -04:00
|
|
|
source = sourceSets.main.originalJavaSrcDirs
|
2011-03-09 16:29:16 -05:00
|
|
|
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
|
2011-05-16 19:17:39 -04:00
|
|
|
compileJava.options.define(compilerArgs: ["-proc:none", "-encoding", "UTF-8"])
|
2011-11-20 21:16:30 -05:00
|
|
|
compileTestJava.options.define(compilerArgs: ["-proc:none", "-encoding", "UTF-8"])
|
2011-03-09 14:15:47 -05:00
|
|
|
|
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'
|
|
|
|
)
|
|
|
|
|
2012-05-16 12:59:22 -04:00
|
|
|
tasks.withType(Test) {
|
|
|
|
System.getProperties().each { Map.Entry entry ->
|
|
|
|
if ( entry.key.startsWith( 'hibernate.') ) {
|
|
|
|
systemProperty entry.key, entry.value
|
|
|
|
}
|
|
|
|
}
|
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-04-11 16:41:11 -04:00
|
|
|
beforeConfigured { module ->
|
|
|
|
module.excludeFolders.clear()
|
|
|
|
}
|
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-04-13 23:33:54 -04:00
|
|
|
excludeDirs = [
|
|
|
|
file(".gradle"),
|
|
|
|
file("$buildDir/classes"),
|
|
|
|
file("$buildDir/dependency-cache"),
|
|
|
|
file("$buildDir/libs"),
|
|
|
|
file("$buildDir/reports"),
|
|
|
|
file("$buildDir/test-results"),
|
2011-08-30 02:06:13 -04:00
|
|
|
file("$buildDir/tmp"),
|
|
|
|
file("$buildDir/matrix")
|
2011-04-13 23:33:54 -04:00
|
|
|
] as Set
|
2010-10-08 21:20:10 -04:00
|
|
|
}
|
2011-04-13 23:33:54 -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 = {
|
2011-06-08 23:39:07 -04:00
|
|
|
name 'A Hibernate Core Module'
|
2011-06-08 23:43:35 -04:00
|
|
|
description 'A module of the Hibernate Core project'
|
2010-10-10 09:17:52 -04:00
|
|
|
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-06-08 23:39:07 -04:00
|
|
|
developer {
|
|
|
|
id 'hibernate-team'
|
|
|
|
name 'The Hibernate Development Team'
|
|
|
|
organization 'Hibernate.org'
|
|
|
|
organizationUrl 'http://hibernate.org'
|
|
|
|
}
|
2010-10-10 09:17:52 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2011-06-22 12:24:06 -04:00
|
|
|
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.
|
2011-04-13 23:33:54 -04:00
|
|
|
// This task should be run by "build master" and the resulting output committed to source control. Its outputs include:
|
2010-10-11 08:47:31 -04:00
|
|
|
// 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-04-13 23:33:54 -04:00
|
|
|
// HHH-6106 - this is needed for IntellJ generation until 1.0-milestone-3 is released.
|
2011-08-31 14:42:28 -04:00
|
|
|
gradleVersion = '1.0-milestone-3'
|
2010-10-12 16:20:06 -04:00
|
|
|
}
|