2010-10-08 21:20:10 -04:00
|
|
|
apply plugin: 'eclipse'
|
|
|
|
apply plugin: 'idea'
|
2012-08-08 05:09:11 -04:00
|
|
|
apply from: "./libraries.gradle"
|
2012-08-22 14:41:16 -04:00
|
|
|
|
2010-10-08 21:20:10 -04:00
|
|
|
allprojects {
|
|
|
|
repositories {
|
2013-04-05 15:30:56 -04:00
|
|
|
mavenCentral()
|
|
|
|
mavenLocal()
|
|
|
|
|
2013-11-21 14:46:03 -05:00
|
|
|
maven {
|
|
|
|
name 'jboss-nexus'
|
|
|
|
url "http://repository.jboss.org/nexus/content/groups/public/"
|
|
|
|
}
|
|
|
|
maven {
|
|
|
|
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 {
|
2013-04-05 15:30:56 -04:00
|
|
|
mavenCentral()
|
|
|
|
mavenLocal()
|
|
|
|
|
2013-11-21 14:46:03 -05:00
|
|
|
maven {
|
|
|
|
name 'jboss-nexus'
|
|
|
|
url "http://repository.jboss.org/nexus/content/groups/public/"
|
|
|
|
}
|
|
|
|
maven {
|
|
|
|
name "jboss-snapshots"
|
|
|
|
url "http://snapshots.jboss.org/maven2/"
|
|
|
|
}
|
2011-03-22 09:29:49 -04:00
|
|
|
}
|
|
|
|
dependencies {
|
2013-04-18 14:40:56 -04:00
|
|
|
classpath 'org.hibernate.build.gradle:gradle-maven-publish-auth:2.0.1'
|
2013-05-10 16:28:03 -04:00
|
|
|
classpath 'org.hibernate.build.gradle:hibernate-matrix-testing:1.0.0-SNAPSHOT'
|
2013-09-12 12:32:51 -04:00
|
|
|
classpath 'org.hibernate.build.gradle:version-injection-plugin:1.0.0'
|
2011-03-22 09:29:49 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-11-21 14:46:03 -05:00
|
|
|
ext {
|
|
|
|
expectedGradleVersion = '1.9'
|
|
|
|
hibernateTargetVersion = '4.3.0-SNAPSHOT'
|
|
|
|
javaLanguageLevel = '1.6'
|
|
|
|
|
|
|
|
// The OSGi manifest exported package versions need to be only the numerical release -- no "SNAPSHOT" or "Final"
|
|
|
|
// todo : brett - what about Alpha, Beta, CR, SP, etc?
|
|
|
|
osgiExportVersion = hibernateTargetVersion.replaceAll( "-SNAPSHOT", "" ).replaceAll( ".Final", "" );
|
|
|
|
}
|
2012-07-19 09:56:31 -04:00
|
|
|
|
2012-02-15 17:31:29 -05:00
|
|
|
idea {
|
2012-02-16 21:52:26 -05:00
|
|
|
project {
|
2013-04-05 15:38:23 -04:00
|
|
|
languageLevel = javaLanguageLevel
|
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
|
|
|
}
|
|
|
|
|
2013-04-16 19:25:20 -04:00
|
|
|
// Used in POM customization. Each sub-project overrides ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
def pomName() {
|
|
|
|
return "A Hibernate O/RM module"
|
|
|
|
}
|
|
|
|
def pomDescription() {
|
|
|
|
return "A module of the Hibernate O/RM project"
|
|
|
|
}
|
|
|
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
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'
|
2012-07-19 09:56:31 -04:00
|
|
|
version = rootProject.hibernateTargetVersion
|
2013-11-21 14:46:03 -05:00
|
|
|
ext.exportPackageVersion = rootProject.osgiExportVersion
|
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'
|
2013-04-16 19:25:20 -04:00
|
|
|
apply plugin: 'maven-publish'
|
|
|
|
apply plugin: 'maven-publish-auth'
|
2013-08-27 17:16:53 -04:00
|
|
|
apply plugin: 'maven' // temporary, still needed for install task until bug with publishToMavenLocal task is fixed
|
2013-01-23 18:22:03 -05:00
|
|
|
apply plugin: 'osgi'
|
2013-04-08 15:27:47 -04:00
|
|
|
|
2013-10-25 15:27:45 -04:00
|
|
|
apply from: "${rootProject.projectDir}/utilities.gradle"
|
2010-10-08 21:20:10 -04:00
|
|
|
|
2013-04-08 15:27:47 -04:00
|
|
|
apply plugin: 'findbugs'
|
|
|
|
apply plugin: 'checkstyle'
|
|
|
|
apply plugin: 'build-dashboard'
|
|
|
|
apply plugin: 'project-report'
|
|
|
|
|
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"
|
|
|
|
}
|
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'
|
|
|
|
}
|
2013-05-03 06:33:40 -04:00
|
|
|
animalSniffer
|
|
|
|
javaApiSignature
|
2010-10-08 21:20:10 -04:00
|
|
|
}
|
2012-08-08 05:09:11 -04:00
|
|
|
|
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 )
|
2013-09-12 12:32:51 -04:00
|
|
|
compile( libraries.logging_annotations )
|
2013-04-05 15:30:56 -04:00
|
|
|
|
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:09:11 -04:00
|
|
|
|
2013-10-09 13:14:26 -04:00
|
|
|
testRuntime( libraries.log4j )
|
2010-10-09 14:44:08 -04:00
|
|
|
testRuntime( libraries.javassist )
|
2010-10-08 21:20:10 -04:00
|
|
|
testRuntime( libraries.h2 )
|
2013-04-05 15:30:56 -04:00
|
|
|
|
2011-09-14 22:09:03 -04:00
|
|
|
jbossLoggingTool( libraries.logging_processor )
|
2013-04-05 15:30:56 -04:00
|
|
|
|
2012-08-08 05:09:11 -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 )
|
2013-05-03 06:33:40 -04:00
|
|
|
|
|
|
|
animalSniffer ( libraries.animal_sniffer )
|
|
|
|
javaApiSignature ( libraries.java16_signature )
|
2010-10-08 21:20:10 -04:00
|
|
|
}
|
2013-04-04 14:42:17 -04:00
|
|
|
|
2013-04-05 15:30:56 -04:00
|
|
|
// mac-specific stuff ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2013-04-04 14:42:17 -04:00
|
|
|
ext.toolsJar = file("${System.getProperty('java.home')}/../lib/tools.jar")
|
|
|
|
if ( ext.toolsJar.exists() ) {
|
2012-08-08 05:09:11 -04:00
|
|
|
dependencies{
|
|
|
|
testCompile files( toolsJar )
|
|
|
|
}
|
|
|
|
}
|
2013-04-05 15:30:56 -04:00
|
|
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2011-03-09 16:29:16 -05:00
|
|
|
|
2013-04-05 15:38:23 -04:00
|
|
|
targetCompatibility = rootProject.javaLanguageLevel
|
|
|
|
sourceCompatibility = rootProject.javaLanguageLevel
|
|
|
|
|
2013-04-04 14:42:17 -04:00
|
|
|
task compile
|
2013-04-16 19:25:20 -04:00
|
|
|
compile.dependsOn compileJava, processResources, compileTestJava, processTestResources
|
2013-04-04 14:42:17 -04:00
|
|
|
|
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 {
|
2013-11-22 15:51:56 -05:00
|
|
|
ext.aptGeneratedSourceDir = file( "${buildDir}/generated-src/apt/${name}" )
|
2011-03-09 16:29:16 -05:00
|
|
|
}
|
2011-03-09 14:15:47 -05:00
|
|
|
|
2013-11-22 22:20:27 -05:00
|
|
|
ext.standardJavacOptions = [
|
|
|
|
"-nowarn",
|
|
|
|
"-encoding", "UTF-8",
|
|
|
|
"-source", rootProject.javaLanguageLevel,
|
|
|
|
"-target", rootProject.javaLanguageLevel
|
|
|
|
]
|
|
|
|
|
2013-11-22 15:51:56 -05:00
|
|
|
tasks.withType( JavaCompile.class ).all { task->
|
|
|
|
task.options.define(
|
2013-11-22 22:20:27 -05:00
|
|
|
compilerArgs: standardJavacOptions
|
2013-11-22 15:51:56 -05:00
|
|
|
)
|
2011-03-09 14:15:47 -05:00
|
|
|
}
|
|
|
|
|
2013-11-22 22:20:27 -05:00
|
|
|
ext.jbossLoggingToolClass = "org.jboss.logging.processor.apt.LoggingToolsProcessor"
|
|
|
|
|
2013-11-22 15:51:56 -05:00
|
|
|
// alter the compileJava (src/main/java javac task) to add JBoss Logging AP hooks
|
|
|
|
compileJava {
|
|
|
|
classpath += configurations.jbossLoggingTool
|
2011-03-09 16:29:16 -05:00
|
|
|
|
2013-11-22 15:51:56 -05:00
|
|
|
options.compilerArgs += [
|
2013-11-22 22:20:27 -05:00
|
|
|
"-processor", jbossLoggingToolClass,
|
2013-11-22 15:51:56 -05:00
|
|
|
"-s", "$sourceSets.main.aptGeneratedSourceDir.absolutePath",
|
|
|
|
"-Adebug=true",
|
|
|
|
"-AskipTranslations=true",
|
|
|
|
"-AtranslationFilesPath=${project.rootDir}/src/main/resources"
|
|
|
|
]
|
2013-11-22 16:28:28 -05:00
|
|
|
|
|
|
|
doFirst {
|
|
|
|
if ( !sourceSets.main.aptGeneratedSourceDir.exists() ) {
|
|
|
|
sourceSets.main.aptGeneratedSourceDir.mkdirs()
|
|
|
|
}
|
|
|
|
}
|
2013-11-22 15:51:56 -05:00
|
|
|
}
|
2013-04-04 15:30:53 -04:00
|
|
|
|
2013-11-22 16:28:28 -05:00
|
|
|
task generateSources(type: Task)
|
2011-03-09 14:15:47 -05:00
|
|
|
|
2013-01-23 18:22:03 -05:00
|
|
|
jar {
|
|
|
|
Set<String> exportPackages = new HashSet<String>()
|
|
|
|
Set<String> privatePackages = new HashSet<String>()
|
2013-04-08 15:27:47 -04:00
|
|
|
|
2013-01-23 18:22:03 -05:00
|
|
|
// TODO: Could more of this be pulled into utilities.gradle?
|
2013-04-05 15:40:43 -04:00
|
|
|
sourceSets.each { sourceSet ->
|
2013-04-08 15:27:47 -04:00
|
|
|
// skip certain source sets
|
|
|
|
if ( ! ['test','matrix'].contains( sourceSet.name ) ) {
|
|
|
|
sourceSet.java.each { javaFile ->
|
|
|
|
// - org.hibernate.boot.registry.classloading.internal
|
|
|
|
// until EntityManagerFactoryBuilderImpl no longer imports ClassLoaderServiceImpl
|
|
|
|
// - .util for external module use (especially envers)
|
|
|
|
final String[] temporaryExports = [
|
|
|
|
'org.hibernate.boot.registry.classloading.internal',
|
|
|
|
'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-01-23 18:22:03 -05:00
|
|
|
}
|
|
|
|
}
|
2013-04-08 15:27:47 -04:00
|
|
|
}
|
|
|
|
}
|
2013-01-23 18:22:03 -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
|
2013-04-08 18:53:44 -04:00
|
|
|
|
|
|
|
instruction 'Import-Package',
|
|
|
|
// Temporarily support JTA 1.1 -- Karaf and other frameworks still
|
|
|
|
// use it. Without this, the plugin generates [1.2,2).
|
|
|
|
'javax.transaction;version="[1.1,2)"',
|
2013-04-16 10:28:40 -04:00
|
|
|
// Tell Gradle OSGi to still dynamically import the other packages.
|
|
|
|
// IMPORTANT: Do not include the * in the modules' .gradle files.
|
|
|
|
// If it exists more than once, the manifest will physically contain a *.
|
2013-04-08 18:53:44 -04:00
|
|
|
'*'
|
2013-01-23 18:22:03 -05:00
|
|
|
|
|
|
|
instruction 'Export-Package', exportPackages.toArray(new String[0])
|
|
|
|
instruction 'Private-Package', privatePackages.toArray(new String[0])
|
|
|
|
|
2013-04-08 18:53:44 -04:00
|
|
|
instruction 'Bundle-Vendor', 'Hibernate.org'
|
2013-01-23 18:22:03 -05:00
|
|
|
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-11-01 01:42:27 -04:00
|
|
|
systemProperties['hibernate.test.validatefailureexpected'] = true
|
2012-11-02 14:54:20 -04:00
|
|
|
systemProperties += System.properties.findAll { it.key.startsWith( "hibernate.") }
|
2012-11-01 01:42:27 -04:00
|
|
|
maxHeapSize = "1024m"
|
2013-04-05 15:40:43 -04:00
|
|
|
// Not strictly needed but useful to attach a profiler:
|
|
|
|
jvmArgs '-XX:MaxPermSize=256m'
|
2010-10-08 21:20:10 -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
|
|
|
|
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 20:40:58 -04:00
|
|
|
|
2013-05-03 06:33:40 -04:00
|
|
|
// eclipseClasspath will not add sources to classpath unless the dirs actually exist.
|
|
|
|
eclipseClasspath.dependsOn("generateSources")
|
|
|
|
|
2013-09-06 11:30:15 -04:00
|
|
|
|
|
|
|
// Animal Sniffer ~~~~~~~~~~~~~~~~~~
|
|
|
|
// add animal sniffer Java API checking to the main compile tasks
|
|
|
|
|
|
|
|
// copy the resolved Animal Sniffer signature dependency artifact to a known location and name
|
2013-05-03 06:33:40 -04:00
|
|
|
task copyJavaApiSignature(type: Copy) {
|
|
|
|
from configurations.javaApiSignature
|
|
|
|
into "$buildDir/javaApiSignature/"
|
|
|
|
rename '.*signature', 'javaApi.signature'
|
|
|
|
}
|
|
|
|
|
2013-09-06 11:30:15 -04:00
|
|
|
// prepare the Animal Sniffer signature copy every time (before) we compile
|
|
|
|
compileJava.dependsOn copyJavaApiSignature
|
|
|
|
|
|
|
|
// and then after compilation, run the Animal Sniffer tool
|
|
|
|
compileJava.doLast {
|
|
|
|
ant.taskdef(
|
|
|
|
name: 'animalSniffer',
|
|
|
|
classname: 'org.codehaus.mojo.animal_sniffer.ant.CheckSignatureTask',
|
|
|
|
classpath: configurations.animalSniffer.asPath
|
|
|
|
)
|
|
|
|
|
|
|
|
ant.animalSniffer(
|
|
|
|
signature: "$buildDir/javaApiSignature/javaApi.signature",
|
|
|
|
classpath: sourceSets.main.compileClasspath.asPath) {
|
|
|
|
path( path: sourceSets.main.output.classesDir )
|
2013-05-03 06:33:40 -04:00
|
|
|
}
|
|
|
|
}
|
2010-10-10 09:17:52 -04:00
|
|
|
|
2013-04-09 20:38:12 -04:00
|
|
|
// specialized API/SPI checkstyle tasks ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
task checkstylePublicSources(type: Checkstyle) {
|
|
|
|
checkstyleClasspath = checkstyleMain.checkstyleClasspath
|
|
|
|
classpath = checkstyleMain.classpath
|
2013-04-19 15:35:22 -04:00
|
|
|
configFile = rootProject.file( 'shared/config/checkstyle/checkstyle.xml' )
|
2013-11-22 15:51:56 -05:00
|
|
|
source subProject.sourceSets.main.java.srcDirs
|
2013-04-19 15:35:22 -04:00
|
|
|
// exclude generated sources
|
|
|
|
exclude '**/generated-src/**'
|
|
|
|
// because cfg package is a mess mainly from annotation stuff
|
|
|
|
exclude '**/org/hibernate/cfg/**'
|
|
|
|
exclude '**/org/hibernate/cfg/*'
|
|
|
|
// because this should only report on api/spi
|
2013-04-09 20:38:12 -04:00
|
|
|
exclude '**/internal/**'
|
|
|
|
exclude '**/internal/*'
|
|
|
|
ignoreFailures = false
|
|
|
|
showViolations = true
|
|
|
|
reports {
|
|
|
|
xml {
|
|
|
|
destination "$buildDir/reports/checkstyle/public.xml"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
2013-04-08 15:27:47 -04:00
|
|
|
// Report configs ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
checkstyle {
|
2013-04-19 15:35:22 -04:00
|
|
|
sourceSets = [ subProject.sourceSets.main ]
|
2013-04-08 15:27:47 -04:00
|
|
|
configFile = rootProject.file( 'shared/config/checkstyle/checkstyle.xml' )
|
|
|
|
showViolations = false
|
|
|
|
ignoreFailures = true
|
|
|
|
}
|
2013-04-19 15:35:22 -04:00
|
|
|
// exclude generated sources
|
2013-05-01 14:46:23 -04:00
|
|
|
// unfortunately this nice easy approach does not seem to work : http://forums.gradle.org/gradle/topics/specify_excludes_to_checkstyle_task
|
|
|
|
//checkstyleMain.exclude '**/generated-src/**'
|
|
|
|
checkstyleMain.exclude '**/org/hibernate/hql/internal/antlr/**'
|
|
|
|
checkstyleMain.exclude '**/org/hibernate/hql/internal/antlr/*'
|
|
|
|
checkstyleMain.exclude '**/org/hibernate/sql/ordering/antlr/*'
|
|
|
|
checkstyleMain.exclude '**/*_$logger*'
|
|
|
|
checkstyleMain.exclude '**/org/hibernate/internal/jaxb/**'
|
2013-04-19 15:35:22 -04:00
|
|
|
// because cfg package is a mess mainly from annotation stuff
|
|
|
|
checkstyleMain.exclude '**/org/hibernate/cfg/**'
|
|
|
|
checkstyleMain.exclude '**/org/hibernate/cfg/*'
|
|
|
|
|
2013-04-08 15:27:47 -04:00
|
|
|
findbugs {
|
2013-04-30 09:07:24 -04:00
|
|
|
sourceSets = [ subProject.sourceSets.main, subProject.sourceSets.test ]
|
2013-04-08 15:27:47 -04:00
|
|
|
ignoreFailures = true
|
|
|
|
}
|
2013-04-30 09:07:24 -04:00
|
|
|
// exclude generated sources
|
2013-05-01 14:46:23 -04:00
|
|
|
// unfortunately this nice easy approach does not seem to work : http://forums.gradle.org/gradle/topics/specify_excludes_to_checkstyle_task
|
|
|
|
//findbugsMain.exclude '**/generated-src/**'
|
|
|
|
findbugsMain.exclude '**/org/hibernate/hql/internal/antlr/**'
|
|
|
|
findbugsMain.exclude '**/org/hibernate/hql/internal/antlr/*'
|
|
|
|
findbugsMain.exclude '**/org/hibernate/sql/ordering/antlr/*'
|
|
|
|
findbugsMain.exclude '**/*_$logger*'
|
|
|
|
findbugsMain.exclude '**/org/hibernate/internal/jaxb/**'
|
2013-04-30 09:07:24 -04:00
|
|
|
|
2013-04-08 15:27:47 -04:00
|
|
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
|
2013-04-16 19:25:20 -04:00
|
|
|
publishing {
|
|
|
|
publications {
|
|
|
|
mavenJava(MavenPublication) {
|
|
|
|
from components.java
|
|
|
|
|
|
|
|
artifact sourcesJar {
|
|
|
|
classifier "sources"
|
|
|
|
}
|
|
|
|
|
|
|
|
pom.withXml {
|
2013-05-07 22:18:40 -04:00
|
|
|
// append additional metadata
|
|
|
|
asNode().children().last() + {
|
2013-05-10 12:10:29 -04:00
|
|
|
resolveStrategy = Closure.DELEGATE_FIRST
|
|
|
|
|
2013-05-07 22:18:40 -04:00
|
|
|
name subProject.pomName()
|
2013-05-10 12:10:29 -04:00
|
|
|
description subProject.pomDescription()
|
2013-05-07 22:18:40 -04:00
|
|
|
url 'http://hibernate.org'
|
|
|
|
organization {
|
|
|
|
name 'Hibernate.org'
|
|
|
|
url 'http://hibernate.org'
|
|
|
|
}
|
|
|
|
issueManagement {
|
|
|
|
system 'jira'
|
|
|
|
url 'https://hibernate.atlassian.net/browse/HHH'
|
|
|
|
}
|
|
|
|
scm {
|
|
|
|
url 'http://github.com/hibernate/hibernate-orm'
|
|
|
|
connection 'scm:git:http://github.com/hibernate/hibernate-orm.git'
|
|
|
|
developerConnection 'scm:git:git@github.com:hibernate/hibernate-orm.git'
|
|
|
|
}
|
|
|
|
licenses {
|
|
|
|
license {
|
|
|
|
name 'GNU Lesser General Public License'
|
|
|
|
url 'http://www.gnu.org/licenses/lgpl-2.1.html'
|
|
|
|
comments 'See discussion at http://hibernate.org/license for more details.'
|
|
|
|
distribution 'repo'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
developers {
|
|
|
|
developer {
|
|
|
|
id 'hibernate-team'
|
|
|
|
name 'The Hibernate Development Team'
|
|
|
|
organization 'Hibernate.org'
|
|
|
|
organizationUrl 'http://hibernate.org'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// TEMPORARY : currently Gradle Publishing feature is exporting dependencies as 'runtime' scope,
|
|
|
|
// rather than 'compile'; fix that.
|
|
|
|
asNode().dependencies[0].dependency.each {
|
|
|
|
it.scope[0].value = 'compile'
|
2013-05-07 09:02:00 -04:00
|
|
|
}
|
2013-04-16 19:25:20 -04:00
|
|
|
}
|
2010-10-10 09:17:52 -04:00
|
|
|
}
|
|
|
|
}
|
2013-04-16 19:25:20 -04:00
|
|
|
|
|
|
|
repositories {
|
|
|
|
maven {
|
|
|
|
if ( subProject.version.endsWith( 'SNAPSHOT' ) ) {
|
|
|
|
name 'jboss-snapshots-repository'
|
|
|
|
url 'https://repository.jboss.org/nexus/content/repositories/snapshots'
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
name 'jboss-releases-repository'
|
|
|
|
url 'https://repository.jboss.org/nexus/service/local/staging/deploy/maven2/'
|
|
|
|
}
|
2011-06-08 23:39:07 -04:00
|
|
|
}
|
2010-10-10 09:17:52 -04:00
|
|
|
}
|
2013-11-21 14:46:03 -05:00
|
|
|
}
|
2011-02-10 10:45:28 -05:00
|
|
|
|
2013-11-21 14:46:03 -05:00
|
|
|
model {
|
|
|
|
tasks.generatePomFileForMavenJavaPublication {
|
2013-11-22 15:51:56 -05:00
|
|
|
destination = file( "$project.buildDir/generated-pom.xml" )
|
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'
|
|
|
|
}
|
2010-10-08 21:20:10 -04:00
|
|
|
}
|
2010-10-10 09:17:52 -04:00
|
|
|
|
2010-10-08 21:20:10 -04:00
|
|
|
}
|
2013-05-16 19:51:53 -04:00
|
|
|
|
|
|
|
task release(type: Task, dependsOn: 'release:release')
|
2013-11-21 14:46:03 -05:00
|
|
|
|
|
|
|
task wrapper(type: Wrapper) {
|
|
|
|
gradleVersion = expectedGradleVersion
|
|
|
|
}
|