forked from GradleUp/shadow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
117 lines (97 loc) · 2.93 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
import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation
buildscript {
repositories {
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.1'
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.7.5"
classpath "com.gradle.publish:plugin-publish-plugin:0.10.0"
classpath 'org.ajoberstar:grgit:2.1.1'
classpath 'org.ajoberstar:gradle-git-publish:0.3.3'
classpath "com.moowork.gradle:gradle-node-plugin:1.2.0"
}
}
plugins {
id 'com.gradle.build-scan' version '2.1'
id 'groovy'
id 'project-report'
id 'idea'
id 'java-gradle-plugin'
}
// Remove the gradleApi so it isn't merged into the jar file.
configurations.compile.dependencies.remove dependencies.gradleApi()
gradlePlugin {
automatedPublishing = false
}
apply plugin: 'com.github.johnrengelman.shadow'
buildScan {
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
if (System.env.CI == 'true') {
tag 'CI'
if (System.env.CIRCLE_TAG) {
link 'VCS', "https://github.com/johnrengelman/shadow/tree/${System.env.CIRCLE_TAG}"
} else {
link 'VCS', "https://github.com/johnrengelman/shadow/tree/${System.env.CIRCLE_BRANCH}"
}
link 'VCS Commit', "https://github.com/johnrengelman/shadow/commit/${System.env.CIRCLE_SHA1}"
if (System.env.CI_PULL_REQUEST) {
link 'Pull Request', "${System.env.CI_PULL_REQUEST}"
}
}
}
apply from: file('gradle/docs.gradle')
apply from: file('gradle/publish.gradle')
apply from: file('gradle/vuepress.gradle')
apply from: file('gradle/ghPages.gradle')
apply from: file('gradle/dependencies.gradle')
repositories {
jcenter()
}
test {
if (System.env.CI == 'true') {
testLogging.showStandardStreams = true
minHeapSize "1g"
maxHeapSize "1g"
}
}
jar {
from rootProject.file('LICENSE')
from rootProject.file('NOTICE')
}
jar.enabled = false
shadowJar {
classifier = ''
}
idea {
project {
languageLevel = '1.7'
}
}
sourceCompatibility = '1.7'
targetCompatibility = '1.7'
task downloadDependencies(type: Exec) {
dependsOn configurations.testRuntime
commandLine 'echo', 'Downloaded all dependencies'
}
tasks.build.dependsOn tasks.shadowJar
project.tasks.withType(JavaCompile) {
// This will be the default in Gradle 5.0
if (!options.compilerArgs.contains("-processor")) {
options.compilerArgs << '-proc:none'
}
}
project.tasks.withType(GroovyCompile) {
// This will be the default in Gradle 5.0
if (!options.compilerArgs.contains("-processor")) {
options.compilerArgs << '-proc:none'
}
}
task relocateShadowJar(type: ConfigureShadowRelocation) {
target = tasks.shadowJar
}
tasks.shadowJar.dependsOn tasks.relocateShadowJar