forked from FabricMC/unpick
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
122 lines (102 loc) · 2.72 KB
/
Copy pathbuild.gradle
File metadata and controls
122 lines (102 loc) · 2.72 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
plugins {
id 'java-library'
id 'maven-publish'
id 'eclipse'
id 'checkstyle'
id 'com.diffplug.spotless' version '7.0.2'
}
repositories {
mavenCentral()
}
allprojects {
apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply plugin: 'checkstyle'
apply plugin: 'com.diffplug.spotless'
group = 'io.papermc.unpick'
def ENV = System.getenv()
version = "3.0.1-SNAPSHOT"
version = version + (ENV.GITHUB_ACTIONS ? "" : "+local")
repositories {
mavenCentral()
}
dependencies {
api 'org.ow2.asm:asm:9.6'
api 'org.ow2.asm:asm-tree:9.6'
implementation 'org.ow2.asm:asm-commons:9.6'
implementation 'org.ow2.asm:asm-util:9.6'
compileOnly 'org.jetbrains:annotations:24.0.0'
// Use JUnit test framework
testImplementation platform('org.junit:junit-bom:5.10.1')
testImplementation 'org.junit.jupiter:junit-jupiter-api'
testImplementation 'org.junit.jupiter:junit-jupiter-params'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
testCompileOnly 'org.jetbrains:annotations:24.0.0'
}
test {
useJUnitPlatform()
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
it.options.release = 21
}
java {
withSourcesJar()
sourceCompatibility = 21
targetCompatibility = 21
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}
checkstyle {
toolVersion = '10.21.1'
configFile = rootProject.file("checkstyle.xml")
ignoreFailures = false
}
spotless {
lineEndings = com.diffplug.spotless.LineEnding.UNIX
java {
removeUnusedImports()
importOrder('java', 'javax', '', 'daomephsta.unpick')
leadingSpacesToTabs()
trimTrailingWhitespace()
toggleOffOn()
}
}
var paperRepo = project.version.toString().endsWith("-SNAPSHOT")
? "https://artifactory.papermc.io/artifactory/snapshots/"
: "https://artifactory.papermc.io/artifactory/releases/"
if (!project.name.startsWith('test-data')) {
publishing {
repositories {
repositories.maven {
name = "paper"
url = paperRepo
credentials(PasswordCredentials)
}
}
publications {
mavenJava(MavenPublication) {
from components.java
artifact(javadocJar)
}
}
}
}
}
dependencies {
implementation project(':unpick-format-utils')
}
test {
dependsOn tasks.getByPath(':test-data:classes')
dependsOn tasks.getByPath(':test-data-expected:classes')
systemProperties testData: project(':test-data').sourceSets.main.java.destinationDirectory.get().asFile.absolutePath,
testDataExpected: project(':test-data-expected').sourceSets.main.java.destinationDirectory.get().asFile.absolutePath
}
tasks.register("printVersion") {
doFirst {
println(version)
}
}