Skip to content
This repository has been archived by the owner on Jan 29, 2022. It is now read-only.

Commit

Permalink
publishing finally works for real
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Lee committed Dec 4, 2014
1 parent 06c7d07 commit 22d205b
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 28 deletions.
100 changes: 75 additions & 25 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import org.apache.tools.ant.filters.ReplaceTokens
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'download-task'
apply plugin: 'versions'
apply plugin: 'com.github.ben-manes.versions'
apply from: 'gradle/functions.gradle'

ext.configDir = new File(rootDir, 'config')
Expand All @@ -24,50 +24,56 @@ ext.mongorestore = new File('/mnt/jenkins/mongodb/26/26-release/bin/mongorestore
'/mnt/jenkins/mongodb/26/26-release/bin/mongorestore' :
'/usr/local/bin/mongorestore';


buildscript {
repositories {
mavenLocal()
mavenCentral()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
jcenter()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url 'https://github.com/ben-manes/gradle-versions-plugin/raw/mvnrepo' }
}
dependencies {
classpath 'org.codehaus.groovy:groovy-backports-compat23:2.3.5'

classpath 'com.bmuschko:gradle-nexus-plugin:2.1.1'
classpath 'me.trnl:clirr-gradle-plugin:0.4'
classpath 'com.antwerkz.github:github-release-gradle-plugin:1.1.0'
classpath 'de.undercouch:gradle-download-task:1.0'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.5-beta-2'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.6'
}
}

task wrapper(type: Wrapper) {
gradleVersion = '1.12'
gradleVersion = '2.2.1'
}

if(project.hasProperty("clusterVersion")) {
println "The cluster version property has been obsoleted. See https://jira.mongodb.org/browse/HADOOP-160 for details."
}

allprojects {
version = '1.3.1'
group = 'org.mongodb.mongo-hadoop'
}

configure(subprojects) {
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'checkstyle'
apply plugin: 'findbugs'
apply plugin: 'com.bmuschko.nexus'

repositories {
mavenCentral()
mavenLocal()
maven { url "https://repository.cloudera.com/artifactory/cloudera-repos/" }
}

group = 'org.mongodb'
version = '1.3.1'

sourceCompatibility = JavaVersion.VERSION_1_6
targetCompatibility = JavaVersion.VERSION_1_6

/*
configurations {
tests
tests.extendsFrom(testCompile)
Expand All @@ -79,6 +85,7 @@ configure(subprojects) {
sourceSets.main.compileClasspath += configurations.provided
sourceSets.test.compileClasspath += configurations.provided
sourceSets.test.runtimeClasspath += configurations.provided
*/

dependencies {
compile "org.mongodb:mongo-java-driver:${javaDriverVersion}"
Expand Down Expand Up @@ -108,10 +115,10 @@ configure(subprojects) {
project.hasProperty(n) && project.property(n).toBoolean()
}

/* Testing */
task testJar(type: Jar, dependsOn: testClasses) {
from sourceSets.test.output
}
// /* Testing */
// task testJar(type: Jar, dependsOn: testClasses) {
// from sourceSets.test.output
// }

tasks.withType(Test) {
maxParallelForks = 1
Expand All @@ -125,7 +132,7 @@ configure(subprojects) {
beforeTest { descr ->
logger.info("[Test ${descr.className} > ${descr.name}]")
}

finalizedBy ':shutdownCluster'
}

Expand All @@ -148,7 +155,7 @@ configure(subprojects) {
}

task quickCheck(dependsOn: [checkstyleMain, checkstyleTest] ) << {}

findbugs {
excludeFilter = new File("$configDir/findbugs-exclude.xml")
sourceSets = [sourceSets.main]
Expand All @@ -167,22 +174,65 @@ configure(subprojects) {
options.links 'http://hadoop.apache.org/docs/r2.4.0/api'
options.links 'http://api.mongodb.org/java/2.12.3/'
}

gradle.taskGraph.whenReady { taskGraph ->
testJar {
baseName = "${archivesBaseName}-test"
mustRunAfter jar
}
copyFiles.dependsOn 'jar', 'testsJar'
}

artifacts {
tests testJar
}
// artifacts {
// tests testJar
// }

test {
dependsOn 'jar', 'testJar', ':configureCluster', ':downloadEnronEmails'
dependsOn 'jar', 'testsJar', ':configureCluster', ':downloadEnronEmails'
finalizedBy ':shutdownCluster'
}

modifyPom {
project {
name = 'MongoDB Connector for Hadoop'
description = 'The MongoDB Connector for Hadoop is a plugin for Hadoop that provides the ability to use MongoDB as an input source and/or an output destination.'
url 'https://github.com/mongodb/mongo-hadoop.git'

scm {
url 'https://github.com/mongodb/mongo-hadoop.git'
connection 'scm:git:git://github.com/mongodb/mongo-hadoop.git'
}

licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}

developers {
developer {
name 'Various'
organization = 'MongoDB'
}
}
}

whenConfigured { resultPom ->
resultPom.dependencies.removeAll { dep -> dep.scope != 'compile' }
resultPom.dependencies*.scope = null
}
}

extraArchive {
sources = true
tests = true
javadoc = true
}

nexus {
sign = true
// repositoryUrl = 'http://localhost:8081/nexus/content/repositories/internal/'
// snapshotRepositoryUrl = 'http://localhost:8081/nexus/content/repositories/internal-snapshots/'
}

}

idea {
Expand Down Expand Up @@ -223,7 +273,7 @@ project(':hive') {
testCompile "org.apache.hive:hive-cli:${hiveVersion}"
testCompile "org.apache.hive:hive-service:${hiveVersion}"

testCompile files(project(':core').sourceSets.main.output)
// testCompile files(project(':core').sourceSets.main.output)
testCompile files(project(':core').sourceSets.test.output)

testCompile("com.nitayjoffe.thirdparty.com.jointhegrid:hive_test:4.0.0") {
Expand Down Expand Up @@ -416,4 +466,4 @@ def hadoop(jar, className, args) {
}
}

apply from: 'gradle/maven-deployment.gradle'
//apply from: 'gradle/maven-deployment.gradle'
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ public HadoopVersionFilter(final boolean findTestJar) {

@Override
public boolean accept(final File pathname) {
return pathname.getName().endsWith(FORMAT) && findTestJar == pathname.getName().contains("-test-");
// return findTestJar ? pathname.getName().contains("-test-")
// : pathname.getName().endsWith(FORMAT);
return pathname.getName().endsWith(FORMAT) || findTestJar && pathname.getName().endsWith("-tests.jar");
}
}

0 comments on commit 22d205b

Please sign in to comment.