-
Notifications
You must be signed in to change notification settings - Fork 38
/
build.gradle
127 lines (107 loc) · 4.04 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
plugins {
id 'com.gradle.build-scan' version '2.0.2'
id 'org.ysb33r.gradletest' version '2.0-rc.4' apply false
id 'org.ajoberstar.github-pages' version '1.2.0' apply false
id 'com.github.hierynomus.license' version '0.14.0' apply false
id 'io.ratpack.ratpack-java' version "1.6.1" apply false
id 'com.gradle.plugin-publish' version '1.1.0'
}
buildScan {
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
}
allprojects {
apply plugin: 'idea'
if (!releaseBuild) {
version = "${version}-SNAPSHOT"
}
defaultTasks 'check', 'assemble'
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
ext {
olderJRubyVersion = '9.4.1.0'
spockVersion = "org.spockframework:spock-core:1.2-groovy-2.4"
pluginExtraText = (version.contains('-alpha') || version.contains('-beta')) ?
'(If you need a production-ready version of the JRuby/Gradle plugin use a 1.7.x release instead)' : ''
}
}
subprojects {
repositories {
mavenCentral()
gradlePluginPortal()
}
if (project.name != 'docs') {
apply plugin: TestConfigPlugin
apply plugin: 'java-gradle-plugin'
apply plugin: 'groovy'
apply plugin: 'codenarc'
apply plugin: 'org.ysb33r.gradletest'
apply plugin: 'com.gradle.plugin-publish'
apply from: "${rootProject.projectDir}/gradle/integration-tests.gradle"
apply from: "${rootProject.projectDir}/gradle/license.gradle"
dependencies {
compile localGroovy()
compile gradleApi()
compile "org.ysb33r.gradle:grolifant60:${grolifantVersion}"
gradleTestRuntime "org.ysb33r.gradle:grolifant60:${grolifantVersion}"
}
codenarc {
sourceSets = [sourceSets.main]
configFile = file("${rootProject.projectDir}/gradle/codenarc.groovy")
}
test {
testLogging {
showStandardStreams = true
exceptionFormat "full"
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
gradleTest {
// https://github.com/jruby-gradle/jruby-gradle-plugin/issues/346
if (JavaVersion.current().java11) {
versions '5.0', '5.4.1', '6.0.1', '6.7', '7.6.1'
} else {
versions '4.10.2', '5.3.1', '6.0.1', '6.7', '7.6.1'
if (project.name == 'jruby-gradle-core-plugin') {
versions '4.3'
} else {
versions '4.9'
}
}
dependsOn jar
}
gradlePlugin {
website = 'https://github.com/jruby-gradle/jruby-gradle-plugin' // 'http://jruby-gradle.org/'
vcsUrl = 'https://github.com/jruby-gradle/jruby-gradle-plugin.git'
}
tasks.withType(Test) {
if (gradle.startParameter.isOffline()) {
systemProperties 'TESTS_ARE_OFFLINE': '1'
}
}
tasks.withType(CodeNarc) { codenarcSourceSetTask ->
def reportName = (codenarcSourceSetTask.name - 'codenarc').uncapitalize()
def ideReport = reports.add(org.gradle.api.reporting.internal.TaskGeneratedSingleFileReport, 'ide', reports.task)
ideReport.enabled = true
ideReport.destination = file("${project.codenarc.reportsDir}/${reportName}.ide.txt")
}
tasks.withType(ValidateTaskProperties) { validateTaskProperties ->
validateTaskProperties.failOnWarning = true
validateTaskProperties.enableStricterValidation = true
}
}
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}
}
task release(type: Exec) {
description 'Create and upload a release'
dependsOn subprojects.findAll { it.name != 'docs' }.collect { ":${it.name}:bintrayUpload" }
commandLine 'git', 'tag', "v${project.version}"
}