Skip to content

Commit

Permalink
feat: introduce exhort-api-spec instead of openapi-generator
Browse files Browse the repository at this point in the history
deprecate openapi-generator from lifecycle build

Signed-off-by: Zvi Grinberg <zgrinber@redhat.com>
  • Loading branch information
zvigrinberg committed Dec 14, 2023
1 parent c6dfe60 commit 67c64cb
Show file tree
Hide file tree
Showing 21 changed files with 40 additions and 327 deletions.
1 change: 1 addition & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
env:
EXHORT_PYTHON3_PATH: "${{steps.python-location.outputs.python-bin-location}}/python3"
EXHORT_PIP3_PATH: "${{steps.python-location.outputs.python-bin-location}}/pip3"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mvn verify -Pcov -B -ff
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ module x { // module-info.java
Code example

```java
import com.redhat.exhort.Api.MixedReport;
import com.redhat.exhort.api.v4.MixedReport;
import com.redhat.exhort.impl.ExhortApi;
import com.redhat.exhort.AnalysisReport;
import java.nio.file.Files;
Expand Down
61 changes: 17 additions & 44 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
<jacoco-maven-plugin.version>0.8.10</jacoco-maven-plugin.version>
<junit-platform-maven-plugin.version>1.1.7</junit-platform-maven-plugin.version>
<license-maven-plugin.version>4.1</license-maven-plugin.version>
<openapi-generator-maven-plugin.version>6.6.0</openapi-generator-maven-plugin.version>
<pitest-maven.version>1.13.2</pitest-maven.version>
<pitest-junit5-plugin.version>1.1.2</pitest-junit5-plugin.version>
<versions-maven-plugin.version>2.15.0</versions-maven-plugin.version>
Expand Down Expand Up @@ -92,6 +91,18 @@
<url>https://github.com/RHEcosystemAppEng/exhort-java-api/actions</url>
</ciManagement>

<repositories>
<repository>
<id>github</id>
<url>https://maven.pkg.github.com/RHEcosystemAppEng/exhort-api-spec</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<dependencyManagement>
<dependencies>
<!-- Dependencies -->
Expand Down Expand Up @@ -223,6 +234,11 @@
<artifactId>mockito-junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.redhat.ecosystemappeng</groupId>
<artifactId>exhort-api-spec</artifactId>
<version>1.0.3</version>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -397,11 +413,6 @@ limitations under the License.]]>
</rules>
</configuration>
</plugin>
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>${openapi-generator-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.pitest</groupId>
<artifactId>pitest-maven</artifactId>
Expand Down Expand Up @@ -616,44 +627,6 @@ limitations under the License.]]>
</executions>
</plugin>

<!-- openapi-generator-maven-plugin:generate is bound to the generate-sources phase and will generate sources from exhort spec -->
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>${project.basedir}/src/main/resources/exhort/openapi.yaml</inputSpec>
<generatorName>java</generatorName>
<modelPackage>com.redhat.exhort.api</modelPackage>
<output>${project.build.directory}</output>
<configOptions>
<documentationProvider>none</documentationProvider>
<hideGenerationTimestamp>true</hideGenerationTimestamp>
<serializableModel>true</serializableModel>
<serializationLibrary>jackson</serializationLibrary>
<sourceFolder>generated-sources</sourceFolder>
<useJakartaEe>true</useJakartaEe>
</configOptions>
<library>native</library>
<!--<generateModels>false</generateModels>-->
<generateApis>false</generateApis>
<generateSupportingFiles>false</generateSupportingFiles>
<generateModelTests>false</generateModelTests>
<generateModelDocumentation>false</generateModelDocumentation>
<generateApiTests>false</generateApiTests>
<addCompileSourceRoot>false</addCompileSourceRoot>
<addTestCompileSourceRoot>false</addTestCompileSourceRoot>
<inlineSchemaNameMappings>analysis_200_response=AnalysisResponse</inlineSchemaNameMappings>
<schemaMappings>PackageRef=com.redhat.exhort.api.PackageRef</schemaMappings>
</configuration>
</execution>
</executions>
</plugin>

</plugins>
</build>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.redhat.exhort.api.AnalysisReport;
import com.redhat.exhort.api.v4.AnalysisReport;
import com.redhat.exhort.impl.ExhortApi;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/redhat/exhort/Api.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import java.util.Objects;
import java.util.concurrent.CompletableFuture;

import com.redhat.exhort.api.AnalysisReport;
import com.redhat.exhort.api.v4.AnalysisReport;

/** The Api interface is used for contracting API implementations. **/
public interface Api {
Expand Down
178 changes: 0 additions & 178 deletions src/main/java/com/redhat/exhort/api/PackageRef.java

This file was deleted.

2 changes: 0 additions & 2 deletions src/main/java/com/redhat/exhort/api/package-info.java

This file was deleted.

This file was deleted.

Loading

0 comments on commit 67c64cb

Please sign in to comment.