Skip to content

Commit b44bd20

Browse files
committed
Migrate from Groovy to Kotlin
1 parent 1708210 commit b44bd20

File tree

4 files changed

+126
-132
lines changed

4 files changed

+126
-132
lines changed

.github/workflows/build_and_release_github.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@ jobs:
3838
run: ./gradlew clean build
3939

4040
- name: Release package
41-
run: ./gradlew githubRelease
41+
run: ./gradlew publish
4242
env:
4343
RELEASE_GRADLE_PLUGIN_TOKEN: ${{ secrets.RELEASE_GRADLE_PLUGIN_TOKEN }}

build.gradle

Lines changed: 0 additions & 130 deletions
This file was deleted.

build.gradle.kts

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
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+
email.set("ralph@purejava.org")
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+
}

settings.gradle renamed to settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
* This project uses @Incubating APIs which are subject to change.
55
*/
66

7-
rootProject.name = 'keepassxc-cryptomator'
7+
rootProject.name = "keepassxc-cryptomator"

0 commit comments

Comments
 (0)