-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
176 lines (137 loc) · 4.87 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
plugins {
id 'java'
id 'application'
// id 'com.github.johnrengelman.shadow' version '6.1.0'
id 'org.beryx.runtime' version '1.12.4'
}
switch (org.gradle.internal.os.OperatingSystem.current()) {
case org.gradle.internal.os.OperatingSystem.LINUX:
project.ext.lwjglNatives = "natives-linux"
break
case org.gradle.internal.os.OperatingSystem.MAC_OS:
project.ext.lwjglNatives = "natives-macos"
break
case org.gradle.internal.os.OperatingSystem.WINDOWS:
project.ext.lwjglNatives = System.getProperty("os.arch").contains("64") ? "natives-windows" : "natives-windows-x86"
break
default:
project.ext.lwjglNatives = "natives-linux"
break
}
group 'uk.co.innoxium.candor'
version '0.3.0-Pre4'
//apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'java'
apply from: 'publish.gradle'
mainClassName = 'uk.co.innoxium.candor.CandorLauncher'
def repsyUser = "user"
def repsyPass = "passw"
// Enforce java 14 toolchain, as jpackage breaks log4j2 on jkd15+
java {
toolchain {
languageVersion = JavaLanguageVersion.of(16)
vendor = JvmVendorSpec.ADOPTOPENJDK
}
withJavadocJar()
withSourcesJar()
}
repositories {
jcenter()
mavenCentral()
maven { url "https://jitpack.io" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url 'https://repository.apache.org/snapshots' }
maven {
name 'Innoxium Repo'
url "https://repo.repsy.io/mvn/innoxium/innoxium/"
}
}
dependencies {
// Anything accessed by using libs.something can be found in /gradle/libs.version.toml - a gradle 7 feature preview
implementation libs.bundles.innoxium
implementation libs.nightconfig
implementation libs.miglayout
implementation libs.bundles.google
implementation libs.bundles.apache
implementation libs.uuidcreator
// Includes disruptor for async logging
implementation libs.bundles.log4j
implementation libs.appdirs
// Async http client - BOM's should not go in version catalog, maybe in the future?
implementation platform("org.asynchttpclient:async-http-client-bom:2.12.3")
implementation "org.asynchttpclient:async-http-client"
// Flat LAF
implementation libs.bundles.flatlaf
// EA Async, adds async/await like .NET has
implementation libs.eaasync
// We want native file dialogs, lets use LWJGL for that
implementation platform("org.lwjgl:lwjgl-bom:3.3.0-SNAPSHOT")
implementation "org.lwjgl:lwjgl"
implementation "org.lwjgl:lwjgl-nfd"
implementation "org.lwjgl:lwjgl-tinyfd"
implementation 'org.jetbrains:annotations:20.1.0'
runtimeOnly "org.lwjgl:lwjgl::natives-windows"
runtimeOnly "org.lwjgl:lwjgl::natives-macos"
runtimeOnly "org.lwjgl:lwjgl::natives-linux"
runtimeOnly "org.lwjgl:lwjgl-nfd::natives-windows"
runtimeOnly "org.lwjgl:lwjgl-nfd::natives-macos"
runtimeOnly "org.lwjgl:lwjgl-nfd::natives-linux"
runtimeOnly "org.lwjgl:lwjgl-tinyfd::natives-windows"
runtimeOnly "org.lwjgl:lwjgl-tinyfd::natives-macos"
runtimeOnly "org.lwjgl:lwjgl-tinyfd::natives-linux"
// Record builder
annotationProcessor 'io.soabase.record-builder:record-builder-processor:1.19'
compileOnly 'io.soabase.record-builder:record-builder-core:1.19'
}
jar {
manifest {
attributes 'Main-Class': 'uk.co.innoxium.candor.CandorLauncher'
attributes 'Premain-Class': 'ca.cgjennings.jvm.JarLoader'
attributes 'SplashScreen-Image': 'splash.png'
// Set Class Path
attributes ("Class-Path": configurations.runtimeClasspath.collect { "libs/" + it.getName()}.join(' '))
}
}
task copyBuild(type: Copy) {
dependsOn 'build'
from "$buildDir/libs"
include String.format("CandorManager-" + String.valueOf(version) + ".jar")
into "$buildDir/package"
}
task copyLibs(type: Copy) {
from configurations.runtimeClasspath
into "$buildDir/package/libs"
}
task zipCandor(type: Zip) {
dependsOn 'copyBuild', 'copyLibs'
from "$buildDir/package"
// include '*'
// include '*/*'
exclude '*.zip'
archiveFileName = 'CandorModManager.zip'
destinationDirectory = file("$buildDir/package")
}
task packageCandor() {
dependsOn 'clean', 'copyBuild', 'copyLibs', 'zipCandor'
}
//task sourcesJar(type: Jar, dependsOn: classes) {
//
// archiveClassifier.convention("sources")
// archiveClassifier.set("sources")
// from sourceSets.main.allSource
//}
//
//task javadocJar(type: Jar, dependsOn: javadoc) {
// archiveClassifier.convention("javadoc")
// archiveClassifier.set("javadoc")
// from javadoc.destinationDir
//}
tasks.withType(Javadoc) {
failOnError false
options.addStringOption('Xdoclint:none', '-quiet')
options.addStringOption('encoding', 'UTF-8')
options.addStringOption('charSet', 'UTF-8')
}
//jar.finalizedBy javadocJar
//jar.finalizedBy sourcesJar