-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
144 lines (128 loc) · 4.26 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
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'
}
def gitHubPackagesUser = System.getenv("PACKAGES_USER") ?: ''
def gitHubPackagesToken = System.getenv("PACKAGES_ACCESS_TOKEN") ?: ''
def releaseGradlePluginToken = System.getenv("RELEASE_GRADLE_PLUGIN_TOKEN") ?: ''
repositories {
mavenLocal()
maven {
name = "GitHubPackages"
url = uri('https://maven.pkg.github.com/bitwarden/sdk')
credentials {
username = gitHubPackagesUser
password = gitHubPackagesToken
}
}
maven {
url = uri('https://repo.maven.apache.org/maven2/')
}
}
dependencies {
api libs.org.cryptomator.integrations.api
api libs.com.bitwarden.sdk.secrets
api libs.org.slf4j.slf4j.api
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_20
java {
withSourcesJar()
withJavadocJar()
}
test {
useJUnitPlatform()
filter {
includeTestsMatching "BitwardenAccessTest"
}
}
/*
publishing {
publications {
mavenJava(MavenPublication) {
from(components.java)
pom {
name = 'cryptomator-bitwarden'
description = 'Plug-in for Cryptomator to store vault passwords in Bitwarden'
url = 'https://github.com/purejava/cryptomator-bitwarden'
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/cryptomator-bitwarden.git'
developerConnection = 'scm:git:ssh://github.com/purejava/cryptomator-bitwarden.git'
url = 'https://github.com/purejava/cryptomator-bitwarden/tree/develop'
}
issueManagement {
system = 'GitHub Issues'
url = 'https://github.com/purejava/cryptomator-bitwarden/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('develop')
setDraft(true)
setBody("[![Downloads](https://img.shields.io/github/downloads/purejava/cryptomator-bitwarden/latest/cryptomator-bitwarden-${project.version}.jar)](https://github.com/purejava/cryptomator-bitwarden/releases/latest/download/cryptomator-bitwarden-${project.version}.jar)\n" +
"\n" +
"- xxx")
setGenerateReleaseNotes(true)
releaseAssets = fileTree(dir: "${layout.buildDirectory}/libs", includes: [
"cryptomator-bitwarden-${version}.jar",
"cryptomator-bitwarden-${version}.jar.asc",
"cryptomator-bitwarden-${version}-sources.jar",
"cryptomator-bitwarden-${version}-sources.jar.asc"
]).files
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
tasks.withType(Javadoc) {
options.encoding = 'UTF-8'
}