-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathbuild.gradle
103 lines (88 loc) · 2.98 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
plugins {
id "io.franzbecker.gradle-lombok" version "4.0.0"
}
apply plugin: 'java'
apply plugin: 'maven-publish'
apply plugin: 'signing'
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
dependencies {
implementation('com.squareup:javapoet:1.13.0')
implementation('com.google.guava:guava:24.1-jre')
implementation project(':delivery-sdk')
testImplementation("junit:junit:4.13.1");
testImplementation("org.apache.httpcomponents:httpclient:4.5.13:tests");
testImplementation("org.apache.httpcomponents:httpclient:4.5.13");
}
lombok {
version = "1.18.16"
sha256 = ""
}
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier = 'sources'
from sourceSets.main.allJava
}
import io.franzbecker.gradle.lombok.task.DelombokTask
task delombok(type: DelombokTask, dependsOn: compileJava) {
ext.outputDir = file("$buildDir/delombok")
outputs.dir(outputDir)
sourceSets.main.java.srcDirs.each { dir ->
inputs.dir(dir)
args(dir, "-d", outputDir)
}
}
javadoc {
dependsOn delombok
source = delombok.outputDir
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}
def packageSummary = 'Kontent.ai model generator.'
def packageDescription = 'Generators producing strongly-typed models based on content types in a Kontent.ai project.'
def repoArtifactId = 'delivery-sdk-generators'
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
artifactId = repoArtifactId
groupId = repoGroupId
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
pom.withXml {
def root = asNode()
root.appendNode('description', packageDescription)
root.appendNode('name', packageSummary)
root.appendNode('url', 'https://kontent.ai')
root.children().last() + pomConfig
}
}
}
repositories {
maven {
if (project.getVersion().toString().endsWith('SNAPSHOT')) {
url "https://s01.oss.sonatype.org/content/repositories/snapshots/"
} else {
url "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
}
credentials {
username nexusUsername
password nexusPassword
}
}
}
}
signing {
// https://docs.gradle.org/current/userguide/signing_plugin.html#using_in_memory_ascii_armored_openpgp_subkeys
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
sign publishing.publications.mavenJava
}