forked from hierynomus/license-gradle-plugin
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
149 lines (127 loc) · 3.92 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
// First, apply the publishing plugin
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
jcenter()
}
}
dependencies {
classpath "com.gradle.publish:plugin-publish-plugin:0.9.1"
classpath 'com.netflix.nebula:gradle-extra-configurations-plugin:2.2.+'
}
}
defaultTasks 'build'
apply plugin: 'groovy'
apply plugin: 'idea'
apply plugin: "com.gradle.plugin-publish"
apply plugin: 'license'
group = 'nl.javadude.gradle.plugins'
version = "0.13.2-jive1"
sourceCompatibility = 1.7
targetCompatibility = 1.7
repositories { jcenter() }
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}
configurations.compile.transitive = false
dependencies {
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.maven-license-plugin:maven-license-plugin:1.10.b1') {
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:2.0.+'
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
}
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]'
}
}
}
pluginBundle {
website = "https://github.com/hierynomus/license-gradle-plugin"
vcsUrl = "https://github.com/hierynomus/license-gradle-plugin.git"
description = "Applies a header to files, typically a license"
plugins {
jythonPlugin {
id = "com.github.hierynomus.license"
displayName = "License plugin for Gradle"
tags = [ "gradle", "plugin", "license" ]
}
}
}
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")
}
}