2014-03-08 11:47:40 +01:00
|
|
|
import org.gradle.plugins.signing.Sign
|
|
|
|
|
2014-08-16 00:09:55 +02:00
|
|
|
buildscript {
|
|
|
|
repositories {
|
|
|
|
jcenter()
|
2015-09-13 18:12:33 +02:00
|
|
|
maven { url 'https://plugins.gradle.org/m2/' }
|
2015-11-12 04:08:40 +01:00
|
|
|
maven { url 'https://dl.bintray.com/content/aalmiray/kordamp' }
|
2014-08-16 00:09:55 +02:00
|
|
|
}
|
|
|
|
dependencies {
|
2015-03-07 21:05:31 +01:00
|
|
|
classpath 'org.kordamp:markdown-gradle-plugin:1.0.0'
|
2015-03-12 13:22:11 +01:00
|
|
|
classpath 'org.kordamp.gradle:clirr-gradle-plugin:0.2.0'
|
2015-03-12 15:44:53 +01:00
|
|
|
classpath "org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.3.1"
|
2015-09-13 18:12:33 +02:00
|
|
|
classpath 'net.ltgt.gradle:gradle-errorprone-plugin:0.0.8'
|
2014-08-16 00:09:55 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
apply plugin: 'org.kordamp.gradle.markdown'
|
|
|
|
|
2014-11-04 14:43:41 +01:00
|
|
|
apply from: 'version.gradle'
|
|
|
|
|
2014-02-14 18:13:51 +01:00
|
|
|
allprojects {
|
|
|
|
apply plugin: 'java'
|
|
|
|
apply plugin: 'eclipse'
|
2015-03-12 18:11:46 +01:00
|
|
|
apply plugin: 'jacoco'
|
2015-09-13 18:12:33 +02:00
|
|
|
apply plugin: 'net.ltgt.errorprone'
|
2014-02-14 18:13:51 +01:00
|
|
|
|
|
|
|
ext {
|
|
|
|
gitCommit = getGitCommit()
|
|
|
|
javadocAllDir = new File(buildDir, 'javadoc')
|
2014-08-16 00:09:55 +02:00
|
|
|
documentationDir = new File(buildDir, 'documentation')
|
2014-02-18 10:51:24 +01:00
|
|
|
releasedocsDir = new File(buildDir, 'releasedocs')
|
2014-02-14 18:13:51 +01:00
|
|
|
rootConfigDir = new File(rootDir, 'config')
|
|
|
|
sonatypeCredentialsAvailable = project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePassword')
|
|
|
|
isReleaseVersion = !isSnapshot
|
|
|
|
signingRequired = isReleaseVersion
|
|
|
|
sonatypeSnapshotUrl = 'https://oss.sonatype.org/content/repositories/snapshots'
|
|
|
|
sonatypeStagingUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2'
|
2014-07-25 19:47:55 +02:00
|
|
|
// Returns only the date in yyyy-MM-dd format, as otherwise, with
|
|
|
|
// hh:mm:ss information, the manifest files would change with every
|
|
|
|
// build, causing unnecessary rebuilds.
|
2014-08-08 15:08:43 +02:00
|
|
|
builtDate = (new java.text.SimpleDateFormat("yyyy-MM-dd")).format(new Date())
|
2014-02-19 23:26:56 +01:00
|
|
|
oneLineDesc = 'An Open Source XMPP (Jabber) client library'
|
2015-03-18 09:52:33 +01:00
|
|
|
javadocAllProjects = subprojects - project(':smack-integration-test')
|
2015-03-12 18:11:46 +01:00
|
|
|
// A dirty hack used for Gradle's jacoco plugin, since is not
|
|
|
|
// hable to handle the case when a (sub)project has no unit
|
|
|
|
// tests. :-(
|
|
|
|
projectsWithoutUnitTests = [
|
|
|
|
':smack-android',
|
|
|
|
':smack-android-extensions',
|
|
|
|
':smack-bosh',
|
|
|
|
':smack-compression-jzlib',
|
|
|
|
':smack-debug',
|
|
|
|
':smack-debug-slf4j',
|
|
|
|
':smack-java7',
|
|
|
|
':smack-jingle-old',
|
|
|
|
':smack-resolver-dnsjava',
|
|
|
|
':smack-resolver-javax',
|
|
|
|
':smack-resolver-minidns',
|
|
|
|
].collect{ project(it) }
|
|
|
|
projectsWithUnitTests = subprojects - projectsWithoutUnitTests
|
2015-01-25 10:35:44 +01:00
|
|
|
androidProjects = [
|
|
|
|
':smack-tcp',
|
|
|
|
':smack-bosh',
|
|
|
|
':smack-core',
|
|
|
|
':smack-im',
|
|
|
|
':smack-resolver-minidns',
|
|
|
|
':smack-sasl-provided',
|
|
|
|
':smack-extensions',
|
|
|
|
':smack-experimental',
|
|
|
|
].collect{ project(it) }
|
2015-03-21 18:56:27 +01:00
|
|
|
androidBootClasspathProjects = [
|
|
|
|
':smack-android',
|
|
|
|
':smack-android-extensions',
|
|
|
|
].collect{ project(it) }
|
2014-09-22 09:58:09 +02:00
|
|
|
androidBootClasspath = getAndroidRuntimeJar()
|
|
|
|
androidJavadocOffline = getAndroidJavadocOffline()
|
2015-03-18 09:52:33 +01:00
|
|
|
junitVersion = '4.11'
|
2014-02-14 18:13:51 +01:00
|
|
|
}
|
|
|
|
group = 'org.igniterealtime.smack'
|
2014-03-23 23:12:15 +01:00
|
|
|
sourceCompatibility = 1.7
|
2014-07-31 19:45:00 +02:00
|
|
|
targetCompatibility = sourceCompatibility
|
2014-02-14 18:13:51 +01:00
|
|
|
version = shortVersion
|
|
|
|
if (isSnapshot) {
|
|
|
|
version += '-SNAPSHOT'
|
|
|
|
}
|
|
|
|
|
|
|
|
ext.sharedManifest = manifest {
|
|
|
|
attributes('Implementation-Version': version,
|
|
|
|
'Implementation-GitRevision': ext.gitCommit,
|
2014-04-28 11:22:42 +02:00
|
|
|
// According to OSGi core 5.0 section 3.2.5 the qualifier (the fourth
|
|
|
|
// version element) must begin with a dot. So we replace only the
|
|
|
|
// first occurence of an dash with a dot.
|
|
|
|
// For example 4.0.0-rc1 becomes 4.0.0.rc1, but
|
|
|
|
// 4.0.0-SNAPSHOT-2014-05-01 becomes 4.0.0.SNAPSHOT-2014-05-01
|
2014-06-22 18:18:04 +02:00
|
|
|
'Bundle-Version': version.replaceFirst("-", "."),
|
2014-08-08 15:08:43 +02:00
|
|
|
'Built-Date': ext.builtDate,
|
2014-06-22 18:18:04 +02:00
|
|
|
'Built-JDK': System.getProperty('java.version'),
|
|
|
|
'Built-Gradle': gradle.gradleVersion,
|
|
|
|
'Built-By': System.getProperty('user.name')
|
|
|
|
)
|
2014-02-14 18:13:51 +01:00
|
|
|
}
|
2014-05-11 09:38:13 +02:00
|
|
|
|
|
|
|
eclipse {
|
|
|
|
classpath {
|
|
|
|
downloadJavadoc = true
|
|
|
|
}
|
|
|
|
}
|
2014-06-01 12:23:13 +02:00
|
|
|
|
|
|
|
repositories {
|
2015-03-12 18:11:46 +01:00
|
|
|
mavenLocal()
|
|
|
|
mavenCentral()
|
2014-06-01 12:23:13 +02:00
|
|
|
// Add OSS Sonatype Snapshot repository
|
|
|
|
maven {
|
|
|
|
url 'https://oss.sonatype.org/content/repositories/snapshots'
|
|
|
|
}
|
|
|
|
}
|
2014-07-25 09:26:26 +02:00
|
|
|
|
2015-03-23 09:27:15 +01:00
|
|
|
tasks.withType(JavaCompile) {
|
2014-08-19 00:46:59 +02:00
|
|
|
// Some systems may not have set their platform default
|
|
|
|
// converter to 'utf8', but we use unicode in our source
|
|
|
|
// files. Therefore ensure that javac uses unicode
|
|
|
|
options.encoding = "utf8"
|
2015-03-23 09:27:15 +01:00
|
|
|
options.compilerArgs = [
|
|
|
|
'-Xlint:all',
|
2015-04-03 19:15:35 +02:00
|
|
|
// Set '-options' because a non-java7 javac will emit a
|
|
|
|
// warning if source/traget is set to 1.7 and
|
|
|
|
// bootclasspath is *not* set.
|
|
|
|
// TODO implement a sound heuristic to determine a java7
|
|
|
|
// rt.jar on the build host. And if none is found,
|
|
|
|
// fallback to using a environment variable,
|
|
|
|
// e.g. JAVA7_HOME. See SMACK-651.
|
|
|
|
'-Xlint:-options',
|
2015-03-23 14:09:37 +01:00
|
|
|
'-Werror',
|
2015-09-13 18:12:33 +02:00
|
|
|
// Needed because since adding gradle-errorprone-plugin
|
|
|
|
// See https://github.com/tbroyer/gradle-errorprone-plugin/issues/15
|
|
|
|
'-Xlint:-path',
|
|
|
|
// Disable errorprone checks
|
|
|
|
'-Xep:TypeParameterUnusedInFormals:OFF',
|
2015-09-18 23:47:07 +02:00
|
|
|
'-Xep:TopLevel:OFF',
|
2015-03-23 09:27:15 +01:00
|
|
|
]
|
2014-08-19 00:46:59 +02:00
|
|
|
}
|
|
|
|
|
2015-03-12 18:11:46 +01:00
|
|
|
jacoco {
|
|
|
|
toolVersion = "0.7.4.201502262128"
|
|
|
|
}
|
|
|
|
|
|
|
|
jacocoTestReport {
|
|
|
|
dependsOn test
|
|
|
|
sourceDirectories = project.files(sourceSets.main.allSource.srcDirs)
|
|
|
|
classDirectories = project.files(sourceSets.main.output)
|
|
|
|
reports {
|
|
|
|
xml.enabled true
|
|
|
|
}
|
|
|
|
}
|
2015-04-03 19:15:35 +02:00
|
|
|
|
|
|
|
if (JavaVersion.current().isJava8Compatible()) {
|
|
|
|
tasks.withType(Javadoc) {
|
|
|
|
// The '-quiet' as second argument is actually a hack,
|
|
|
|
// since the one paramater addStringOption doesn't seem to
|
|
|
|
// work, we extra add '-quiet', which is added anyway by
|
|
|
|
// gradle.
|
|
|
|
// TODO enable all doclints, see SMACK-650
|
|
|
|
options.addStringOption('Xdoclint:all,-html,-syntax', '-quiet')
|
|
|
|
}
|
|
|
|
}
|
2015-04-04 18:46:07 +02:00
|
|
|
tasks.withType(Javadoc) {
|
|
|
|
options.charSet = "UTF-8"
|
|
|
|
}
|
2015-11-16 15:07:40 +01:00
|
|
|
|
|
|
|
// Pin the errorprone version to prevent "unsupported major.minor
|
|
|
|
// version 52.0" error messages caused by the errorprone javac.
|
|
|
|
// See https://github.com/tbroyer/gradle-errorprone-plugin/issues/18 for more information.
|
|
|
|
configurations.errorprone {
|
|
|
|
resolutionStrategy.force 'com.google.errorprone:error_prone_core:2.0.5'
|
|
|
|
}
|
2014-04-17 12:51:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
gradle.taskGraph.whenReady { taskGraph ->
|
|
|
|
if (signingRequired
|
|
|
|
&& taskGraph.allTasks.any { it instanceof Sign }) {
|
|
|
|
// Use Java 6's console to read from the console (no good for a CI environment)
|
|
|
|
Console console = System.console()
|
|
|
|
console.printf '\n\nWe have to sign some things in this build.\n\nPlease enter your signing details.\n\n'
|
|
|
|
def password = console.readPassword('GnuPG Private Key Password: ')
|
2014-03-08 11:47:40 +01:00
|
|
|
|
2014-04-17 12:51:54 +02:00
|
|
|
allprojects { ext.'signing.password' = password }
|
2014-03-08 11:47:40 +01:00
|
|
|
|
2014-04-17 12:51:54 +02:00
|
|
|
console.printf '\nThanks.\n\n'
|
2014-03-08 11:47:40 +01:00
|
|
|
}
|
2014-02-14 18:13:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
task javadocAll(type: Javadoc) {
|
2015-03-18 09:52:33 +01:00
|
|
|
source javadocAllProjects.collect {project ->
|
2014-02-14 18:13:51 +01:00
|
|
|
project.sourceSets.main.allJava }
|
|
|
|
destinationDir = javadocAllDir
|
|
|
|
// Might need a classpath
|
|
|
|
classpath = files(subprojects.collect {project ->
|
|
|
|
project.sourceSets.main.compileClasspath})
|
2015-03-21 18:56:27 +01:00
|
|
|
classpath += files(androidBootClasspath)
|
2014-06-17 12:08:36 +02:00
|
|
|
options.linkSource = true
|
|
|
|
options.use = true
|
2015-03-21 18:56:27 +01:00
|
|
|
options.links = [
|
|
|
|
"http://docs.oracle.com/javase/$sourceCompatibility/docs/api/",
|
|
|
|
"http://jxmpp.org/$jxmppVersion/javadoc/",
|
|
|
|
] as String[]
|
2014-02-14 18:13:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
import org.apache.tools.ant.filters.ReplaceTokens
|
|
|
|
task prepareReleasedocs(type: Copy) {
|
|
|
|
from 'resources/releasedocs'
|
|
|
|
into releasedocsDir
|
2014-08-08 15:08:43 +02:00
|
|
|
filter(ReplaceTokens, tokens: [version: version, releasedate: builtDate, targetCompatibility: targetCompatibility.toString()])
|
2014-02-14 18:13:51 +01:00
|
|
|
}
|
|
|
|
|
2014-08-16 00:09:55 +02:00
|
|
|
markdownToHtml {
|
|
|
|
sourceDir = new File(projectDir, "/documentation")
|
|
|
|
outputDir documentationDir
|
|
|
|
configuration = [tables: true, fencedCodeBlocks: true]
|
|
|
|
}
|
|
|
|
|
|
|
|
task distributionZip(type: Zip, dependsOn: [javadocAll, prepareReleasedocs, markdownToHtml]) {
|
2014-08-08 15:08:43 +02:00
|
|
|
classifier builtDate
|
2014-02-14 18:13:51 +01:00
|
|
|
into ('javadoc') {
|
|
|
|
from(javadocAllDir)
|
|
|
|
}
|
|
|
|
into ('releasedocs') {
|
|
|
|
from(releasedocsDir)
|
|
|
|
}
|
|
|
|
into ('releasedocs/documentation') {
|
|
|
|
from(documentationDir)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-08-20 20:53:17 +02:00
|
|
|
task maybeCheckForSnapshotDependencies {
|
|
|
|
// Don't check for Snapshot dependencies if this is a snapshot.
|
|
|
|
if (isSnapshot) return
|
|
|
|
allprojects { project ->
|
|
|
|
project.configurations.runtime.each {
|
|
|
|
if (it.toString().contains("-SNAPSHOT"))
|
|
|
|
throw new Exception("Release build contains snapshot dependencies: " + it)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
test { dependsOn maybeCheckForSnapshotDependencies }
|
|
|
|
|
2014-02-14 18:13:51 +01:00
|
|
|
jar {
|
|
|
|
// Root project should not create empty jar artifact
|
|
|
|
enabled = false
|
|
|
|
}
|
|
|
|
|
2014-06-26 22:44:31 +02:00
|
|
|
// Disable upload archives for the root project
|
|
|
|
uploadArchives.enabled = false
|
|
|
|
|
2014-02-14 18:13:51 +01:00
|
|
|
description = """\
|
|
|
|
Smack ${version}
|
2014-02-19 23:26:56 +01:00
|
|
|
${oneLineDesc}."""
|
2014-02-14 18:13:51 +01:00
|
|
|
|
2014-05-10 21:00:40 +02:00
|
|
|
evaluationDependsOnChildren()
|
2014-02-14 18:13:51 +01:00
|
|
|
subprojects {
|
2014-04-28 17:10:53 +02:00
|
|
|
apply plugin: 'maven'
|
2014-02-14 18:13:51 +01:00
|
|
|
apply plugin: 'osgi'
|
|
|
|
apply plugin: 'signing'
|
|
|
|
apply plugin: 'checkstyle'
|
2015-03-03 14:06:21 +01:00
|
|
|
apply plugin: 'org.kordamp.gradle.clirr'
|
2014-02-14 18:13:51 +01:00
|
|
|
|
|
|
|
checkstyle {
|
|
|
|
configFile = new File(rootConfigDir, 'checkstyle.xml')
|
|
|
|
}
|
|
|
|
task sourcesJar(type: Jar, dependsOn: classes) {
|
|
|
|
classifier = 'sources'
|
|
|
|
from sourceSets.main.allSource
|
|
|
|
}
|
|
|
|
task javadocJar(type: Jar, dependsOn: javadoc) {
|
|
|
|
classifier = 'javadoc'
|
|
|
|
from javadoc.destinationDir
|
|
|
|
}
|
2014-08-12 21:58:04 +02:00
|
|
|
task testJar(type: Jar) {
|
|
|
|
classifier = 'tests'
|
|
|
|
from sourceSets.test.output
|
|
|
|
}
|
2015-09-08 14:02:31 +02:00
|
|
|
|
|
|
|
// Does install unique snapshosts (and release)s in the local maven
|
|
|
|
// repository, unlike the 'install' task.
|
|
|
|
// You can specify the path of the local maven repository using 'maven.repo.local', e.g.
|
|
|
|
// gradle uploadLocal -Dmaven.repo.local=/var/www/repo
|
|
|
|
task uploadLocal(type: Upload) {
|
|
|
|
description "Uploads artifacts into the local maven repositories URL."
|
|
|
|
configuration = configurations['archives']
|
|
|
|
repositories {
|
|
|
|
mavenDeployer {
|
|
|
|
repository url: repositories.mavenLocal().url
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-14 18:13:51 +01:00
|
|
|
artifacts {
|
|
|
|
archives sourcesJar
|
|
|
|
archives javadocJar
|
2014-08-12 21:58:04 +02:00
|
|
|
archives testJar
|
2014-02-14 18:13:51 +01:00
|
|
|
}
|
2014-05-10 21:00:40 +02:00
|
|
|
|
2014-02-14 18:13:51 +01:00
|
|
|
uploadArchives {
|
|
|
|
repositories {
|
|
|
|
mavenDeployer {
|
|
|
|
if (signingRequired) {
|
|
|
|
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
|
|
|
|
}
|
|
|
|
repository(url: project.sonatypeStagingUrl) {
|
|
|
|
if (sonatypeCredentialsAvailable) {
|
|
|
|
authentication(userName: sonatypeUsername, password: sonatypePassword)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
snapshotRepository(url: project.sonatypeSnapshotUrl) {
|
|
|
|
if (sonatypeCredentialsAvailable) {
|
|
|
|
authentication(userName: sonatypeUsername, password: sonatypePassword)
|
|
|
|
}
|
|
|
|
}
|
2014-05-10 21:00:40 +02:00
|
|
|
|
2014-02-14 18:13:51 +01:00
|
|
|
pom.project {
|
|
|
|
name 'Smack'
|
|
|
|
packaging 'jar'
|
2014-02-19 23:26:56 +01:00
|
|
|
inceptionYear '2003'
|
2014-02-14 18:13:51 +01:00
|
|
|
url 'http://www.igniterealtime.org/projects/smack/'
|
2014-05-10 21:00:40 +02:00
|
|
|
description project.description
|
|
|
|
|
2014-02-18 10:51:24 +01:00
|
|
|
issueManagement {
|
|
|
|
system 'JIRA'
|
2014-06-22 22:44:00 +02:00
|
|
|
url 'https://igniterealtime.org/issues/browse/SMACK'
|
2014-02-18 10:51:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
distributionManagement {
|
|
|
|
snapshotRepository {
|
|
|
|
id 'smack.snapshot'
|
|
|
|
url project.sonatypeSnapshotUrl
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-14 18:13:51 +01:00
|
|
|
scm {
|
|
|
|
url 'https://github.com/igniterealtime/Smack'
|
|
|
|
connection 'scm:git:https://github.com/igniterealtime/Smack.git'
|
|
|
|
developerConnection 'scm:git:https://github.com/igniterealtime/Smack.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 {
|
|
|
|
id 'flow'
|
|
|
|
name 'Florian Schmaus'
|
|
|
|
email 'flow@igniterealtime.org'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
rootProject.distributionZip {
|
|
|
|
dependsOn build
|
|
|
|
from(buildDir) {
|
2014-06-27 12:22:45 +02:00
|
|
|
include "$libsDirName/*${version}.jar"
|
|
|
|
include "$libsDirName/*${version}-javadoc.jar"
|
|
|
|
include "$libsDirName/*${version}-sources.jar"
|
2014-02-14 18:13:51 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
signing {
|
|
|
|
required { signingRequired }
|
|
|
|
sign configurations.archives
|
|
|
|
}
|
2015-03-03 14:06:21 +01:00
|
|
|
|
|
|
|
clirr {
|
2015-03-12 13:22:11 +01:00
|
|
|
semver false
|
2015-03-03 14:06:21 +01:00
|
|
|
}
|
2014-02-14 18:13:51 +01:00
|
|
|
}
|
|
|
|
|
2015-03-18 09:52:33 +01:00
|
|
|
// No need to ever clirr smack-integration-test
|
|
|
|
project(':smack-integration-test').clirr.enabled = false
|
|
|
|
|
2014-05-30 22:35:18 +02:00
|
|
|
subprojects*.jar {
|
|
|
|
manifest {
|
|
|
|
from sharedManifest
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-03-21 18:56:27 +01:00
|
|
|
configure(androidBootClasspathProjects) {
|
|
|
|
compileJava {
|
|
|
|
options.bootClasspath = androidBootClasspath
|
|
|
|
}
|
|
|
|
javadoc {
|
|
|
|
classpath += files(androidBootClasspath)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-03-12 18:11:46 +01:00
|
|
|
apply plugin: "com.github.kt3k.coveralls"
|
|
|
|
coveralls {
|
|
|
|
sourceDirs = files(subprojects.sourceSets.main.allSource.srcDirs).files.absolutePath
|
|
|
|
}
|
|
|
|
|
|
|
|
task jacocoRootReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) {
|
|
|
|
dependsOn = projectsWithUnitTests.jacocoTestReport
|
|
|
|
sourceDirectories = files(projectsWithUnitTests.sourceSets.main.allSource.srcDirs)
|
|
|
|
classDirectories = files(projectsWithUnitTests.sourceSets.main.output)
|
|
|
|
executionData = files(projectsWithUnitTests.jacocoTestReport.executionData)
|
|
|
|
reports {
|
|
|
|
xml.enabled true
|
|
|
|
xml.destination ="${buildDir}/reports/jacoco/test/jacocoTestReport.xml"
|
|
|
|
}
|
|
|
|
// We could remove the following setOnlyIf line, but then
|
|
|
|
// jacocoRootReport would silently be SKIPPED if something with
|
|
|
|
// the projectsWithUnitTests is wrong (e.g. a project is missing
|
|
|
|
// in there).
|
|
|
|
setOnlyIf { true }
|
|
|
|
}
|
|
|
|
|
2015-03-03 14:06:21 +01:00
|
|
|
// Important to specify this task after the subprojects block
|
|
|
|
task clirrRootReport(type: org.kordamp.gradle.clirr.ClirrReportTask) {
|
|
|
|
dependsOn = subprojects.tasks.clirr
|
2015-03-12 13:22:11 +01:00
|
|
|
reports = files((subprojects.findAll { it.clirr.enabled == true }).tasks.clirr.xmlReport)
|
2015-03-03 14:06:21 +01:00
|
|
|
}
|
|
|
|
|
2015-03-18 09:52:33 +01:00
|
|
|
task integrationTest {
|
|
|
|
dependsOn project(':smack-integration-test').tasks.run
|
|
|
|
}
|
|
|
|
|
2014-02-14 18:13:51 +01:00
|
|
|
def getGitCommit() {
|
|
|
|
def dotGit = new File("$projectDir/.git")
|
|
|
|
if (!dotGit.isDirectory()) return 'non-git build'
|
|
|
|
|
2014-07-28 16:12:57 +02:00
|
|
|
def cmd = 'git describe --always --tags --dirty=+'
|
2014-02-14 18:13:51 +01:00
|
|
|
def proc = cmd.execute()
|
|
|
|
def gitCommit = proc.text.trim()
|
|
|
|
assert !gitCommit.isEmpty()
|
|
|
|
gitCommit
|
|
|
|
}
|
2014-09-22 09:58:09 +02:00
|
|
|
|
|
|
|
def getAndroidRuntimeJar() {
|
2014-10-05 12:34:00 +02:00
|
|
|
def androidHome = getAndroidHome()
|
2014-09-22 09:58:09 +02:00
|
|
|
def androidJar = new File("$androidHome/platforms/android-$smackMinAndroidSdk/android.jar")
|
|
|
|
if (androidJar.isFile()) {
|
|
|
|
return androidJar
|
|
|
|
} else {
|
|
|
|
throw new Exception("Can't find android.jar for $smackMinAndroidSdk API. Please install corresponding SDK platform package")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
def getAndroidJavadocOffline() {
|
2014-10-05 12:34:00 +02:00
|
|
|
def androidHome = getAndroidHome()
|
|
|
|
return androidHome.toString() + "/docs/reference"
|
2014-07-20 12:58:05 +02:00
|
|
|
}
|
2014-10-05 12:34:00 +02:00
|
|
|
|
|
|
|
def getAndroidHome() {
|
|
|
|
def androidHomeEnv = System.getenv("ANDROID_HOME")
|
|
|
|
if (androidHomeEnv == null) {
|
|
|
|
throw new Exception("ANDROID_HOME environment variable is not set")
|
|
|
|
}
|
|
|
|
def androidHome = new File(androidHomeEnv)
|
|
|
|
if (!androidHome.isDirectory()) throw new Exception("Environment variable ANDROID_HOME is not pointing to a directory")
|
|
|
|
return androidHome
|
2014-07-20 12:58:05 +02:00
|
|
|
}
|