-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
157 lines (131 loc) · 3.69 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
import org.gradle.plugins.ide.eclipse.model.AbstractLibrary
import org.gradle.plugins.ide.eclipse.model.internal.FileReferenceFactory
plugins {
alias(libs.plugins.publish) apply false
alias(libs.plugins.test.logger) apply false
alias(libs.plugins.licenser) apply false
}
wrapper {
gradleVersion = '7.6'
distributionType = Wrapper.DistributionType.ALL
}
subprojects {
apply plugin: 'com.adarshr.test-logger'
apply plugin: 'org.cadixdev.licenser'
apply plugin: 'maven-publish'
apply plugin: 'java-library'
apply plugin: 'eclipse'
apply plugin: 'jacoco'
if(project.name != "core" && project.name != "testing")
{
apply plugin: 'com.gradle.plugin-publish'
apply plugin: 'java-gradle-plugin'
}
if(project.name != "core") {
tasks.withType(Javadoc).all { enabled = false }
}
apply from: '../gradle/script.utils.gradle'
group = "net.galacticraft"
java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
vendor = JvmVendorSpec.ADOPTIUM
}
}
sourceSets {
test {
java.srcDirs('src/test/java')
resources.srcDirs('src/test/resources')
}
}
configurations {
implementation.extendsFrom suite
compileOnly.extendsFrom includedSuite
}
configurations.suite {
resolutionStrategy {
cacheChangingModulesFor 0, 'seconds'
cacheDynamicVersionsFor 0, 'seconds'
}
}
dependencies {
compileOnly gradleApi()
implementation libs.annotations
compileOnly libs.lombok
annotationProcessor libs.lombok
testCompileOnly libs.lombok
testAnnotationProcessor libs.lombok
testImplementation libs.assertj
testImplementation libs.junit.api
testImplementation libs.junit.params
testImplementation libs.mockito
testRuntimeOnly libs.junit.engine
}
license {
header = rootProject.file("HEADER.txt")
include '**/*.java'
properties {
name = "${projectName}"
organization = "${organization}"
url = "${url}"
}
}
tasks.withType(Copy).all {
duplicatesStrategy 'exclude'
}
apply from: '../gradle/script.jacoco.gradle'
def srcFolder = file("C:\\gradle\\gradle-${project.gradle.gradleVersion}\\src")
eclipse {
classpath {
file {
whenMerged { classpath ->
String version = project.gradle.gradleVersion
String gradleSourceDirectory = srcFolder.getAbsolutePath()
classpath.entries.each { entry ->
if (entry in AbstractLibrary && entry.library.path.contains('generated-gradle-jars')) {
entry.sourcePath =
new FileReferenceFactory().fromPath(gradleSourceDirectory)
}
}
}
}
}
}
checkLicenseMain.dependsOn licenseFormat
tasks.named("build").configure {
build {
println "Building ${project.name} | Version: ${project.version}"
}
}
publishing {
repositories {
maven {
name 'GCGradlePlugins'
url 'https://maven.galacticraft.net/repository/gradle-plugins/'
credentials {
username = project.hasProperty('NEXUS_USERNAME') ? project.NEXUS_USERNAME : ''
password = project.hasProperty('NEXUS_PASSWORD') ? project.NEXUS_PASSWORD : ''
}
}
}
}
ext {
excludeGroup = [
'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA',
'META-INF/LICENSE*', 'META-INF/DEPENDENCIES',
'META-INF/NOTICE*', 'META-INF/versions/**',
'META-INF/maven/**', 'Log4j*', '_EMPTY_',
'LICENSE.*', 'META-INF/*.kotlin_module',
'META-INF/services/**', 'META-INF/com.android.tools/**',
'module-info.class', 'licenses', 'kotlin'
]
setMainManifestProps = { Manifest manifest->
manifest.attributes (
'Implementation-Title' : "${projectName}",
'Implementation-Version' : project.version,
'Implementation-Vendor' : "${organization}",
'Implementation-Timestamp' : new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
)
}
}
}