hibernate-orm/build.gradle

217 lines
7.4 KiB
Groovy
Raw Normal View History

2010-10-08 21:20:10 -04:00
apply plugin: 'eclipse'
apply plugin: 'idea'
allprojects {
repositories {
mavenCentral()
mavenRepo name: 'jboss-nexus', urls: "https://repository.jboss.org/nexus/content/groups/public/"
mavenRepo name: "jboss-snapshots", urls: "http://snapshots.jboss.org/maven2/"
mavenRepo urls: "file://" + System.getProperty('user.home') + "/.m2/repository/"
}
}
ideaProject {
javaVersion = "1.6"
withXml { root ->
root.component.find { it.@name == 'VcsDirectoryMappings' }.mapping.@vcs = 'Git'
}
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
h2: 'com.h2database:h2:1.2.134',
// 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
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
junit: 'junit:junit:3.8.2',
testng: 'org.testng:testng:5.8:jdk15',
jpa_modelgen: 'org.hibernate:hibernate-jpamodelgen:1.0.0.Final',
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 ->
apply plugin: 'idea'
2010-10-08 21:20:10 -04:00
group = 'org.hibernate'
version = '4.0.0-SNAPSHOT'
defaultTasks 'build'
2010-10-08 21:20:10 -04:00
// minimize changes, at least for now (gradle uses 'build' by default)..
buildDir = "target"
2010-10-08 21:20:10 -04:00
if ( 'hibernate-release' != subProject.name ) {
apply plugin: 'java'
2010-10-08 21:20:10 -04:00
apply plugin: 'maven' // for install task as well as deploy dependencies
configurations {
provided {
// todo : need to make sure these are non-exported
description = 'Non-exported compile-time dependencies.'
}
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 {
compile( libraries.slf4j_api )
testCompile( libraries.junit )
testRuntime( libraries.slf4j_simple )
testRuntime( libraries.jcl_slf4j )
testRuntime( libraries.jcl_api )
testRuntime( libraries.jcl )
testRuntime( libraries.javassist )
2010-10-08 21:20:10 -04:00
testRuntime( libraries.h2 )
deployerJars "org.apache.maven.wagon:wagon-http:1.0-beta-6"
2010-10-08 21:20:10 -04:00
}
sourceSets {
main {
compileClasspath += configurations.provided
}
}
manifest.mainAttributes(
provider: 'gradle',
'Implementation-Url': 'http://hibernate.org',
'Implementation-Version': version,
'Implementation-Vendor': 'Hibernate.org',
'Implementation-Vendor-Id': 'org.hibernate'
)
test {
// ignoreFailures = true
systemProperties['hibernate.test.validatefailureexpected'] = true
2010-10-08 21:20:10 -04:00
maxHeapSize = "1024m"
}
processTestResources.doLast( {
copy {
from( sourceSets.test.java.srcDirs ) {
include '**/*.properties'
include '**/*.xml'
2010-10-08 21:20:10 -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 {
// treat our "provided" configuration dependencies as "Compile" scope dependencies in IntelliJ
scopes.COMPILE.plus.add( configurations.provided )
// Use explicitly separate compilation output directories for Gradle and IntelliJ
File baseDirectory = new File( subProject.buildDir, "idea/classes" )
outputDir = new File( baseDirectory, "main" )
testOutputDir = new File( baseDirectory, "test" )
2010-10-08 21:20:10 -04:00
whenConfigured { module ->
module.dependencies*.exported = true
}
}
// elements used to customize the generated POM used during upload
def pomConfig = {
url 'http://hibernate.org'
organization {
name 'Hibernate.org'
url 'http://hibernate.org'
}
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'
comments 'See discussion at http://hibernate.org/356.html for more details.'
distribution 'repo'
}
}
developers {
}
}
configure(install.repositories.mavenInstaller) {
pom.project pomConfig
}
if ( ! project.hasProperty('MY_JBOSS_USER') ) {
MY_JBOSS_USER = "";
}
if ( ! project.hasProperty('MY_JBOSS_PASS') ) {
MY_JBOSS_PASS = "";
}
uploadArchives {
repositories.mavenDeployer {
name = 'jbossDeployer'
configuration = configurations.deployerJars
pom.project pomConfig
credentials = [userName: MY_JBOSS_USER, password: MY_JBOSS_PASS]
repository(url: "https://repository.jboss.org/nexus/service/local/staging/deploy/maven2/") {
authentication(credentials)
}
snapshotRepository(url: "https://repository.jboss.org/nexus/content/repositories/snapshots") {
authentication(credentials)
}
}
}
2010-10-08 21:20:10 -04:00
}
2010-10-08 21:20:10 -04:00
}
dependsOnChildren()