-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
136 lines (115 loc) · 4.3 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
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("org.jetbrains.kotlin", "kotlin-gradle-plugin", Versions.kotlin)
classpath("org.jetbrains.kotlin", "kotlin-allopen", Versions.kotlin)
classpath("org.jlleitschuh.gradle", "ktlint-gradle", Versions.ktlintPlugin)
classpath("com.google.protobuf", "protobuf-gradle-plugin", Versions.protobufPlugin)
}
}
plugins {
idea
`java-library`
`maven-publish`
signing
}
subprojects {
apply {
plugin("kotlin")
plugin("idea")
plugin("java-library")
plugin("org.jlleitschuh.gradle.ktlint")
plugin("maven-publish")
plugin("signing")
}
group = "io.provenance.protobuf"
version = project.property("version")?.takeIf { it != "unspecified" } ?: "1.0-SNAPSHOT"
project.ext.properties["kotlin_version"] = Versions.kotlin
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = "1.8"
}
}
configure<JavaPluginConvention> {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
repositories {
mavenCentral()
}
java {
withJavadocJar()
withSourcesJar()
}
dependencies {
implementation("org.jetbrains.kotlin", "kotlin-stdlib-jdk8", Versions.kotlin)
implementation("org.jetbrains.kotlin", "kotlin-stdlib", Versions.kotlin)
implementation("org.jetbrains.kotlin", "kotlin-reflect", Versions.kotlin)
}
publishing {
repositories {
maven {
name = "MavenCentral"
url = if (version == "1.0-SNAPSHOT") {
uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
} else {
uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
}
credentials {
username = findProject("ossrhUsername")?.toString() ?: System.getenv("OSSRH_USERNAME")
password = findProject("ossrhPassword")?.toString() ?: System.getenv("OSSRH_PASSWORD")
}
}
}
publications {
create<MavenPublication>("maven") {
groupId = "io.provenance.protobuf"
artifactId = "pb-proto-java"
from(components["java"])
pom {
name.set("Provenance Protobufs in Java")
description.set("Compiles Provenance Protobufs into their Java representation.")
url.set("https://provenance.io")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("wshin")
name.set("Wontaek Shin")
email.set("[email protected]")
}
developer {
id.set("gabrinthei")
name.set("James Sonntag")
email.set("[email protected]")
}
developer {
id.set("scirner22")
name.set("Stephen Cirner")
email.set("[email protected]")
}
}
scm {
connection.set("[email protected]:provenance-io/provenance-protobuf-java.git")
developerConnection.set("[email protected]:provenance-io/provenance-protobuf-java.git")
url.set("https://github.com/provenance-io/provenance-protobuf-java")
}
}
}
}
signing {
sign(publishing.publications["maven"])
}
tasks.javadoc {
if(JavaVersion.current().isJava9Compatible) {
(options as StandardJavadocDocletOptions).addBooleanOption("html5", true)
}
}
}
}