Skip to content

Commit c44fb99

Browse files
committed
moved to new package
1 parent 3641fe3 commit c44fb99

17 files changed

Lines changed: 109 additions & 88 deletions

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ gradlePlugin {
102102
id = 'io.openapiprocessor.openapi-processor'
103103
displayName = 'Gradle openapi-processor plugin'
104104
description = 'plugin to run openapi-processor-*, e.g. openapi-processor-spring (requires gradle 5.5+)'
105-
implementationClass = 'com.github.hauner.openapi.gradle.OpenApiProcessorPlugin'
105+
implementationClass = 'io.openapiprocessor.gradle.OpenApiProcessorPlugin'
106106
}
107107
}
108108
}

src/main/groovy/com/github/hauner/openapi/gradle/Processor.groovy

Lines changed: 4 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -8,81 +8,13 @@ package com.github.hauner.openapi.gradle
88
import org.gradle.api.file.FileCollection
99

1010
/**
11-
* represents an openapi-processor configured in {@link OpenApiProcessorExtension}
11+
* backward compatibility, replaced by {@link io.openapiprocessor.gradle.Processor}
1212
*/
13-
class Processor {
14-
public static final String API_PATH = 'apiPath'
15-
public static final String TARGET_DIR = 'targetDir'
16-
17-
String name
18-
def dependencies = [] // String | FileCollection...
19-
20-
Map<String, Object> other = [:]
13+
@Deprecated
14+
class Processor extends io.openapiprocessor.gradle.Processor {
2115

2216
Processor (String name) {
23-
this.name = name
24-
}
25-
26-
void processor (FileCollection fc) {
27-
dependencies.add (fc)
28-
}
29-
30-
void processor (String dep) {
31-
dependencies.add (dep)
32-
}
33-
34-
void targetDir (String targetDir) {
35-
other.put (TARGET_DIR, targetDir)
36-
}
37-
38-
void targetDir (GString targetDir) {
39-
other.put (TARGET_DIR, targetDir.toString ())
40-
}
41-
42-
String getTargetDir () {
43-
other.get (TARGET_DIR)
44-
}
45-
46-
void apiPath (String apiPath) {
47-
other.put (API_PATH, apiPath)
48-
}
49-
50-
void apiPath (GString apiPath) {
51-
other.put (API_PATH, apiPath.toString ())
52-
}
53-
54-
boolean hasApiPath () {
55-
other.containsKey (API_PATH)
56-
}
57-
58-
String getApiPath () {
59-
other.get (API_PATH)
60-
}
61-
62-
void setApiPath (String path) {
63-
other.put (API_PATH, path)
64-
}
65-
66-
void prop (Map<String, Object> props) {
67-
other.putAll (props)
68-
}
69-
70-
void prop (String key, Object value) {
71-
other.put (key, value)
72-
}
73-
74-
void prop (GString key, Object value) {
75-
other.put (key.toString (), value)
76-
}
77-
78-
def methodMissing (String name, def args) {
79-
if (args[0] instanceof Closure) {
80-
def builder = new MapBuilder()
81-
builder.with (args[0] as Closure)
82-
other.put (name, builder.get ())
83-
} else {
84-
other.put (name, args[0])
85-
}
17+
super(name)
8618
}
8719

8820
}

src/main/groovy/com/github/hauner/openapi/gradle/MapBuilder.groovy renamed to src/main/groovy/io/openapiprocessor/gradle/MapBuilder.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package com.github.hauner.openapi.gradle
17+
package io.openapiprocessor.gradle
1818

1919
import groovy.util.logging.Slf4j
2020

src/main/groovy/com/github/hauner/openapi/gradle/MissingProcessorException.groovy renamed to src/main/groovy/io/openapiprocessor/gradle/MissingProcessorException.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package com.github.hauner.openapi.gradle
17+
package io.openapiprocessor.gradle
1818

1919
class MissingProcessorException extends Exception {
2020

src/main/groovy/com/github/hauner/openapi/gradle/OpenApiProcessorExtension.groovy renamed to src/main/groovy/io/openapiprocessor/gradle/OpenApiProcessorExtension.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* PDX-License-Identifier: Apache-2.0
44
*/
55

6-
package com.github.hauner.openapi.gradle
6+
package io.openapiprocessor.gradle
77

88
import org.gradle.api.Action
99
import org.gradle.api.Project

src/main/groovy/com/github/hauner/openapi/gradle/OpenApiProcessorPlugin.groovy renamed to src/main/groovy/io/openapiprocessor/gradle/OpenApiProcessorPlugin.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* PDX-License-Identifier: Apache-2.0
44
*/
55

6-
package com.github.hauner.openapi.gradle
6+
package io.openapiprocessor.gradle
77

88
import io.openapiprocessor.gradle.Version
99
import org.gradle.api.Action

src/main/groovy/com/github/hauner/openapi/gradle/OpenApiProcessorTask.groovy renamed to src/main/groovy/io/openapiprocessor/gradle/OpenApiProcessorTask.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package com.github.hauner.openapi.gradle
17+
package io.openapiprocessor.gradle
1818

1919
import org.gradle.api.DefaultTask
2020
import org.gradle.api.file.FileCollection

src/main/groovy/com/github/hauner/openapi/gradle/OpenApiProcessorWorker.groovy renamed to src/main/groovy/io/openapiprocessor/gradle/OpenApiProcessorWorker.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package com.github.hauner.openapi.gradle
17+
package io.openapiprocessor.gradle
1818

1919
import javax.inject.Inject
2020

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
/*
2+
* Copyright 2020 https://github.com/openapi-processor/openapi-processor-gradle
3+
* PDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
package io.openapiprocessor.gradle
7+
8+
9+
import org.gradle.api.file.FileCollection
10+
11+
/**
12+
* represents an openapi-processor configured in {@link OpenApiProcessorExtension}
13+
*/
14+
class Processor {
15+
public static final String API_PATH = 'apiPath'
16+
public static final String TARGET_DIR = 'targetDir'
17+
18+
String name
19+
def dependencies = [] // String | FileCollection...
20+
21+
Map<String, Object> other = [:]
22+
23+
Processor (String name) {
24+
this.name = name
25+
}
26+
27+
void processor (FileCollection fc) {
28+
dependencies.add (fc)
29+
}
30+
31+
void processor (String dep) {
32+
dependencies.add (dep)
33+
}
34+
35+
void targetDir (String targetDir) {
36+
other.put (TARGET_DIR, targetDir)
37+
}
38+
39+
void targetDir (GString targetDir) {
40+
other.put (TARGET_DIR, targetDir.toString ())
41+
}
42+
43+
String getTargetDir () {
44+
other.get (TARGET_DIR)
45+
}
46+
47+
void apiPath (String apiPath) {
48+
other.put (API_PATH, apiPath)
49+
}
50+
51+
void apiPath (GString apiPath) {
52+
other.put (API_PATH, apiPath.toString ())
53+
}
54+
55+
boolean hasApiPath () {
56+
other.containsKey (API_PATH)
57+
}
58+
59+
String getApiPath () {
60+
other.get (API_PATH)
61+
}
62+
63+
void setApiPath (String path) {
64+
other.put (API_PATH, path)
65+
}
66+
67+
void prop (Map<String, Object> props) {
68+
other.putAll (props)
69+
}
70+
71+
void prop (String key, Object value) {
72+
other.put (key, value)
73+
}
74+
75+
void prop (GString key, Object value) {
76+
other.put (key.toString (), value)
77+
}
78+
79+
def methodMissing (String name, def args) {
80+
if (args[0] instanceof Closure) {
81+
def builder = new MapBuilder()
82+
builder.with (args[0] as Closure)
83+
other.put (name, builder.get ())
84+
} else {
85+
other.put (name, args[0])
86+
}
87+
}
88+
89+
}

src/main/groovy/com/github/hauner/openapi/gradle/ProcessorLoader.groovy renamed to src/main/groovy/io/openapiprocessor/gradle/ProcessorLoader.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package com.github.hauner.openapi.gradle
17+
package io.openapiprocessor.gradle
1818

1919
/**
2020
* Find a processor using the ServiceLoader.

0 commit comments

Comments
 (0)