-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
149 lines (125 loc) · 3.92 KB
/
build.gradle.kts
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
145
146
147
148
149
import com.github.jk1.license.filter.DependencyFilter
import com.github.jk1.license.filter.LicenseBundleNormalizer
group = "com.weavechain"
version = "1.0"
plugins {
java
`maven-publish`
id("org.jetbrains.dokka") version "1.8.20"
id("com.github.jk1.dependency-license-report") version "2.4"
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
signing
id("java-library")
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
repositories {
java
mavenCentral()
maven("https://jitpack.io")
}
dependencies {
compileOnly("org.projectlombok:lombok:1.18.28")
annotationProcessor("org.projectlombok:lombok:1.18.28")
implementation("com.weavechain:curve25519-elisabeth:0.1.3")
implementation("com.google.code.gson:gson:2.8.9")
implementation("com.github.multiformats:java-multibase:v1.1.0")
testCompileOnly("org.projectlombok:lombok:1.18.28")
testAnnotationProcessor("org.projectlombok:lombok:1.18.28")
testImplementation("org.testng:testng:7.8.0")
testImplementation("com.google.truth:truth:1.1.4")
}
tasks.withType<Test>().configureEach {
useTestNG()
}
val sourcesJar by tasks.registering(Jar::class) {
classifier = "sources"
from(sourceSets.main.get().allSource)
}
val dokkaHtml by tasks.getting(org.jetbrains.dokka.gradle.DokkaTask::class)
val javadocJar: TaskProvider<Jar> by tasks.registering(Jar::class) {
dependsOn(dokkaHtml)
archiveClassifier.set("javadoc")
from(dokkaHtml.outputDirectory)
}
publishing {
repositories {
maven {
url = uri("./build/repo")
name = "Maven"
}
}
publications {
create<MavenPublication>("Maven") {
groupId = "com.weavechain"
artifactId = "schnorr-nizk"
version = "1.0"
from(components["java"])
}
withType<MavenPublication> {
artifact(sourcesJar)
artifact(javadocJar)
pom {
name.set(project.name)
description.set("Schnorr protocol using Curve25519")
url.set("https://github.com/weavechain/schnorr-nizk")
licenses {
license {
name.set("MIT")
url.set("https://opensource.org/licenses/mit")
}
}
issueManagement {
system.set("Github")
url.set("https://github.com/weavechain/schnorr-nizk/issues")
}
scm {
connection.set("scm:git:git://github.com/weavechain/schnorr-nizk.git")
developerConnection.set("scm:git:git@github.com:weavechain/schnorr-nizk.git")
url.set("https://github.com/weavechain/schnorr-nizk")
}
developers {
developer {
name.set("Ioan Moldovan")
email.set("ioan.moldovan@weavechain.com")
}
}
}
}
}
}
signing {
useGpgCmd()
sign(configurations.archives.get())
sign(publishing.publications["Maven"])
}
tasks {
sourceSets.getByName("test") {
java.srcDir("src/test/java")
}
val releaseJar by creating(Jar::class) {
archiveClassifier.set("schnorr-nizk")
from(sourceSets.main.get().output.classesDirs)
include("com/weavechain/**")
}
artifacts {
add("archives", releaseJar)
add("archives", sourcesJar)
}
}
tasks.withType<PublishToMavenRepository> {
dependsOn("checkLicense")
}
licenseReport {
filters = arrayOf<DependencyFilter>(
LicenseBundleNormalizer(
"$rootDir/normalizer-bundle.json",
true
)
)
excludeGroups = arrayOf<String>(
)
allowedLicensesFile = File("$rootDir/allowed-licenses.json")
}