-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
95 lines (78 loc) · 2.8 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
/*
* 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/8.0.2/userguide/building_java_projects.html
*/
plugins {
// Apply the java-library plugin for API and implementation separation.
id 'java-library'
id("io.freefair.lombok") version "8.0.0"
}
group 'it.pagopa.tech'
repositories {
mavenLocal()
mavenCentral()
}
configurations {
implementation {
attributes {
attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(LibraryElements, 'instrumented-core-jar'))
}
}
}
abstract class InstrumentedJarsRule implements AttributeCompatibilityRule<LibraryElements> {
@Override
void execute(CompatibilityCheckDetails<LibraryElements> details) {
if (details.consumerValue.name == 'instrumented-core-jar' && details.producerValue.name == 'jar') {
details.compatible()
}
}
}
dependencies {
attributesSchema {
attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE) {
compatibilityRules.add(InstrumentedJarsRule)
}
}
implementation project(path: ':core')
implementation 'javax.annotation:javax.annotation-api:1.3.2'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.14.2'
implementation 'org.openapitools:jackson-databind-nullable:0.2.6'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.14.2'
implementation 'com.google.code.findbugs:jsr305:3.0.2'
implementation 'javax.inject:javax.inject:1'
testImplementation 'org.mock-server:mockserver-client-java:5.15.0'
testImplementation 'junit:junit:4.13.2'
// Use JUnit Jupiter for testing.
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.2'
testImplementation 'org.assertj:assertj-core:3.24.2'
testImplementation 'org.mockito:mockito-core:5.2.0'
testImplementation 'org.mockito:mockito-junit-jupiter:5.2.0'
//Mockserver for testing api
testImplementation 'org.mock-server:mockserver-netty:5.15.0'
}
tasks.named('test') {
// Use JUnit Platform for unit tests.
useJUnitPlatform()
}
/*
!! WARNING:
Generated client do not handle `Ocp-Apim-Subscription-Key` header.
We added it to `ApiClient` class, by defining the interceptor as
`interceptor = t -> t.header("Ocp-Apim-Subscription-Key", config.getSubscriptionKey());`
If we need to regenerate the client, please copy/paste this piece of code again to `ApiClient class construction`.
----------------
compileJava.dependsOn tasks.openApiGenerate
openApiGenerate {
generatorName = "java"
inputSpec = "$projectDir/openapi/openapi-spec.yml"
outputDir = "$projectDir/generated"
configOptions = [
dataLibrary: "java8",
library: "native",
useRuntimeException: "true",
sourceFolder: "build/generated/sources/"
]
}*/