This repository has been archived by the owner on Aug 1, 2024. It is now read-only.
forked from GradleUp/shadow
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
76 lines (62 loc) · 2.49 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
import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
id 'groovy'
id 'project-report'
id 'idea'
id 'java-gradle-plugin'
id 'signing'
id 'com.gradle.plugin-publish' version '1.2.1'
id 'org.ajoberstar.git-publish' version '4.2.2'
id 'com.github.node-gradle.node' version '7.0.2'
}
apply plugin: ShadowPlugin
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')
tasks.withType(Test).configureEach {
useJUnitPlatform()
// https://docs.gradle.org/8.8/userguide/performance.html#execute_tests_in_parallel
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
if (System.env.CI == 'true') {
testLogging.showStandardStreams = true
minHeapSize "1g"
maxHeapSize "1g"
}
systemProperty 'java.io.tmpdir', project.layout.buildDirectory.asFile.get().absolutePath
// Required to test configuration cache in tests when using withDebug()
// https://github.com/gradle/gradle/issues/22765#issuecomment-1339427241
jvmArgs(
"--add-opens", "java.base/java.util=ALL-UNNAMED",
"--add-opens", "java.base/java.util.concurrent.atomic=ALL-UNNAMED",
"--add-opens", "java.base/java.lang.invoke=ALL-UNNAMED",
"--add-opens", "java.base/java.net=ALL-UNNAMED",
)
}
// Remove the gradleApi so it isn't merged into the jar file.
// This is required because 'java-gradle-plugin' adds gradleApi() to the 'api' configuration.
// See https://github.com/gradle/gradle/blob/972c3e5c6ef990dd2190769c1ce31998a9402a79/subprojects/plugin-development/src/main/java/org/gradle/plugin/devel/plugins/JavaGradlePluginPlugin.java#L161
configurations.named(JavaPlugin.API_CONFIGURATION_NAME) {
dependencies.remove(project.dependencies.gradleApi())
}
tasks.named('shadowJar', ShadowJar) {
from rootProject.file('LICENSE')
from rootProject.file('NOTICE')
enableRelocation true
}
idea {
project {
languageLevel = '1.8'
}
}
tasks.named('ideaModule') {
notCompatibleWithConfigurationCache("https://github.com/gradle/gradle/issues/13480")
}
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
tasks.register('downloadDependencies', Exec) {
dependsOn configurations.testRuntimeClasspath
commandLine 'echo', 'Downloaded all dependencies'
}