From 3ba79384f00c1b64505b3656dc614c708afb2671 Mon Sep 17 00:00:00 2001 From: Steve Ebersole Date: Thu, 10 Feb 2011 09:45:28 -0600 Subject: [PATCH] HHH-5904 - Deploy just testing artifacts from hibernate-core, not all tests --- build.gradle | 6 ++- .../StandardMavenAuthenticationProvider.java | 6 --- hibernate-core/hibernate-core.gradle | 40 +++++++++++++++++-- 3 files changed, 41 insertions(+), 11 deletions(-) diff --git a/build.gradle b/build.gradle index 7e6f961d8d..229a369703 100644 --- a/build.gradle +++ b/build.gradle @@ -193,6 +193,8 @@ subprojects { subProject -> } } + subProject.basePomConfig = pomConfig + configure(install.repositories.mavenInstaller) { pom.project pomConfig } @@ -202,8 +204,8 @@ subprojects { subProject -> name = 'jbossDeployer' configuration = configurations.deployerJars pom.project pomConfig - repository(url: "https://repository.jboss.org/nexus/service/local/staging/deploy/maven2/") - snapshotRepository(url: "https://repository.jboss.org/nexus/content/repositories/snapshots") + 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") } } diff --git a/buildSrc/src/main/java/org/hibernate/build/gradle/upload/StandardMavenAuthenticationProvider.java b/buildSrc/src/main/java/org/hibernate/build/gradle/upload/StandardMavenAuthenticationProvider.java index 80e2bd1ff1..6b68b72a92 100644 --- a/buildSrc/src/main/java/org/hibernate/build/gradle/upload/StandardMavenAuthenticationProvider.java +++ b/buildSrc/src/main/java/org/hibernate/build/gradle/upload/StandardMavenAuthenticationProvider.java @@ -29,7 +29,6 @@ import org.dom4j.Document; import org.dom4j.DocumentException; import org.dom4j.Element; import org.dom4j.io.SAXReader; -import org.gradle.api.artifacts.maven.MavenDeployer; import org.xml.sax.InputSource; import org.slf4j.Logger; @@ -56,10 +55,6 @@ public class StandardMavenAuthenticationProvider implements AuthenticationProvid @Override public Authentication determineAuthentication(RemoteRepository remoteRepository) { - if ( ! MavenDeployer.class.isInstance( remoteRepository ) ) { - return null; - } - if ( repositoryAuthenticationMap == null ) { loadRepositoryAuthenticationMap(); } @@ -117,7 +112,6 @@ public class StandardMavenAuthenticationProvider implements AuthenticationProvid private SAXReader buildSAXReader() { SAXReader saxReader = new SAXReader(); saxReader.setMergeAdjacentText( true ); - saxReader.setValidation( true ); return saxReader; } diff --git a/hibernate-core/hibernate-core.gradle b/hibernate-core/hibernate-core.gradle index 445e211ed6..7263d71648 100644 --- a/hibernate-core/hibernate-core.gradle +++ b/hibernate-core/hibernate-core.gradle @@ -46,20 +46,54 @@ ideaModule { sourceDirs.add( file( '$buildDir/generated-src/antlr/main' ) ) } +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// This entire section below is all about creating, installing and uploading the hibernate-testing artifacts. +// This is obviously extremely verbose. Check back once Gradle goes m2 for 1.0 to see about the MavenPublication +// approach Adam talked about as a means to make this more succinct and natural. +// todo : check back once Gradle goes m2 for 1.0 to see about the MavenPublication approach +configurations { + testing +} + task testingJar(type: Jar, dependsOn: compileTestJava) { from sourceSets.test.classes - includes += "org/hibernate/testing/*" + includes += "org/hibernate/testing/**" baseName = 'hibernate-testing' } task testingSourcesJar(type: Jar, dependsOn: compileTestJava) { from sourceSets.test.allSource - includes += "org/hibernate/testing/*" + includes += "org/hibernate/testing/**" baseName = 'hibernate-testing' classifier = 'sources' } artifacts { - testing testingJar, testingSourcesJar + testing testingJar, testingSourcesJar } +// ugh, lots of duplication with uploadArchives +uploadTesting { + repositories.mavenDeployer { + name = 'jbossDeployer' + configuration = configurations.deployerJars + pom.project basePomConfig + pom.artifactId = 'hibernate-testing' + 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") + } +} + +uploadArchives.dependsOn uploadTesting + +task installTesting(type:Upload, dependsOn: [testingJar,testingSourcesJar]) { + configuration = configurations.testing + repositories.mavenInstaller { + name = RepositoryHandler.DEFAULT_MAVEN_INSTALLER_NAME + pom.project basePomConfig + pom.artifactId = 'hibernate-testing' + } +} + +install.dependsOn installTesting +uploadTesting.dependsOn installTesting \ No newline at end of file