forked from GradleUp/shadow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
119 lines (98 loc) · 2.97 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
import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation
buildscript {
repositories {
gradlePluginPortal()
mavenCentral()
}
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5'
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.21.0"
classpath "com.gradle.publish:plugin-publish-plugin:0.14.0"
classpath 'org.ajoberstar:gradle-git-publish:3.0.0'
classpath "com.github.node-gradle:gradle-node-plugin:3.0.1"
}
}
plugins {
id 'groovy'
id 'project-report'
id 'idea'
id 'java-gradle-plugin'
id 'signing'
}
// Remove the gradleApi so it isn't merged into the jar file.
configurations.named(JavaPlugin.API_CONFIGURATION_NAME) {
dependencies.remove(project.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 {
gradlePluginPortal()
mavenCentral()
}
test {
if (System.env.CI == 'true') {
testLogging.showStandardStreams = true
minHeapSize "1g"
maxHeapSize "1g"
}
systemProperty 'java.io.tmpdir', buildDir.absolutePath
}
jar {
from rootProject.file('LICENSE')
from rootProject.file('NOTICE')
}
jar.enabled = false
shadowJar {
classifier = ''
}
idea {
project {
languageLevel = '1.8'
}
}
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
task downloadDependencies(type: Exec) {
dependsOn configurations.testRuntimeClasspath
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