forked from Eirenliel/slime-java-commons
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
92 lines (77 loc) · 2.34 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
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java Library project to get you started.
* For more details take a look at the Java Libraries chapter in the Gradle
* User Manual available at https://docs.gradle.org/6.3/userguide/java_library_plugin.html
*/
plugins {
id 'java-library'
id 'maven-publish'
id "com.diffplug.spotless"
}
group = 'com.github.Eirenlel'
publishing {
publications {
myLibrary(MavenPublication) {
from components.java
setArtifactId 'artifact'
}
}
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
// Set compiler to use UTF-8
compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'
javadoc.options.encoding = 'UTF-8'
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
tasks.withType(Test) {
systemProperty('file.encoding', 'UTF-8')
}
tasks.withType(Javadoc){
options.encoding = 'UTF-8'
}
repositories {
// Use jcenter for resolving dependencies.
// You can declare any Maven/Ivy/file repository here.
mavenCentral()
}
dependencies {
// This dependency is exported to consumers, that is to say found on their compile classpath.
implementation 'org.apache.commons:commons-math3:3.6.1'
implementation 'org.apache.commons:commons-lang3:3.12.0'
implementation 'org.yaml:snakeyaml:1.30'
// Use JUnit test framework
testImplementation platform('org.junit:junit-bom:5.8.2')
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.junit.platform:junit-platform-launcher'
}
test {
useJUnitPlatform()
}
spotless {
// optional: limit format enforcement to just the files changed by this feature branch
// ratchetFrom 'origin/main'
format 'misc', {
// define the files to apply `misc` to
target '*.gradle', '*.md', '.gitignore'
// define the steps to apply to those files
trimTrailingWhitespace()
endWithNewline()
indentWithTabs() // or spaces. Takes an integer argument if you don't like 4
}
java {
removeUnusedImports()
// Use eclipse JDT
eclipse().configFile("spotless.xml")
// apply a specific flavor of google-java-format
// googleJavaFormat('1.8').aosp().reflowLongStrings()
// make sure every file has the following copyright header.
// optionally, Spotless can set copyright years by digging
// through git history (see "license" section below)
// licenseHeader '/* (C)$YEAR */'
}
}