rpm/build.gradle

96 lines
2.6 KiB
Groovy
Raw Permalink Normal View History

import java.time.ZonedDateTime
import java.time.format.DateTimeFormatter
2017-10-07 13:14:33 +02:00
plugins {
id "org.sonarqube" version "2.6.2"
id "io.codearte.nexus-staging" version "0.11.0"
}
printf "Date: %s\nHost: %s\nOS: %s %s %s\nJava: %s %s %s %s\nGradle: %s Groovy: %s Java: %s\n" +
"Build: group: ${project.group} name: ${project.name} version: ${project.version}\n",
ZonedDateTime.now().format(DateTimeFormatter.ISO_DATE_TIME),
InetAddress.getLocalHost(),
System.getProperty("os.name"),
System.getProperty("os.arch"),
System.getProperty("os.version"),
System.getProperty("java.version"),
System.getProperty("java.vm.version"),
System.getProperty("java.vm.vendor"),
System.getProperty("java.vm.name"),
gradle.gradleVersion, GroovySystem.getVersion(), JavaVersion.current()
ext {
user = 'xbib'
projectName = 'rpm'
projectDescription = 'Java 8 RPM implementation with plugins for Ant, Maven, Gradle'
scmUrl = 'https://github.com/xbib/rpm'
scmConnection = 'scm:git:git://github.com/xbib/rpm.git'
scmDeveloperConnection = 'scm:git:git://github.com/xbib/rpm.git'
2017-10-07 13:14:33 +02:00
}
subprojects {
2017-10-07 13:14:33 +02:00
apply plugin: 'java'
apply plugin: 'maven'
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
testCompile "junit:junit:${project.property('junit.version')}"
2017-10-07 13:14:33 +02:00
}
compileJava {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
compileTestJava {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
2017-10-07 13:14:33 +02:00
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:all" << "-profile" << "compact1"
}
test {
testLogging {
showStandardStreams = false
exceptionFormat = 'full'
}
}
clean {
delete 'out'
}
sonarqube {
properties {
property "sonar.projectName", "xbib RPM"
property "sonar.sourceEncoding", "UTF-8"
property "sonar.tests", "src/test/java"
property "sonar.scm.provider", "git"
property "sonar.junit.reportsPath", "build/test-results/test/"
}
}
task sourcesJar(type: Jar) {
2017-10-07 13:14:33 +02:00
classifier 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar) {
2017-10-07 13:14:33 +02:00
classifier 'javadoc'
}
2017-10-07 13:14:33 +02:00
artifacts {
archives sourcesJar, javadocJar
}
apply from: "${rootProject.projectDir}/gradle/publish.gradle"
}