-
Notifications
You must be signed in to change notification settings - Fork 20
/
build.gradle
119 lines (103 loc) · 3.34 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
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
buildscript {
repositories {
mavenCentral()
}
}
plugins {
id "java"
id "org.openapi.generator" version "5.2.1"
id "com.github.hierynomus.license" version"0.15.0"
}
description = 'Fineract Credit Scorecard Build Tool'
ext['openapiSpecFile'] = "$rootDir/openapi.yml".toString()
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
license {
header rootProject.file("$rootDir/APACHE_LICENSETEXT.md")
excludes([
"**/gradlew*"
])
strictCheck true
}
task licenseFormatBuildScripts (type:nl.javadude.gradle.plugins.license.License) {
source = fileTree(dir: "$rootDir/", includes: [
'**/*.bat',
'**/*.sh',
'**/*.sql',
'**/*.java'
], excludes: [
'**/gradlew*'
])
}
licenseFormat.dependsOn licenseFormatBuildScripts
task validateGoodSpec(type: org.openapitools.generator.gradle.plugin.tasks.ValidateTask){
inputSpec = "$openapiSpecFile"
}
openApiMeta {
generatorName = 'Fineract'
packageName = 'org.apache.fineract.credit.scorecard'
outputFolder = "$buildDir/meta".toString()
}
openApiValidate {
inputSpec = "$openapiSpecFile"
recommend = true
}
task buildJavaSdk(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTask) {
generatorName = 'java'
verbose = false
validateSpec = true
skipValidateSpec = true
inputSpec = "$openapiSpecFile"
outputDir = "$buildDir/generated/java".toString()
groupId = 'org.apache.fineract'
id = 'credit-scorecard-java-client'
apiPackage = 'org.apache.fineract.credit.scorecard.services'
invokerPackage = 'org.apache.fineract.credit.scorecard'
modelPackage = 'org.apache.fineract.credit.scorecard.models'
configOptions = [
fullJavaUtil: 'true',
dateLibrary: 'java8',
hideGenerationTimestamp: 'true',
developerEmail: '[email protected]',
developerName: 'Apache Fineract',
developerOrganization: 'Apache Software Foundation',
developerOrganizationUrl: 'https://apache.org'
]
generateModelTests = false
generateApiTests = false
finalizedBy = [licenseFormat]
}
sourceSets {
generated {
java {
srcDir "$buildDir/generated/java/src/main/java"
}
}
}
compileJava {
source += sourceSets.generated.java
}
configurations {
generatedCompile.extendsFrom implementation
generatedRuntime.extendsFrom runtime
}