This repository has been archived by the owner on Jul 17, 2023. It is now read-only.
/
build.gradle
186 lines (151 loc) · 3.43 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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
plugins {
id 'java'
id 'org.jetbrains.kotlin.jvm'
id 'org.jetbrains.kotlin.plugin.serialization'
id 'distribution'
id 'application'
id 'com.diffplug.spotless'
id 'de.undercouch.download'
}
group "$group"
archivesBaseName = "$name"
version "$version"
sourceCompatibility = "$jvmTarget"
project.ext {
licenseDir = new File('licenses', buildDir)
toolDir = new File('tools', buildDir)
}
allprojects {
apply plugin: 'distribution'
apply plugin: 'org.jetbrains.kotlin.jvm'
apply plugin: 'org.jetbrains.kotlin.plugin.serialization'
apply plugin: 'com.diffplug.spotless'
repositories {
jcenter()
mavenCentral()
maven { url 'https://jitpack.io' }
maven { url 'https://github.com/eugener/oxbow/raw/master/maven/repository' }
}
spotless {
ratchetFrom 'origin/rewrite'
java {
importOrder()
removeUnusedImports()
googleJavaFormat()
licenseHeader "$licenseHeader\n\n"
}
groovyGradle {
target '*.gradle'
greclipse()
}
kotlin {
ktlint()
licenseHeader "$licenseHeader\n\n"
}
format 'misc', {
target '*.md', '.gitignore'
trimTrailingWhitespace()
indentWithTabs()
endWithNewline()
}
}
compileKotlin {
kotlinOptions.jvmTarget = sourceCompatibility
}
}
startScripts {
executableDir = ""
}
distributions {
//noinspection GroovyAssignabilityCheck
main {
contents {
from files('README.MD', 'LICENSE')
from startScripts
into('data') {
from files('data')
}
into('licenses') {
from files("$buildDir/licenses")
}
into('tools') {
from files("$buildDir/tools")
}
subprojects.each { p ->
into('plugins') {
from p.getTasksByName("jar", true)
}
}
}
}
}
distZip {
eachFile { file ->
def list = []
// Collect a list of all the JARs produced by submodules
subprojects.each { p ->
if (
!(p.name in ["master", "core", "launcher"]) &&
p.getTasksByName("jar", true).archiveFile.size > 0
) {
list.add(
p.getTasksByName("jar", true)
.archiveFile.first()
.getAsFile().get()
)
}
}
// Files in /bin are copied to the main directory
// so we can exclude them
if (file.path.contains('bin')) {
file.exclude()
} else if (file.path.contains('lib') &&
// Check if the current file is a submodule
file.getFile() in list
|| file.name =~ /discordrpc*./
|| file.name =~ /pluginmanager*./
|| file.name =~ /Quiver-\d\.\d\.\d\.jar/
|| file.name =~ /settingsgui*./
|| file.name =~ /sniffle*./
|| file.name =~ /tipoftheday*./) {
file.exclude()
}
}
}
run {
/*applicationDefaultJvmArgs = [
"-XX:+UseG1GC"
]*/
args = ['indev']
doFirst {
file('run').mkdirs()
copy {
from 'data'
into 'run/data'
}
}
workingDir 'run'
dependencies {
implementation project(':core')
runtimeOnly project(':launcher')
runtimeOnly project(':foldertree')
runtimeOnly project(':filetable')
runtimeOnly project(':filepanel')
runtimeOnly project(':textviewer')
runtimeOnly project(':tableviewer')
runtimeOnly project(':imageviewer')
runtimeOnly project(':treeviewer')
runtimeOnly project(':markdownviewer')
runtimeOnly project(':spritesheetviewer')
runtimeOnly project(':packexport')
runtimeOnly project(':packsquashstep')
runtimeOnly project(':zipstep')
runtimeOnly "sniffle:discordrpc"
runtimeOnly "sniffle:pluginmanager"
runtimeOnly "sniffle:settingsgui"
runtimeOnly "sniffle:tipoftheday"
}
application {
mainClassName = 'com.deflatedpickle.quiver.launcher.MainKt'
}
}