Skip to content

Commit e2701ba

Browse files
committed
renamed project
1 parent 58263db commit e2701ba

File tree

6 files changed

+120
-76
lines changed

6 files changed

+120
-76
lines changed

README.md

Lines changed: 41 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,46 @@
1-
# openapi-generatr-api
1+
# openapi-processor-api
22

3-
This library provides the API any openapi-generatr-? should implement to make it available to an
4-
openapi-generatr consumer, for example the openapi-generatr [gradle plugin][generatr-gradle].
3+
This library provides a simple api for any openapi-processor-* library. By implementing this api it
4+
will automatically work with the openapi-processor [gradle plugin][oap-gradle].
55

6-
A consumer should be able to provide access to any generatr (by the generatr name) that is found on
7-
the class path.
86

9-
For example the gradle plugin will provide a gradle task for each (configured) generatr. The task
10-
will find & run the generatr by using this service interface. By using the service interface the plugin
11-
itself does not need an explicit dependency on any generatr.
12-
137
# implementing the api
148

15-
To make an openapi-generatr available to a consumer (e.g. the openapi-generatr-gradle plugin) it must
16-
- implement the [`OpenApiGeneratr`][generatr-api] interface.
17-
- and provide a `META-INF/services/com.github.hauner.openapi.api.OpenApiGeneratr` property file in its
18-
resources with the class name of the implementing class.
19-
20-
For an example see the implementation in [openapi-generatr-spring][generatr-spring]:
21-
- [`SpringGeneratr`][generatr-spring-api-impl], the entry point of the
22-
generatr.
23-
- and the corresponding [services property][generatr-spring-api-props] file in the resources.
24-
25-
[generatr-gradle]: https://github.com/hauner/openapi-generatr-gradle
26-
[generatr-spring]: https://github.com/hauner/openapi-generatr-spring
27-
[generatr-spring-api-impl]: https://github.com/hauner/openapi-generatr-spring/blob/master/src/main/groovy/com/github/hauner/openapi/spring/generatr/SpringGeneratr.groovy
28-
[generatr-spring-api-props]: https://github.com/hauner/openapi-generatr-spring/blob/master/src/main/resources/META-INF/services/com.github.hauner.openapi.api.OpenApiGeneratr
29-
[generatr-api]: https://github.com/hauner/openapi-generatr-api/tree/master/src/main/java/com/github/hauner/openapi/api/OpenApiGeneratr.java
9+
To make an openapi-processor available to the openapi-processor-gradle plugin it has to
10+
11+
- implement the [`OpenApiProcessor`][oap-api] interface.
12+
13+
The gradle plugin uses the name provided by the api to configure the processor and to provide a
14+
task to run it.
15+
16+
- and provide a `META-INF/services/com.github.hauner.openapi.api.OpenApiProcessor` property file in
17+
the resources with the class name of the implementing class.
18+
19+
# example implementations
20+
21+
For examples see the implementations of
22+
23+
*[openapi-processor-spring][oap-spring]*
24+
25+
- [`SpringProcessor`][oap-spring-api-impl] (the entry point of the openapi-processor-spring)
26+
implements the api interface
27+
- and the corresponding [services property][oap-spring-api-props] file in the resources.
28+
29+
*[openapi-processor-json][oap-json]*
30+
31+
- [`JsonProcessor`][oap-json-api-impl] (the entry point of the openapi-processor-json)
32+
implements the api interface
33+
- and the corresponding [services property][oap-json-api-props] file in the resources.
34+
35+
36+
[oap-api]: https://github.com/hauner/openapi-processor-api/tree/master/src/main/java/com/github/hauner/openapi/api/OpenApiGeneratr.java
37+
[oap-gradle]: https://github.com/hauner/openapi-generatr-gradle
38+
39+
[oap-spring]: https://github.com/hauner/openapi-generatr-spring
40+
[oap-spring-api-impl]: https://github.com/hauner/openapi-generatr-spring/blob/master/src/main/groovy/com/github/hauner/openapi/spring/generatr/SpringGeneratr.groovy
41+
[oap-spring-api-props]: https://github.com/hauner/openapi-generatr-spring/blob/master/src/main/resources/META-INF/services/com.github.hauner.openapi.api.OpenApiGeneratr
42+
43+
[oap-json]: https://github.com/hauner/openapi-generatr-json
44+
[oap-spring-api-impl]: https://github.com/hauner/openapi-generatr-json/blob/master/src/main/groovy/com/github/hauner/openapi/spring/generatr/JsonGeneratr.groovy
45+
[oap-spring-api-props]: https://github.com/hauner/openapi-generatr-json/blob/master/src/main/resources/META-INF/services/com.github.hauner.openapi.api.OpenApiGeneratr
46+

build.gradle

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
plugins {
22
id 'java'
33
id 'java-library'
4-
id 'com.jfrog.bintray' version '1.8.4'
54
id 'maven-publish'
5+
id 'com.jfrog.bintray' version '1.8.4'
6+
id "com.github.ben-manes.versions" version "0.27.0"
67
}
78

89
group 'com.github.hauner.openapi'
9-
version '1.0.0.M3'
10+
version '1.0.0.M4'
1011

1112
sourceCompatibility = 1.8
1213

@@ -23,12 +24,12 @@ dependencies {
2324
}
2425

