blob: 6ee06b44ebd25f1ce5b08241c91fb226a1fbaa1a [file] [log] [blame]
allprojects {
repositories {
mavenLocal()
mavenCentral()
}
group = "org.robolectric"
version = "3.2-SNAPSHOT"
apply plugin: "java"
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
tasks.withType(JavaCompile) {
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
// Show all warnings except boot classpath
configure(options) {
if (System.properties["lint"] != null && System.properties["lint"] != "false") {
compilerArgs << "-Xlint:all" // Turn on all warnings
}
compilerArgs << "-Xlint:-options" // Turn off "missing" bootclasspath warning
encoding = "utf-8" // Make sure source encoding is UTF-8
incremental = true
}
}
// it's weird that compileOnly deps aren't included for test compilation; fix that:
project.sourceSets {
test.compileClasspath += project.configurations.compileOnly
}
apply plugin: "signing"
apply plugin: "maven"
task sourcesJar(type: Jar, dependsOn: classes) {
classifier "sources"
from sourceSets.main.allJava
}
javadoc.failOnError = false
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier "javadoc"
from javadoc.destinationDir
}
task provideBuildClasspath(type: ProvideBuildClasspathTask) {
File outDir = project.sourceSets['test'].output.resourcesDir
outFile = new File(outDir, 'robolectric-deps.properties')
}
test {
dependsOn provideBuildClasspath
exclude "**/*\$*" // otherwise gradle runs static inner classes like TestRunnerSequenceTest$SimpleTest
testLogging {
exceptionFormat "full"
showCauses true
showExceptions true
showStackTraces true
showStandardStreams true
events = ["failed", "skipped"]
}
minHeapSize = "1024m"
maxHeapSize = "2048m"
jvmArgs "-XX:MaxPermSize=1024m"
}
signing {
required { !version.endsWith("SNAPSHOT") && gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
ext.mavenArtifactName = {
def projNameParts = project.name.split(/\//) as List
if (projNameParts[0] == "robolectric-shadows") {
projNameParts = projNameParts.drop(1)
return projNameParts.join("-")
} else {
return project.name
}
}
artifacts {
archives jar
archives sourcesJar
archives javadocJar
}
uploadArchives {
repositories {
mavenDeployer {
pom.artifactId = mavenArtifactName()
pom.project {
name project.name
description = "An alternative Android testing framework."
url = "http://robolectric.org"
licenses {
license {
name "The MIT License"
url "https://opensource.org/licenses/MIT"
}
}
scm {
url "git@github.com:robolectric/robolectric.git"
connection "scm:git:git://github.com/robolectric/robolectric.git"
developerConnection "scm:git:https://github.com/robolectric/robolectric.git"
}
developers {
developer {
name "Christian Williams"
email "christianw@google.com"
organization {
name "Google Inc."
}
organizationUrl "http://google.com"
}
developer {
name "Jonathan Gerrish"
email "jongerrish@google.com"
organization {
name "Google Inc."
}
organizationUrl "http://google.com"
}
}
}
def url = project.version.endsWith("-SNAPSHOT") ?
"https://oss.sonatype.org/content/repositories/snapshots" :
"https://oss.sonatype.org/service/local/staging/deploy/maven2/"
repository(url: url) {
authentication(
userName: System.properties["sonatype-login"],
password: System.properties["sonatype-password"]
)
}
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
}
}
}
}