2010-10-08 21:20:10 -04:00
|
|
|
apply plugin: 'eclipse'
|
|
|
|
apply plugin: 'idea'
|
2012-08-08 05:53:17 -04:00
|
|
|
apply from: "./libraries.gradle"
|
2010-10-08 21:20:10 -04:00
|
|
|
allprojects {
|
|
|
|
repositories {
|
2012-08-08 05:53:17 -04:00
|
|
|
mavenCentral()
|
|
|
|
mavenLocal()
|
|
|
|
mavenRepo name: 'jboss-nexus', url: "http://repository.jboss.org/nexus/content/groups/public/"
|
2012-02-15 17:31:29 -05:00
|
|
|
mavenRepo name: "jboss-snapshots", url: "http://snapshots.jboss.org/maven2/"
|
2010-10-08 21:20:10 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-03-22 09:29:49 -04:00
|
|
|
buildscript {
|
|
|
|
repositories {
|
2012-08-08 05:53:17 -04:00
|
|
|
mavenCentral()
|
|
|
|
mavenLocal()
|
|
|
|
mavenRepo name: 'jboss-nexus', url: "http://repository.jboss.org/nexus/content/groups/public/"
|
2012-02-15 17:31:29 -05:00
|
|
|
mavenRepo name: "jboss-snapshots", url: "http://snapshots.jboss.org/maven2/"
|
2011-03-22 09:29:49 -04:00
|
|
|
}
|
|
|
|
dependencies {
|
2012-02-20 03:45:48 -05:00
|
|
|
classpath 'org.hibernate.build.gradle:gradle-upload-auth-plugin:1.1.1'
|
2011-03-22 09:29:49 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-02-15 17:31:29 -05:00
|
|
|
idea {
|
2012-02-16 21:52:26 -05:00
|
|
|
project {
|
2012-08-08 05:53:17 -04:00
|
|
|
languageLevel = "1.6"
|
2012-02-16 21:52:26 -05:00
|
|
|
ipr {
|
|
|
|
withXml { provider ->
|
|
|
|
provider.node.component.find { it.@name == 'VcsDirectoryMappings' }.mapping.@vcs = 'Git'
|
|
|
|
def maxHeapSizeConfig = provider.node.component.find { it.@name == 'JavacSettings' }
|
|
|
|
if( maxHeapSizeConfig == null ){
|
|
|
|
def javacSettingsNode = provider.node.appendNode('component',[name: 'JavacSettings'])
|
|
|
|
javacSettingsNode.appendNode('option', [name:"MAXIMUM_HEAP_SIZE", value:"512"])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
beforeMerged { project ->
|
|
|
|
project.modulePaths.clear()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
module {
|
|
|
|
name = "hibernate-orm"
|
|
|
|
}
|
2010-10-11 10:30:26 -04:00
|
|
|
}
|
|
|
|
|
2010-10-08 21:20:10 -04:00
|
|
|
subprojects { subProject ->
|
2010-10-10 16:06:06 -04:00
|
|
|
apply plugin: 'idea'
|
2012-02-16 21:52:26 -05: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'
|
2015-01-28 22:50:26 -05:00
|
|
|
version = '4.2.19-SNAPSHOT'
|
2013-06-07 14:29:35 -04:00
|
|
|
|
|
|
|
// The OSGi manifest exported package versions need to be only the numerical release -- no "SNAPSHOT" or "Final"
|
|
|
|
exportPackageVersion = version.replaceAll("-SNAPSHOT", "");
|
|
|
|
exportPackageVersion = exportPackageVersion.replaceAll(".Final", "");
|
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'
|
2013-02-08 19:02:11 -05:00
|
|
|
apply plugin: 'osgi'
|
|
|
|
apply from: "../utilities.gradle"
|
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)'
|
|
|
|
}
|
2012-03-13 04:12:46 -04:00
|
|
|
configurations {
|
|
|
|
all*.exclude group: 'xml-apis', module: 'xml-apis'
|
|
|
|
}
|
|
|
|
|
2010-10-08 21:20:10 -04:00
|
|
|
}
|
2012-08-08 05:53:17 -04:00
|
|
|
|
|
|
|
ext.toolsJar = file("${System.getProperty('java.home')}/../lib/tools.jar")
|
2010-10-08 21:20:10 -04:00
|
|
|
// appropriately inject the common dependencies into each sub-project
|
|
|
|
dependencies {
|
2012-02-16 21:52:26 -05:00
|
|
|
compile( libraries.logging )
|
2010-10-08 21:20:10 -04:00
|
|
|
testCompile( libraries.junit )
|
2012-03-16 06:00:44 -04:00
|
|
|
testCompile( libraries.byteman )
|
|
|
|
testCompile( libraries.byteman_install )
|
|
|
|
testCompile( libraries.byteman_bmunit )
|
2012-08-08 05:53:17 -04:00
|
|
|
|
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 )
|
2012-08-08 05:53:17 -04:00
|
|
|
jaxb( libraries.jaxb ){exclude group: "javax.xml.stream"}
|
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
|
|
|
}
|
2012-08-08 05:53:17 -04:00
|
|
|
if(ext.toolsJar.exists()){
|
|
|
|
dependencies{
|
|
|
|
testCompile files( toolsJar )
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ext.aptDumpDir = file( "${buildDir}/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 {
|
2012-08-08 05:53:17 -04:00
|
|
|
ext.originalJavaSrcDirs = java.srcDirs
|
|
|
|
ext.generatedLoggingSrcDir = file( "${buildDir}/generated-src/logging/${name}" )
|
2011-03-09 16:29:16 -05:00
|
|
|
java.srcDir generatedLoggingSrcDir
|
|
|
|
}
|
2011-03-09 14:15:47 -05:00
|
|
|
|
2013-11-21 11:57:30 -05:00
|
|
|
task generateMainLoggingClasses(type: JavaCompile) {
|
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",
|
2012-02-14 02:58:01 -05:00
|
|
|
"-processor", "org.jboss.logging.processor.apt.LoggingToolsProcessor",
|
2011-11-10 13:42:57 -05:00
|
|
|
"-s", "$sourceSets.main.generatedLoggingSrcDir.absolutePath",
|
2012-03-13 04:12:46 -04:00
|
|
|
"-AloggingVersion=3.0",
|
|
|
|
"-source", "1.6",
|
|
|
|
"-target", "1.6",
|
|
|
|
"-AtranslationFilesPath=${project.rootDir}/src/main/resources"
|
|
|
|
|
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)
|
|
|
|
|
2013-04-09 13:39:09 -04:00
|
|
|
task generateSources( type: Task )
|
|
|
|
generateSources.dependsOn generateMainLoggingClasses
|
|
|
|
|
2012-02-16 21:52:26 -05:00
|
|
|
compileJava.dependsOn generateMainLoggingClasses
|
2011-05-16 19:17:39 -04:00
|
|
|
compileJava.options.define(compilerArgs: ["-proc:none", "-encoding", "UTF-8"])
|
2012-02-16 21:52:26 -05:00
|
|
|
compileTestJava.options.define(compilerArgs: ["-proc:none", "-encoding", "UTF-8"])
|
2011-03-09 14:15:47 -05:00
|
|
|
|
2013-02-08 19:02:11 -05:00
|
|
|
jar {
|
|
|
|
Set<String> exportPackages = new HashSet<String>()
|
|
|
|
Set<String> privatePackages = new HashSet<String>()
|
|
|
|
|
|
|
|
// TODO: Could more of this be pulled into utilities.gradle?
|
|
|
|
sourceSets.each { SourceSet sourceSet ->
|
|
|
|
// skip certain source sets
|
|
|
|
if ( ! ['test','matrix'].contains( sourceSet.name ) ) {
|
|
|
|
sourceSet.java.each { javaFile ->
|
|
|
|
// - .util for external module use (especially envers)
|
|
|
|
final String[] temporaryExports = [
|
|
|
|
'org.hibernate.internal.util' ]
|
|
|
|
|
|
|
|
final String packageName = determinePackageName( sourceSet.java, javaFile );
|
|
|
|
if ( ! temporaryExports.contains( packageName )
|
|
|
|
&& ( packageName.endsWith( ".internal" )
|
|
|
|
|| packageName.contains( ".internal." )
|
|
|
|
|| packageName.endsWith( ".test" )
|
|
|
|
|| packageName.contains( ".test." ) ) ) {
|
|
|
|
privatePackages.add( packageName );
|
|
|
|
}
|
|
|
|
else {
|
2013-06-07 14:29:35 -04:00
|
|
|
exportPackages.add( packageName + ";version=\"" + exportPackageVersion + "\"" );
|
2013-02-08 19:02:11 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
manifest = osgiManifest {
|
|
|
|
// GRADLE-1411: Even if we override Imports and Exports
|
|
|
|
// auto-generation with instructions, classesDir and classpath
|
|
|
|
// need to be here (temporarily).
|
|
|
|
classesDir = sourceSets.main.output.classesDir
|
|
|
|
classpath = configurations.runtime
|
|
|
|
|
|
|
|
instruction 'Export-Package', exportPackages.toArray(new String[0])
|
|
|
|
instruction 'Private-Package', privatePackages.toArray(new String[0])
|
|
|
|
instruction 'Bundle-Vendor', 'Hibernate.org'
|
|
|
|
|
|
|
|
instruction 'Implementation-Url', 'http://hibernate.org'
|
|
|
|
instruction 'Implementation-Version', version
|
|
|
|
instruction 'Implementation-Vendor', 'Hibernate.org'
|
|
|
|
instruction 'Implementation-Vendor-Id', 'org.hibernate'
|
|
|
|
}
|
|
|
|
}
|
2010-10-08 21:20:10 -04:00
|
|
|
|
|
|
|
test {
|
2012-10-31 12:22:33 -04:00
|
|
|
// pass along command line defined system props (-D) to the test
|
|
|
|
// pretty sure I used to have this limited to just certain prefixes, but that is no longer here
|
|
|
|
// and I no longer remember that groovy-magic needed to accomplish that
|
2012-11-01 00:58:49 -04:00
|
|
|
// TODO: Temporarily removing -- was causing issues with
|
|
|
|
// entitymanager tests.
|
|
|
|
//systemProperties = System.properties
|
2012-11-01 01:42:27 -04:00
|
|
|
systemProperties['hibernate.test.validatefailureexpected'] = true
|
|
|
|
maxHeapSize = "1024m"
|
2010-10-08 21:20:10 -04:00
|
|
|
}
|
|
|
|
|
2012-08-08 05:53:17 -04:00
|
|
|
|
|
|
|
|
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
|
|
|
}
|
2012-03-26 03:12:10 -04:00
|
|
|
into sourceSets.test.output.classesDir
|
2010-10-10 09:17:52 -04:00
|
|
|
}
|
|
|
|
} )
|
2010-10-08 21:20:10 -04:00
|
|
|
|
|
|
|
assemble.doLast( { install } )
|
|
|
|
uploadArchives.dependsOn install
|
|
|
|
|
|
|
|
targetCompatibility = "1.6"
|
|
|
|
sourceCompatibility = "1.6"
|
|
|
|
|
2012-02-16 21:52:26 -05:00
|
|
|
idea {
|
|
|
|
module {
|
|
|
|
iml {
|
|
|
|
beforeMerged { module ->
|
|
|
|
module.dependencies.clear()
|
|
|
|
module.excludeFolders.clear()
|
|
|
|
}
|
|
|
|
whenMerged { module ->
|
|
|
|
module.dependencies*.exported = true
|
|
|
|
module.excludeFolders += module.pathFactory.path(file(".gradle"))
|
|
|
|
module.excludeFolders += module.pathFactory.path(file("$buildDir/bundles"))
|
|
|
|
module.excludeFolders += module.pathFactory.path(file("$buildDir/classes"))
|
|
|
|
module.excludeFolders += module.pathFactory.path(file("$buildDir/dependency-cache"))
|
|
|
|
module.excludeFolders += module.pathFactory.path(file("$buildDir/libs"))
|
|
|
|
module.excludeFolders += module.pathFactory.path(file("$buildDir/reports"))
|
|
|
|
module.excludeFolders += module.pathFactory.path(file("$buildDir/test-results"))
|
|
|
|
module.excludeFolders += module.pathFactory.path(file("$buildDir/tmp"))
|
|
|
|
module.excludeFolders += module.pathFactory.path(file("$buildDir/matrix"))
|
2012-02-20 03:36:18 -05:00
|
|
|
module.excludeFolders += module.pathFactory.path(file("$buildDir/resources"))
|
|
|
|
module.excludeFolders -= module.pathFactory.path(file("$buildDir"))
|
2012-02-16 21:52:26 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
downloadSources = true
|
|
|
|
scopes.COMPILE.plus += configurations.provided
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
eclipse {
|
|
|
|
classpath {
|
|
|
|
plusConfigurations.add( configurations.provided )
|
|
|
|
}
|
|
|
|
}
|
2013-04-09 13:39:09 -04:00
|
|
|
// eclipseClasspath will not add sources to classpath unless the dirs actually exist.
|
|
|
|
eclipseClasspath.dependsOn("generateSources")
|
2010-10-10 09:17:52 -04:00
|
|
|
|
|
|
|
// elements used to customize the generated POM used during upload
|
|
|
|
def pomConfig = {
|
2013-11-21 11:57:30 -05:00
|
|
|
name 'A Hibernate O/RM Module'
|
|
|
|
description 'A module of the Hibernate O/RM 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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-08-08 05:53:17 -04:00
|
|
|
subProject.ext.basePomConfig = pomConfig
|
2011-02-10 10:45:28 -05:00
|
|
|
|
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
|
|
|
|
|
|
|
// 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) {
|
2013-11-21 11:57:30 -05:00
|
|
|
gradleVersion = '1.9'
|
2010-10-12 16:20:06 -04:00
|
|
|
}
|