2526
task sourcesJar(type: Jar, dependsOn: classes) {
26-
archiveClassifier = 'sources'
27+
archiveClassifier.set ('sources')
2728
from sourceSets.main.allSource
2829
}
2930

3031
task javadocJar(type: Jar, dependsOn: javadoc) {
31-
archiveClassifier = 'javadoc'
32+
archiveClassifier.set ('javadoc')
3233
from javadoc.destinationDir
3334
}
3435

@@ -40,14 +41,13 @@ artifacts {
4041
bintray {
4142
user = bintrayUser
4243
key = bintrayKey
43-
publications = ['GeneratrSpring']
44+
publications = ['Processor']
4445

4546
pkg {
46-
repo = 'openapi-generatr'
47-
name = 'openapi-generatr-api'
48-
//userOrg = 'openapi-generatr'
47+
repo = 'openapi-processor'
48+
name = 'openapi-processor-api'
4949
licenses = ['Apache-2.0']
50-
vcsUrl = 'https://github.com/hauner/openapi-generatr-api'
50+
vcsUrl = 'https://github.com/hauner/openapi-processor-api'
5151

5252
version {
5353
name = project.version
@@ -57,7 +57,7 @@ bintray {
5757

5858
publishing {
5959
publications {
60-
GeneratrSpring (MavenPublication) {
60+
Processor (MavenPublication) {
6161
from components.java
6262
artifact sourcesJar
6363
artifact javadocJar
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
#Sat Feb 15 16:04:42 CET 2020
2+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip
13
distributionBase=GRADLE_USER_HOME
24
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip
4-
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6+
zipStoreBase=GRADLE_USER_HOME

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
rootProject.name = 'openapi-generatr-api'
1+
rootProject.name = 'openapi-processor-api'
Lines changed: 4 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019 the original authors
2+
* Copyright 2019-2020 the original authors
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,46 +16,11 @@
1616

1717
package com.github.hauner.openapi.api;
1818

19-
import java.util.Map;
20-
2119
/**
22-
* To make an openapi-generatr available to a consumer (for example the openapi-generatr-gradle plugin)
23-
* it must implement this interface and have a
24-
* {@code META-INF/services/com.github.hauner.openapi.api.OpenApiGeneratr} property file in
25-
* its resources with the class name of the implementing class.
26-
*
27-
* <p>
28-
* A consumer should be able to provide access to any generatr that is found on the class path.
29-
*
30-
* <p>
31-
* For example the gradle plugin will provide a gradle task for each (configured) generatr. This task
32-
* will find and run a generatr by using this service interface. By using the service interface it does
33-
* not need an explicit dependency on a generatr.
20+
* This interface is deprecated, it is replaced by {@code OpenApiProcessor}.
3421
*
3522
* @author Martin Hauner
3623
*/
37-
public interface OpenApiGeneratr {
38-
39-
/**
40-
* The identifying name of the generatr. *Should* be globally unique so a consumer of this
41-
* interface can distinguish between different generatrs.
42-
*
43-
* <p>
44-
* It is recommended to return here the last part of the full generatr name. If the generatr
45-
* jar name is {@code openapi-generatr-spring} the name should be {@code spring}.
46-
* </p>
47-
*
48-
* @return the unique name of the generatr
49-
*/
50-
String getName();
51-
52-
/**
53-
* Runs the generatr with the given options. The options are key value pairs. Keys are of type
54-
* {@code String} and values are of any type. A property hierarchy is possible by using
55-
* {@code Map}s as value.
56-
*
57-
* @param options the generatr configuration
58-
*/
59-
void run(Map<String, ?> options);
60-
24+
@Deprecated
25+
public interface OpenApiGeneratr extends OpenApiProcessor {
6126
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
* Copyright 2019-2020 the original authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.github.hauner.openapi.api;
18+
19+
import java.util.Map;
20+
21+
/**
22+
* To make an openapi-processor available to a consumer (for example the openapi-processor-gradle
23+
* plugin) it must implement this interface and have a
24+
* {@code META-INF/services/com.github.hauner.openapi.api.OpenApiProcessor} property file in the
25+
* resources with the class name of the implementing class.
26+
*
27+
* <p>
28+
* A consumer should be able to provide access to any processor that is found on the class path.
29+
*
30+
* The gradle plugin uses the name provided by the api to configure the processor and to provide a
31+
* task to run it. This task will find and run an openapi-processor by using the
32+
* {@code OpenApiProcessor} service interface. By using interface it does not need an explicit
33+
* dependency on a processor.
34+
*
35+
* @author Martin Hauner
36+
*/
37+
public interface OpenApiProcessor {
38+
39+
/**
40+
* The identifying name of the openapi-processor. *Should* be globally unique so a consumer of
41+
* this interface can distinguish between different openapi-processors.
42+
*
43+
* <p>
44+
* It is recommended to return here the last part of the full openapi-processor name. If the
45+
* processor jar name is {@code openapi-processor-spring} the name should be {@code spring}.
46+
* </p>
47+
*
48+
* @return the unique name of the openapi-processor
49+
*/
50+
String getName();
51+
52+
/**
53+
* Runs the openapi-processor with the given options. The options are key value pairs. Keys are
54+
* of type {@code String} and values are of any type. A property hierarchy is possible by using
55+
* {@code Map}s as value.
56+
*
57+
* @param options the openapi-processor configuration
58+
*/
59+
void run(Map<String, ?> options);
60+
61+
}

0 commit comments

Comments
 (0)