forked from Dogacel/kotlinx-protobuf-gen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
55 lines (49 loc) · 1.6 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
plugins {
`maven-publish`
signing
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
}
nexusPublishing {
this.repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
// ORG_GRADLE_PROJECT_sonatypeUsername
// ORG_GRADLE_PROJECT_sonatypePassword
}
}
}
group = "io.github.dogacel"
version = "alpha-SNAPSHOT"
signing {
val signingKey = providers
.environmentVariable("GPG_SIGNING_KEY")
.forUseAtConfigurationTime()
val signingPassphrase = providers
.environmentVariable("GPG_SIGNING_PASSPHRASE")
.forUseAtConfigurationTime()
if (signingKey.isPresent && signingPassphrase.isPresent) {
useInMemoryPgpKeys(signingKey.get(), signingPassphrase.get())
val extension = extensions
.getByName("publishing") as PublishingExtension
sign(extension.publications)
}
}
subprojects {
apply(plugin = "org.jlleitschuh.gradle.ktlint") // Version should be inherited from parent
repositories {
// Required to download KtLint
mavenCentral()
}
// Optionally configure plugin
configure<org.jlleitschuh.gradle.ktlint.KtlintExtension> {
ignoreFailures.set(true)
filter {
exclude { entry ->
val condition =
entry.file.toString().contains(".proto.kt") || entry.file.toString().contains("generated")
condition
}
}
}
}