Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
186 lines (156 sloc) 4.99 KB
/*
* Copyright 2018-1019 Andres Almiray.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
id 'org.kordamp.gradle.project' version '0.12.0'
id 'org.kordamp.gradle.bintray' version '0.12.0'
id 'com.gradle.plugin-publish' version '0.10.0' apply false
id 'com.gradle.build-scan' version '2.1'
}
buildScan {
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
}
if (!project.hasProperty('bintrayUsername')) ext.bintrayUsername = ''
if (!project.hasProperty('bintrayApiKey')) ext.bintrayApiKey = ''
config {
release = (rootProject.findProperty('release') ?: false).toBoolean()
info {
name = rootProject.name
vendor = 'Kordamp'
description = 'A collection of opinionated Gradle plugins'
inceptionYear = '2018'
tags = ['project', 'configuration']
links {
website = "https://github.com/aalmiray/${rootProject.name}"
issueTracker = "https://github.com/aalmiray/${rootProject.name}/issues"
scm = "https://github.com/aalmiray/${rootProject.name}.git"
}
specification {
enabled = false
}
implementation {
enabled = false
}
people {
person {
id = 'aalmiray'
name = 'Andres Almiray'
roles = ['developer']
}
}
}
javadoc {
enabled = false
}
groovydoc {
replaceJavadoc = true
options {
link 'https://docs.gradle.org/4.0/javadoc/', 'org.gradle.'
}
}
license {
licenses {
license {
id = 'Apache-2.0'
}
}
}
bintray {
credentials {
username = project.bintrayUsername
password = project.bintrayApiKey
}
repo = 'kordamp'
userOrg = 'aalmiray'
name = rootProject.name
}
}
allprojects {
apply plugin: 'idea'
repositories {
jcenter()
maven { url 'https://plugins.gradle.org/m2/' }
flatDir { dir rootProject.file('libraries') }
}
dependencyUpdates.resolutionStrategy = {
componentSelection { rules ->
rules.all { selection ->
boolean rejected = ['alpha', 'beta', 'rc', 'cr'].any { qualifier ->
selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/
}
if (rejected) {
selection.reject('Release candidate')
}
}
}
}
}
subprojects {
if (project.name.endsWith('-plugin')) {
apply plugin: 'groovy'
apply plugin: 'java-gradle-plugin'
config {
info {
description = project.project_description
}
bintray { enabled = true }
}
dependencies {
compile gradleApi()
testCompile("org.spockframework:spock-core:$spockVersion") {
exclude group: 'org.codehaus.groovy'
}
}
compileGroovy {
sourceCompatibility = project.sourceCompatibility
targetCompatibility = project.targetCompatibility
}
bintray {
pkg {
version {
attributes = ['gradle-plugin': "${project.pluginId}:${project.group}:${project.name}"]
}
}
}
apply plugin: 'com.gradle.plugin-publish'
gradlePlugin {
plugins {
"${project.pluginShortName}Plugin" {
id = project.pluginId
implementationClass = project.pluginImplementationClass
}
}
}
task publishRelease(dependsOn: [bintrayUpload, publishPlugins]) {}
pluginBundle {
website = "https://github.com/aalmiray/${rootProject.name}"
vcsUrl = "https://github.com/aalmiray/${rootProject.name}.git"
description = project.project_description
tags = ['project', 'configuration']
plugins {
"${project.pluginShortName}Plugin" {
id = project.pluginId
displayName = project.displayName
}
}
mavenCoordinates {
groupId = project.group
artifactId = project.name
version = project.version
}
}
}
}