-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathbuild.gradle
More file actions
122 lines (98 loc) · 2.97 KB
/
build.gradle
File metadata and controls
122 lines (98 loc) · 2.97 KB
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
buildscript {
repositories {
gradlePluginPortal()
}
// avoids requiring to whitelist spotless in plugin hub
if (gradle.startParameter.taskNames.any { it.contains('spotless') }) {
dependencies {
classpath("com.diffplug.gradle.spotless:com.diffplug.gradle.spotless.gradle.plugin:7.2.1")
}
}
}
plugins {
id 'java'
}
group = 'com.collectionlogmaster'
version = '1.3.1'
repositories {
mavenLocal()
maven {
url = 'https://repo.runelite.net'
content {
includeGroupByRegex("net\\.runelite.*")
}
}
mavenCentral()
}
def runeLiteVersion = 'latest.release'
dependencies {
compileOnly group: 'net.runelite', name:'client', version: runeLiteVersion
compileOnly 'org.jetbrains:annotations:23.0.0'
compileOnly 'org.projectlombok:lombok:1.18.30'
annotationProcessor 'org.projectlombok:lombok:1.18.30'
testImplementation 'junit:junit:4.12'
testImplementation group: 'net.runelite', name:'client', version: runeLiteVersion
testImplementation group: 'net.runelite', name:'jshell', version: runeLiteVersion
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
options.release.set(11)
}
tasks.register('shadowJar', Jar) {
dependsOn configurations.testRuntimeClasspath
manifest {
attributes('Main-Class': 'com.collectionlogmaster.CollectionLogMasterPluginTest', 'Multi-Release': true)
}
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from sourceSets.main.output
from sourceSets.test.output
from {
configurations.testRuntimeClasspath.collect { file ->
file.isDirectory() ? file : zipTree(file)
}
}
exclude 'META-INF/INDEX.LIST'
exclude 'META-INF/*.SF'
exclude 'META-INF/*.DSA'
exclude 'META-INF/*.RSA'
exclude '**/module-info.class'
group = BasePlugin.BUILD_GROUP
archiveClassifier.set('shadow')
archiveFileName.set("${rootProject.name}-${project.version}-all.jar")
}
processResources {
filesMatching ('**/version') {
filter {
it.replace('%PLUGIN_VERSION%', version)
}
}
}
if (gradle.startParameter.taskNames.any { it.contains('spotless') }) {
apply plugin: 'com.diffplug.spotless'
spotless {
ratchetFrom 'origin/main'
format 'misc', {
target '*.gradle', '.gitattributes', '.gitignore'
trimTrailingWhitespace()
leadingTabsToSpaces(4)
endWithNewline()
}
java {
toggleOffOn()
importOrder()
removeUnusedImports()
cleanthat()
leadingSpacesToTabs(4)
custom '@Annotation diff line', { it.replaceAll("(\n(\t+)@[A-Z][A-Za-z]+) ", "\$1\n\$2") }
}
flexmark {
target '**/*.md'
flexmark()
}
json {
target 'src/**/*.json'
targetExclude 'src/main/resources/**/task-list.json'
gson()
}
}
}