ziggy/buildSrc/build.gradle

132 lines
4.1 KiB
Groovy

/**
* This is the buildSrc/build.gradle file. This should contain a minimal
* amount of dependencies as this is used by the build system itself.
*/
plugins {
id 'eclipse'
id 'java'
id 'maven-publish'
}
defaultTasks 'publish'
repositories {
mavenCentral()
}
dependencies {
// Needed to compile buildSrc.
implementation 'com.google.guava:guava:33.4.+'
implementation 'commons-io:commons-io:2.18.+'
implementation 'jakarta.xml.bind:jakarta.xml.bind-api:3.0.+'
implementation 'org.apache.commons:commons-exec:1.4.+'
implementation 'org.apache.commons:commons-lang3:3.17.+'
runtimeOnly 'com.sun.xml.bind:jaxb-impl:3.0.+'
// Needed to compile unit tests.
testImplementation 'junit:junit:4.13.+'
testImplementation 'org.mockito:mockito-core:4.8.+'
// The following stuff is needed in order to build custom gradle tasks and plugins.
implementation gradleApi()
implementation localGroovy()
}
tasks.withType(JavaCompile) {
options.deprecation = true
// Avoid the Eclipse "Project XXX has no explicit encoding set" warning.
// Until Eclipse Buildship issue #344 is fixed, remove the warning
// in Eclipse by using C-1 to apply a Quick Fix on the warning message.
options.encoding = 'UTF-8'
// Suppresses "Note: Hibernate JPA 2 Static-Metamodel Generator 6.2.32.Final" output
logging.captureStandardError LogLevel.INFO
}
test {
testLogging {
showStandardStreams = true
}
}
eclipse {
classpath {
defaultOutputDir = file("$buildDir/eclipse/default")
// outputBaseDir = file("$buildDir/eclipse")
downloadSources = false
downloadJavadoc = false
// Gradle 4.4 now specifies all of the output directories, but puts
// them in the Eclipse default of "bin". There is a feature request
// to add classpath.outputBaseDir that has the same syntax and effect
// as the now-useless defaultOutputDir. In the meantime, update the
// path manually.
file.whenMerged {
entries.each { entry ->
if (entry.kind == "src" && entry.hasProperty("output")) {
// The use of $buildDir does not return build.
entry.output = entry.output.replace("bin/", "build/eclipse/")
}
}
}
}
}
// Avoid duplicate classpath entries.
tasks.eclipse.dependsOn(cleanEclipse)
// Publish ziggy-buildSrc.jar. See also $rootDir/script-utils/publish.gradle.
publishing {
publications {
ziggyBuildSrc(MavenPublication) {
groupId = group
from components.java
artifactId = "ziggy-buildSrc"
version = version
// Maven doesn't understand 2.17.+ notation.
suppressPomMetadataWarningsFor('runtimeElements')
pom {
name = 'Ziggy BuildSrc'
description = 'Ziggy Gradle build library'
url = 'https://github.com/nasa/ziggy'
licenses {
license {
name = 'NASA Open Source Agreement Version 1.3'
url = 'https://github.com/nasa/ziggy/blob/main/LICENSE.pdf'
}
}
developers {
developer {
id = 'quarkpt'
name = 'Peter Tenenbaum'
email = 'Peter.Tenenbaum@nasa.gov'
}
developer {
id = 'wohler'
name = 'Bill Wohler'
email = 'Bill.Wohler@nasa.gov'
}
}
scm {
connection = 'scm:git:https://github.com/nasa/ziggy.git'
developerConnection = 'scm:git:git@github.com:nasa/ziggy.git'
url = 'https://github.com/nasa/ziggy'
}
}
}
}
repositories {
maven {
name = 'ziggyBuildSrc'
url = layout.buildDirectory.dir("repository")
}
}
}
build.dependsOn publish