1+ plugins {
2+ id(" com.gradleup.shadow" ) version " 8.3.6"
3+ id(" maven-publish" )
4+ id(" com.palantir.git-version" ) version " 3.2.0"
5+ id(" java" )
6+ id(" java-library" )
7+ id(" signing" )
8+ }
9+
10+ repositories {
11+ mavenCentral()
12+ }
13+
14+ dependencies {
15+ api(libs.org.cryptomator.integrations.api)
16+ api(libs.org.slf4j.slf4j.api)
17+ api(libs.org.purejava.keepassxc.proxy.access)
18+ testImplementation(libs.org.slf4j.slf4j.simple)
19+ testImplementation(libs.org.junit.jupiter.junit.jupiter.api)
20+ testImplementation(libs.org.junit.jupiter.junit.jupiter.engine)
21+ testImplementation(libs.org.junit.jupiter.junit.jupiter)
22+ testRuntimeOnly(libs.org.junit.platform.junit.platform.launcher)
23+ }
24+
25+ group = " org.purejava"
26+ val gitVersion: groovy.lang.Closure <String > by extra
27+ version = gitVersion() // version set by the plugin, based on the Git tag
28+
29+ val releaseGradlePluginToken: String = System .getenv(" RELEASE_GRADLE_PLUGIN_TOKEN" ) ? : " "
30+
31+ java {
32+ sourceCompatibility = JavaVersion .VERSION_17
33+ withSourcesJar()
34+ withJavadocJar()
35+ }
36+
37+ tasks.test {
38+ useJUnitPlatform()
39+ filter {
40+ includeTestsMatching(" KeePassXCAccessTest" )
41+ }
42+ }
43+
44+ /*
45+ publishing {
46+ publications {
47+ create<MavenPublication>("mavenJava") {
48+ from(components["java"])
49+ pom {
50+ name.set("keepassxc-cryptomator")
51+ description.set("Plug-in for Cryptomator to store vault passwords in KeePassXC")
52+ url.set("https://github.com/purejava/keepassxc-cryptomator")
53+ licenses {
54+ license {
55+ name.set("MIT License")
56+ url.set("https://opensource.org/licenses/MIT")
57+ }
58+ }
59+ developers {
60+ developer {
61+ id.set("purejava")
62+ name.set("Ralph Plawetzki")
63+ 64+ }
65+ }
66+ scm {
67+ connection.set("scm:git:git://github.com/purejava/keepassxc-cryptomator.git")
68+ developerConnection.set("scm:git:ssh://github.com/purejava/keepassxc-cryptomator.git")
69+ url.set("https://github.com/purejava/keepassxc-cryptomator/tree/main")
70+ }
71+ issueManagement {
72+ system.set("GitHub Issues")
73+ url.set("https://github.com/purejava/keepassxc-cryptomator/issues")
74+ }
75+ }
76+ }
77+ }
78+ }
79+ */
80+
81+ tasks.named< com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar > (" shadowJar" ) {
82+ archiveClassifier.set(" " )
83+ }
84+
85+ artifacts {
86+ add(" archives" , tasks.named(" shadowJar" ))
87+ add(" archives" , tasks.named(" sourcesJar" ))
88+ }
89+
90+ signing {
91+ useGpgCmd()
92+ // Sign both the sources JAR and the shadow JAR
93+ sign(configurations.getByName(" archives" ))
94+ }
95+
96+ tasks.withType<JavaCompile > {
97+ options.encoding = " UTF-8"
98+ }
99+
100+ tasks.withType<Javadoc > {
101+ options.encoding = " UTF-8"
102+ if (JavaVersion .current().isJava9Compatible) {
103+ (options as StandardJavadocDocletOptions ).addBooleanOption(" html5" , true )
104+ }
105+ }
106+
107+ publishing {
108+ publications {
109+ create<MavenPublication >(" default" ) {
110+ from(components[" java" ])
111+ }
112+ }
113+
114+ repositories {
115+ maven {
116+ name = " GitHubPackages"
117+ url = uri(" https://maven.pkg.github.com/purejava/keepassxc-cryptomator" )
118+ credentials {
119+ username = System .getenv(" GITHUB_ACTOR" )
120+ password = releaseGradlePluginToken
121+ }
122+ }
123+ }
124+ }
0 commit comments