-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
157 lines (133 loc) · 4.69 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
145
146
147
148
149
150
151
152
153
154
155
156
157
////////////////////////////////////////////////////////////////////////////////////////////
// This file is generated by Speakeasy and any edits will be lost in generation updates.
//
// If you wish to customize this file then place those customizations in `build-extras.gradle` which
// is not touched by generation updates.
//
// Additions to the plugins block can be made by setting the `additionalPlugins` property (an array
// of string where each string value is an additional line in the block) in gen.yaml.
////////////////////////////////////////////////////////////////////////////////////////////
plugins {
// Apply the java-library plugin for API and implementation separation.
id 'java-library'
id 'maven-publish'
id 'signing'
id("java")
id("checkstyle")
id "nebula.lint" version "17.8.0"
}
compileJava.options.encoding = "UTF-8"
compileJava.options.compilerArgs += '-Xlint:unchecked'
compileTestJava.options.encoding = "UTF-8"
repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
withSourcesJar()
withJavadocJar()
}
model {
tasks.generatePomFileForMavenPublication {
destination = file("$buildDir/pom.xml")
}
}
jar {
dependsOn(":generatePomFileForMavenPublication")
into("META-INF/maven/com.styra/opa") {
from("$buildDir/pom.xml")
}
}
javadoc {
options.encoding = "UTF-8"
if(JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
options.addStringOption('Xdoclint:none', '-quiet')
}
tasks.withType(Javadoc) {
failOnError false
options.addStringOption('Xdoclint:none', '-quiet')
}
group = "com.styra"
version = "1.8.0"
sourcesJar {
archiveBaseName = "opa"
}
javadocJar {
archiveBaseName = "opa"
}
publishing {
repositories {
maven {
name = "OSSRH"
url = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
}
publications {
maven(MavenPublication) {
groupId = 'com.styra'
artifactId = 'opa'
version = '1.8.0'
from components.java
pom {
name = 'Styra Java SDK'
description = 'SDK enabling Java developers to easily integrate with the Styra API.'
url = 'https://github.com/styrainc/opa-java'
scm {
url = 'github.com/styrainc/opa-java'
connection = 'scm:git:ssh://git@github.com/styrainc/opa-java.git'
}
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
name = 'Styra'
organization = 'Styra'
email = 'devrel@styra.com'
}
}
organization {
name = 'Styra'
url = 'www.styra.com'
}
}
}
}
}
if (!project.hasProperty('skip.signing')) {
signing {
def signingKey = findProperty("signingKey")
def signingPassphrase = findProperty("signingPassphrase")
useInMemoryPgpKeys(signingKey, signingPassphrase)
sign publishing.publications.maven
}
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
runtimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
testImplementation 'org.testcontainers:testcontainers-bom:1.20.1'
testImplementation 'org.testcontainers:testcontainers:1.20.1'
testImplementation 'org.testcontainers:junit-jupiter:1.20.1'
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.17.0'
api 'com.fasterxml.jackson.core:jackson-core:2.17.0'
implementation 'org.apache.httpcomponents:httpcore:4.4.16'
api 'com.fasterxml.jackson.core:jackson-databind:2.17.0'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.2'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.17.2'
implementation 'org.openapitools:jackson-databind-nullable:0.2.6'
implementation 'org.apache.httpcomponents:httpclient:4.5.14'
implementation 'org.apache.httpcomponents:httpmime:4.5.14'
implementation 'commons-io:commons-io:2.15.1'
}
apply from: 'build-extras.gradle'