-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle
129 lines (114 loc) · 3.79 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
plugins {
id 'com.gradleup.shadow' version '8.3.5'
id 'com.github.breadmoirai.github-release' version '2.5.2'
id 'com.palantir.git-version' version '3.1.0'
id 'java'
id 'java-library'
id 'signing'
}
repositories {
mavenCentral()
}
dependencies {
api libs.org.cryptomator.integrations.api
api libs.org.slf4j.slf4j.api
api libs.org.purejava.keepassxc.proxy.access
testImplementation libs.org.slf4j.slf4j.simple
testImplementation libs.org.junit.jupiter.junit.jupiter.api
testImplementation libs.org.junit.jupiter.junit.jupiter.engine
testImplementation libs.org.junit.jupiter.junit.jupiter
}
group = 'org.purejava'
version gitVersion() // version set by the plugin, based on the Git tag
java.sourceCompatibility = JavaVersion.VERSION_17
def releaseGradlePluginToken = System.getenv("RELEASE_GRADLE_PLUGIN_TOKEN") ?: ''
java {
withSourcesJar()
withJavadocJar()
}
test {
useJUnitPlatform()
filter {
includeTestsMatching "KeePassXCAccessTest"
}
}
/*
publishing {
publications {
mavenJava(MavenPublication) {
from(components.java)
pom {
name = 'keepassxc-cryptomator'
description = 'Plug-in for Cryptomator to store vault passwords in KeePassXC'
url = 'https://github.com/purejava/keepassxc-cryptomator'
licenses {
license {
name = 'MIT License'
url = 'https://opensource.org/licenses/MIT'
}
}
developers {
developer {
id = 'purejava'
name = 'Ralph Plawetzki'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:git://github.com/purejava/keepassxc-cryptomator.git'
developerConnection = 'scm:git:ssh://github.com/purejava/keepassxc-cryptomator.git'
url = 'https://github.com/purejava/keepassxc-cryptomator/tree/main'
}
issueManagement {
system = 'GitHub Issues'
url = 'https://github.com/purejava/keepassxc-cryptomator/issues'
}
}
}
}
}
*/
tasks.named('shadowJar', com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
archiveClassifier.set('')
}
tasks.named('githubRelease') {
dependsOn('sourcesJar')
dependsOn('javadocJar')
dependsOn('signArchives')
}
artifacts {
archives tasks.named('shadowJar')
archives tasks.named('sourcesJar')
}
signing {
useGpgCmd()
// Sign both the sources JAR and the shadow JAR
sign configurations.archives
}
javadoc {
if(JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
githubRelease {
setToken(releaseGradlePluginToken)
setTagName("$project.version")
setReleaseName("$project.version")
setTargetCommitish('main')
setDraft(true)
setBody("[![Downloads](https://img.shields.io/github/downloads/purejava/keepassxc-cryptomator/latest/keepassxc-cryptomator-${project.version}.jar)](https://github.com/purejava/keepassxc-cryptomator/releases/latest/download/keepassxc-cryptomator-${project.version}.jar)\n" +
"\n" +
"- xxx")
releaseAssets = fileTree(dir: "${layout.buildDirectory}/libs", includes: [
"keepassxc-cryptomator-${version}.jar",
"keepassxc-cryptomator-${version}.jar.asc",
"keepassxc-cryptomator-${version}-sources.jar",
"keepassxc-cryptomator-${version}-sources.jar.asc"
]).files
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
tasks.withType(Javadoc) {
options.encoding = 'UTF-8'
}