From 901513ed7c59ef38562a421a9c27f4219b3c36f3 Mon Sep 17 00:00:00 2001 From: Steve Ebersole Date: Sun, 10 Oct 2010 08:17:52 -0500 Subject: [PATCH] HHH-5616 - Switch to Gradle for builds .. uploads --- build.gradle | 81 ++++++++++++++++++++++------ hibernate-core/hibernate-core.gradle | 3 ++ 2 files changed, 69 insertions(+), 15 deletions(-) diff --git a/build.gradle b/build.gradle index a927cbcc13..e4908214ca 100644 --- a/build.gradle +++ b/build.gradle @@ -77,10 +77,6 @@ subprojects { subProject -> // minimize changes, at least for now (gradle uses 'build' by default).. buildDirName = "target" -// if ( 'hibernate-release' == subProject.name ) { -// apply plugin : 'base' -// } -// else { if ( 'hibernate-release' != subProject.name ) { apply plugin: 'java' apply plugin: 'maven' // for install task as well as deploy dependencies @@ -90,6 +86,9 @@ subprojects { subProject -> // 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' + } } // appropriately inject the common dependencies into each sub-project @@ -102,6 +101,7 @@ subprojects { subProject -> testRuntime( libraries.jcl ) testRuntime( libraries.javassist ) testRuntime( libraries.h2 ) + deployerJars "org.apache.maven.wagon:wagon-http:1.0-beta-6" } sourceSets { @@ -120,21 +120,19 @@ subprojects { subProject -> test { // ignoreFailures = true - environment['hibernate.test.validatefailureexpected'] = true + systemProperties['hibernate.test.validatefailureexpected'] = true maxHeapSize = "1024m" } - processTestResources.doLast( - { - copy { - from( sourceSets.test.java.srcDirs ) { - include '**/*.properties' - include '**/*.xml' - } - into sourceSets.test.classesDir - } + processTestResources.doLast( { + copy { + from( sourceSets.test.java.srcDirs ) { + include '**/*.properties' + include '**/*.xml' } - ) + into sourceSets.test.classesDir + } + } ) assemble.doLast( { install } ) uploadArchives.dependsOn install @@ -151,7 +149,60 @@ subprojects { subProject -> module.dependencies*.exported = true } } + + // elements used to customize the generated POM used during upload + def pomConfig = { + url 'http://hibernate.org' + organization '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) + } + } + } + } + } dependsOnChildren() \ No newline at end of file diff --git a/hibernate-core/hibernate-core.gradle b/hibernate-core/hibernate-core.gradle index 4e0a80d6e6..5f766d9873 100644 --- a/hibernate-core/hibernate-core.gradle +++ b/hibernate-core/hibernate-core.gradle @@ -44,6 +44,9 @@ sourceSets { } } +// http://jira.codehaus.org/browse/GRADLE-1158 +test.testReport = false + //ideaModule { // sourceDirs.add( file( buildDirName + '/generated-src/antlr/main' ) ) // testSourceDirs.addAll( sourceSets.matrix.java.srcDirs )