This repository has been archived by the owner on Nov 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
146 lines (135 loc) · 5.47 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
import io.swagger.codegen.DefaultGenerator
import io.swagger.codegen.config.CodegenConfigurator
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'io.swagger:swagger-codegen:2.4.2'
}
}
plugins {
id 'java'
id 'maven-publish'
}
version = '4.1.0'
group = 'uk.gov.hmcts.reform.idam'
description = """idam-api-spec"""
sourceCompatibility = 17
targetCompatibility = 17
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
jcenter()
}
//configurations {
// generatedCompile
// compile.extendsFrom generatedCompile
//}
dependencies {
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '3.1.1'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-tomcat', version: '3.1.1'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-validation', version: '3.1.1'
implementation group: 'io.springfox', name: 'springfox-swagger2', version: '3.0.0'
implementation group: 'io.springfox', name: 'springfox-swagger-ui', version: '3.0.0'
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310', version: '2.13.2'
// generatedCompile group: 'jakarta.validation', name: 'validation-api', version: '2.0.1.Final'
}
//
//project.ext {
// swaggerTargetFolder = 'src/generated/java'
//}
//
//def generateCodeFromSwagger(swaggerSourceFile, packageName, importMappings) {
// def config = new CodegenConfigurator()
// config.setInputSpec("file:///$projectDir/$swaggerSourceFile")
// config.setOutputDir("$buildDir")
// config.setLang('spring')
// config.setAdditionalProperties([
// 'generateApis' : 'false',
// 'interfaceOnly' : 'true',
// 'apiPackage' : 'uk.gov.hmcts.reform.idam.api.' + packageName,
// 'modelPackage' : 'uk.gov.hmcts.reform.idam.api.' + packageName +'.model',
// 'sourceFolder' : project.swaggerTargetFolder,
// 'dateLibrary' : 'java8',
// 'useTags' : (packageName == 'external' ? 'true' : 'false'),
// 'generateModelDocumentation' : 'false'
// ])
// if (importMappings != null) {
// ((LinkedHashMap<String, String>) importMappings).each { k, v -> config.addImportMapping(k, v) }
// }
// new DefaultGenerator().opts(config.toClientOptInput()).generate()
//}
//
//task generateApi {
// outputs.dir("$buildDir")
// doLast{
// generateCodeFromSwagger('src/main/resources/openid-connect.yaml', 'external', null)
//
// generateCodeFromSwagger('src/main/resources/shared.yaml', 'shared', null)
//
// generateCodeFromSwagger('src/main/resources/internal-admin-api.yaml', 'internal', [
// 'User': 'uk.gov.hmcts.reform.idam.api.shared.model.User',
// 'ErrorMap' : 'uk.gov.hmcts.reform.idam.api.shared.model.ErrorMap',
// 'ArrayOfRoles' : 'uk.gov.hmcts.reform.idam.api.shared.model.ArrayOfRoles',
// 'Role' : 'uk.gov.hmcts.reform.idam.api.shared.model.Role',
// 'ArrayOfStrings' : 'uk.gov.hmcts.reform.idam.api.shared.model.ArrayOfStrings',
// 'RoleDetail' : 'uk.gov.hmcts.reform.idam.api.shared.model.RoleDetail',
// 'UpdateRole' : 'uk.gov.hmcts.reform.idam.api.shared.model.UpdateRole',
// 'PatchRequest' : 'uk.gov.hmcts.reform.idam.api.shared.model.PatchRequest',
// 'PatchOperation' : 'uk.gov.hmcts.reform.idam.api.shared.model.PatchOperation',
// 'RegisterRequest' : 'uk.gov.hmcts.reform.idam.api.shared.model.RegisterRequest',
// 'SelfRegisterRequest' : 'uk.gov.hmcts.reform.idam.api.shared.model.SelfRegisterRequest'
// ])
//
// generateCodeFromSwagger('src/main/resources/external-user-mgmt-api.yaml', 'external', [
// 'RoleDefinition': 'uk.gov.hmcts.reform.idam.api.shared.model.RoleDefinition',
// 'User': 'uk.gov.hmcts.reform.idam.api.shared.model.User',
// 'ErrorMap' : 'uk.gov.hmcts.reform.idam.api.shared.model.ErrorMap'
// ])
//
// generateCodeFromSwagger('src/main/resources/external-sso-api.yaml', 'external', [
// 'User': 'uk.gov.hmcts.reform.idam.api.shared.model.User'
// ])
//
// generateCodeFromSwagger('src/main/resources/external-dynamic-role-assign-api.yaml', 'external', [
// 'RoleDefinition': 'uk.gov.hmcts.reform.idam.api.shared.model.RoleDefinition'
// ])
//
// generateCodeFromSwagger('src/main/resources/external-policies-api.yaml', 'external', null)
//
// generateCodeFromSwagger('src/main/resources/external-bulk-request-api.yaml', 'external', null)
//
// generateCodeFromSwagger('src/main/resources/external-batch-status-api.yaml', 'external', null)
//
// }
//}
//
//sourceSets {
// generated {
// java {
// srcDirs "$buildDir/$swaggerTargetFolder"
// }
// }
//}
//
//jar {
// from sourceSets.generated.output
//}
//
//compileGeneratedJava.dependsOn generateApi
//classes.dependsOn generatedClasses
//compileJava.dependsOn compileGeneratedJava
publishing {
publications {
Main(MavenPublication) {
from components.java
groupId project.group
artifactId rootProject.name
version project.version
}
}
}