File tree Expand file tree Collapse file tree 2 files changed +20
-20
lines changed
gradle-plugin/plugin/src/main/java/com/yelp/codegen/plugin Expand file tree Collapse file tree 2 files changed +20
-20
lines changed Original file line number Diff line number Diff line change 1
1
package com.yelp.codegen.plugin
2
2
3
- import io.swagger.parser.SwaggerParser
4
- import java.io.File
5
3
import javax.inject.Inject
6
4
import org.gradle.api.Action
7
5
import org.gradle.api.Project
@@ -23,22 +21,4 @@ abstract class GenerateTaskConfiguration @Inject constructor(project: Project) {
23
21
val features: FeatureConfiguration = FeatureConfiguration (objects)
24
22
25
23
fun features (action : Action <FeatureConfiguration >) = action.execute(features)
26
-
27
- companion object {
28
- private fun readVersionFromSpecfile (specFile : File ): String {
29
- val swaggerSpec = SwaggerParser ().readWithInfo(specFile.absolutePath, listOf (), false ).swagger
30
-
31
- return when (val version = swaggerSpec.info.version) {
32
- is String -> {
33
- println (" Successfully read version from Swagger Spec file: $version " )
34
- version
35
- }
36
- else -> {
37
- val defaultVersion = " 0.0.0"
38
- println (" Issue in reading version from Swagger Spec file. Falling back to $defaultVersion " )
39
- defaultVersion
40
- }
41
- }
42
- }
43
- }
44
24
}
Original file line number Diff line number Diff line change
1
+ package com.yelp.codegen.plugin
2
+
3
+ import io.swagger.parser.SwaggerParser
4
+ import java.io.File
5
+
6
+ fun readVersionFromSpecfile (specFile : File ): String {
7
+ val swaggerSpec = SwaggerParser ().readWithInfo(specFile.absolutePath, listOf (), false ).swagger
8
+
9
+ return when (val version = swaggerSpec.info.version) {
10
+ is String -> {
11
+ println (" Successfully read version from Swagger Spec file: $version " )
12
+ version
13
+ }
14
+ else -> {
15
+ val defaultVersion = " 0.0.0"
16
+ println (" Issue in reading version from Swagger Spec file. Falling back to $defaultVersion " )
17
+ defaultVersion
18
+ }
19
+ }
20
+ }
You can’t perform that action at this time.
0 commit comments