forked from nic-bell/license-gradle-plugin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
203 lines (171 loc) · 5.36 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
// First, apply the publishing plugin
buildscript {
repositories {
gradlePluginPortal()
google()
jcenter()
}
dependencies {
classpath "com.gradle.publish:plugin-publish-plugin:0.9.1"
classpath 'com.netflix.nebula:gradle-extra-configurations-plugin:2.2.2'
}
}
plugins {
id 'com.gradle.build-scan' version '2.0.2'
id 'groovy'
id 'idea'
id "org.ajoberstar.release-opinion" version "1.4.2"
id 'com.gradle.plugin-publish' version '0.10.0'
id 'java-gradle-plugin'
id 'ru.vyarus.animalsniffer' version '1.5.1'
}
buildScan {
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
}
apply plugin: 'com.github.hierynomus.license'
defaultTasks 'build'
group = 'com.hierynomus.gradle.plugins'
sourceCompatibility = 1.7
targetCompatibility = 1.7
repositories {
gradlePluginPortal()
google()
jcenter()
}
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}
release {
grgit = org.ajoberstar.grgit.Grgit.open(project.projectDir)
}
configurations.compile.transitive = false
dependencies {
signature 'org.codehaus.mojo.signature:java17:1.0@signature'
compile "org.codehaus.plexus:plexus-utils:2.0.5"
compile "com.mycila.xmltool:xmltool:3.3"
// Using compile instead of groovy, so that it goes into the pom
compile('com.mycila:license-maven-plugin:3.0') {
exclude group: 'org.apache.maven', module: 'maven-plugin-api'
exclude group: 'org.apache.maven', module: 'maven-project'
}
compile gradleApi()
def androidGradlePlugin = 'com.android.tools.build:gradle:3.6.3'
compileOnly androidGradlePlugin
testCompile androidGradlePlugin
testCompile gradleTestKit()
testCompile 'com.netflix.nebula:nebula-test:4.4.3'
testCompile 'junit:junit:4.11'
testCompile 'com.google.guava:guava:17.0'
testCompile('org.spockframework:spock-core:1.0-groovy-2.4') {
exclude group: 'org.codehaus.groovy', module: 'groovy-all'
}
}
// This disables the pedantic doclint feature of JDK8
if (JavaVersion.current().isJava8Compatible()) {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
license {
ignoreFailures true
}
animalsniffer {
excludeJars 'gradle-api-*'
ignoreFailures true
}
test {
afterSuite { descriptor, result ->
def indicator = "\u001B[32m✓\u001b[0m"
if (result.failedTestCount > 0) {
indicator = "\u001B[31m✘\u001b[0m"
}
logger.lifecycle("$indicator Test ${descriptor.name}; Executed: ${result.testCount}/\u001B[32m${result.successfulTestCount}\u001B[0m/\u001B[31m${result.failedTestCount}\u001B[0m")
}
}
def pomConfig = {
name project.name
description project.project_description
url project.project_url
inceptionYear '2011'
scm { url project.project_scm }
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 'hierynomus'
name 'Jeroen van Erp'
url 'http://www.javadude.nl/'
email '[email protected]'
roles { role 'Developer' }
}
}
contributors {
contributor {
name 'Tim Harsch'
email '[email protected]'
}
contributor {
name 'Justin Ryan'
email '[email protected]'
}
}
}
gradlePlugin {
plugins {
licensePlugin {
id = "com.github.hierynomus.license"
implementationClass = "nl.javadude.gradle.plugins.license.LicensePlugin"
}
licenseBasePlugin {
id = "com.github.hierynomus.license-base"
implementationClass = "com.hierynomus.gradle.license.LicenseBasePlugin"
}
licenseReportPlugin {
id = "com.github.hierynomus.license-report"
implementationClass = "com.hierynomus.gradle.license.LicenseReportingPlugin"
}
}
}
pluginBundle {
website = "https://github.com/hierynomus/license-gradle-plugin"
vcsUrl = "https://github.com/hierynomus/license-gradle-plugin.git"
tags = ["gradle", "plugin", "license"]
plugins {
licensePlugin {
displayName = "License plugin for Gradle"
description = "Applies a header to files, typically a license"
}
licenseBasePlugin {
displayName = "Base License plugin for Gradle"
description = "Base plugin to apply a header to files, typically a license"
}
licenseReportPlugin {
displayName = "License Report plugin for Gradle"
description = "Reports over licenses"
tags = ["gradle", "plugin", "license", "report"]
}
}
}
if (!System.env.containsKey("JENKINS_URL")) {
def javaVersion = System.properties['java.version']
if (JavaVersion.toVersion(javaVersion) != project.targetCompatibility) {
// throw new GradleException("Expected Java version ${project.targetCompatibility} but running with $javaVersion")
}
}