-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbuild.gradle
175 lines (145 loc) · 5.35 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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java library project to get you started.
* For more details take a look at the 'Building Java & JVM projects' chapter in the Gradle
* User Manual available at https://docs.gradle.org/7.5.1/userguide/building_java_projects.html
*/
plugins {
// Apply the java-library plugin for API and implementation separation.
id 'java-library'
id "org.openapi.generator" version "6.6.0"
id 'org.springframework.boot' version '2.7.2'
id 'io.spring.dependency-management' version '1.0.12.RELEASE'
id 'io.github.gradle-nexus.publish-plugin' version '1.1.0'
id "maven-publish"
id 'signing'
id 'jacoco'
}
bootJar {
enabled = false
}
jar {
enabled = true
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withJavadocJar()
withSourcesJar()
}
repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
}
dependencies {
// Use JUnit Jupiter for testing.
testImplementation 'org.junit.jupiter:junit-jupiter:5.8.2'
// This dependency is exported to consumers, that is to say found on their compile classpath.
api 'org.apache.commons:commons-math3:3.6.1'
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation 'com.google.guava:guava:31.0.1-jre'
// for open api generator
implementation "io.github.openfeign:feign-okhttp:11.10"
implementation "io.github.openfeign:feign-core:11.10"
implementation "io.github.openfeign:feign-jackson:11.10"
implementation "com.github.scribejava:scribejava-core:8.3.1"
implementation "io.github.openfeign.form:feign-form:3.8.0"
implementation "io.github.openfeign:feign-slf4j:11.9.1"
implementation "io.swagger:swagger-annotations:1.6.6"
implementation 'io.swagger:swagger-models:1.6.6'
implementation 'io.swagger:swagger-core:1.6.6'
implementation "org.openapitools:jackson-databind-nullable:0.2.1"
implementation "net.bytebuddy:byte-buddy:1.14.4"
// jaskson
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jdk8"
implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.4'
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.13.3'
implementation 'com.fasterxml.jackson.core:jackson-core:2.13.3'
implementation 'javax.annotation:javax.annotation-api:1.3.2'
// spring?
testImplementation 'org.springframework.boot:spring-boot-starter-web'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation "javax.validation:validation-api:2.0.1.Final"
// immutable
compileOnly 'org.immutables:value:2.9.2'
annotationProcessor 'org.immutables:value:2.9.2'
// cron utils
implementation 'com.cronutils:cron-utils:9.2.0'
}
tasks.named('test') {
// Use JUnit Platform for unit tests.
useJUnitPlatform()
}
openApiValidate {
inputSpec = "$rootDir/iwf-idl/iwf-sdk.yaml".toString()
}
openApiGenerate {
generatorName = "java"
inputSpec = "$rootDir/iwf-idl/iwf-sdk.yaml".toString()
outputDir = "$buildDir/generated".toString()
apiPackage = "io.iworkflow.gen.api"
modelPackage = "io.iworkflow.gen.models"
invokerPackage = "io.iworkflow.gen.api"
configOptions = [
configPackage: "io.iworkflow.gen.configuration",
basePackage : "io.iworkflow.gen",
library : "feign",
interfaceOnly: "true"
]
}
jacocoTestReport {
reports {
xml.enabled true
html.enabled true
}
}
check.dependsOn jacocoTestReport
compileJava.dependsOn tasks.openApiGenerate
sourceSets.main.java.srcDirs += "$buildDir/generated/src/main/java"
publishing {
publications {
mavenJava(MavenPublication) {
from(components.java)
pom {
name = "iwf-java-sdk"
description = "iwf java sdk core"
url = 'https://github.com/indeedeng/iwf-java-sdk'
scm {
connection = 'scm:git@github.com:indeedeng/iwf-java-sdk.git'
developerConnection = 'scm:git@github.com:indeedeng/iwf-java-sdk.git'
url = 'https://github.com/indeedeng/iwf-java-sdk.git'
}
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'longquanzheng'
name = 'Quanzheng Long'
email = 'qlong.seattle@gmail.com'
}
}
}
}
}
}
signing {
sign publishing.publications.mavenJava
}
group = "io.iworkflow"
version = "2.8.1"
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
// username = project.property('myNexusUsername')
// password = project.property('myNexusPassword')
}
}
}