-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
92 lines (74 loc) · 2.03 KB
/
build.gradle
File metadata and controls
92 lines (74 loc) · 2.03 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
plugins {
id 'java-library'
id 'maven-publish'
}
group = 'dev.pfaff.glass'
version = '1.0-SNAPSHOT'
apply from: "${project.gradle.gradleUserHomeDir}/local.gradle"
repositories {
mavenCentral()
maven {
name = "git.pfaff.dev/michael"
url = "https://git.pfaff.dev/api/packages/michael/maven"
}
}
configurations {
include {
}
implementation {
extendsFrom(configurations.include)
}
}
dependencies {
implementation 'org.jspecify:jspecify:0.3.0'
implementation 'dev.pfaff.log4truth:log4truth:1.0-SNAPSHOT'
implementation 'dev.pfaff.glass:glass-core:1.0-SNAPSHOT'
include files('build/bindgen')
testImplementation platform('org.junit:junit-bom:5.9.1')
testImplementation 'org.junit.jupiter:junit-jupiter'
}
test {
useJUnitPlatform()
}
def targetJavaVersion = 24
tasks.withType(JavaCompile).configureEach {
// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
// If Javadoc is generated, this must be specified in that task too.
it.options.encoding = "UTF-8"
it.options.release = targetJavaVersion
}
tasks.withType(Javadoc).configureEach {
it.options.encoding = "UTF-8"
it.options.source = targetJavaVersion
}
sourceSets {
main {
java {
srcDirs = ["src/main/java", "src/gen/java"]
}
}
}
java {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
archivesBaseName = project.properties.name
withSourcesJar()
withJavadocJar()
}
jar {
duplicatesStrategy(DuplicatesStrategy.FAIL)
from {
configurations.include.collect { it.isDirectory() ? it : zipTree(it) }
}
manifest {
attributes['Automatic-Module-Name'] = 'dev.pfaff.glass'
}
}
publishing {
publications {
glass(MavenPublication) {
from components.java
}
}
}