forked from BoboLaboratories/BoboConfig
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
97 lines (83 loc) · 2.26 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
import java.time.LocalDateTime
plugins {
id 'org.cadixdev.licenser' version '0.6.1'
id 'maven-publish'
id 'java-library'
}
group = 'net.bobolabs.config'
version = '2.1.0'
repositories {
mavenCentral()
maven { url = 'https://repo.papermc.io/repository/maven-public/' } // Paper (for SnakeYAML 1.33-SNAPSHOT)
}
dependencies {
compileOnly 'org.jetbrains:annotations:24.0.1' // JetBrains annotation
compileOnly('org.yaml:snakeyaml') { // SnakeYAML
version {
strictly('[1.33-SNAPSHOT, 2.0]')
prefer '2.0'
}
}
// Test
testImplementation 'com.google.truth:truth:1.1.3'
testImplementation('org.yaml:snakeyaml') {
version {
strictly('[1.33-SNAPSHOT, 2.0]')
prefer '2.0'
}
}
testImplementation platform('org.junit:junit-bom:5.9.1')
testImplementation 'org.junit.jupiter:junit-jupiter'
}
def targetJavaVersion = 17
java {
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
}
tasks.withType(JavaCompile).configureEach {
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
options.release = targetJavaVersion
}
}
test {
useJUnitPlatform()
}
java {
withJavadocJar()
withSourcesJar()
}
publishing {
repositories {
maven {
name = 'BoboLabs'
url = 'https://repo.bobolabs.net/repository/maven-releases/'
credentials {
username = project.property('bobolabs.user')
password = project.property('bobolabs.key')
}
}
}
publications {
maven(MavenPublication) {
groupId = project.group
artifactId = project.name
version = project.version
from components.java
}
}
}
jar {
from "LICENSE.txt"
}
license {
header = project.file('HEADER.txt')
include '**/*.java'
properties {
year = LocalDateTime.now().getYear()
projectName = 'BoboConfig'
}
}