Skip to content

Commit

Permalink
[DevOps] Skip Code Generation By Default (#123)
Browse files Browse the repository at this point in the history
* DevOps Skip Code Generation By Default

* Fix pom file
  • Loading branch information
MatKuhr authored Nov 4, 2024
1 parent 22b1362 commit b7d7f6e
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 92 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
- name: "Build SDK"
run: |
MVN_ARGS="${{ env.MVN_MULTI_THREADED_ARGS }} clean install -DskipTests -DskipFormatting"
MVN_ARGS="${{ env.MVN_MULTI_THREADED_ARGS }} clean install -Dgenerate -DskipTests -DskipFormatting"
mvn $MVN_ARGS
- name: "Verify Local Changes"
Expand Down
103 changes: 47 additions & 56 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -142,62 +142,53 @@
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<filesets>
<fileset>
<directory>${project.basedir}/src/main/java/com/sap/ai/sdk/core/client</directory>
<includes>
<include>**/*</include>
</includes>
</fileset>
</filesets>
</configuration>
<executions>
<execution>
<id>delete-aicore-generated-client</id>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.sap.cloud.sdk.datamodel</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<configuration>
<outputDirectory>${project.basedir}/src/main/java</outputDirectory>
<apiMaturity>released</apiMaturity>
<enableOneOfAnyOfGeneration>true</enableOneOfAnyOfGeneration>
<compileScope>COMPILE</compileScope>
<!-- Do not delete the output directory because it contains non-generated code -->
<!-- The generated client is instead deleted by the maven-clean-plugin here above -->
<deleteOutputDirectory>false</deleteOutputDirectory>
</configuration>
<executions>
<execution>
<id>aicore</id>
<goals>
<goal>generate</goal>
</goals>
<phase>generate-sources</phase>
<profiles>
<profile>
<id>generate</id>
<activation>
<activeByDefault>false</activeByDefault>
<property>
<name>generate</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>com.sap.cloud.sdk.datamodel</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<configuration>
<inputSpec>${project.basedir}/src/main/resources/spec/aicore.yaml</inputSpec>
<apiPackage>com.sap.ai.sdk.core.client</apiPackage>
<modelPackage>com.sap.ai.sdk.core.client.model</modelPackage>
<additionalProperties>
<pojoBuilderMethodName>create</pojoBuilderMethodName>
<pojoBuildMethodName/>
<pojoConstructorVisibility>protected</pojoConstructorVisibility>
<enumUnknownDefaultCase>true</enumUnknownDefaultCase>
<removeOperationIdPrefix>true</removeOperationIdPrefix>
<removeOperationIdPrefixDelimiter>\.</removeOperationIdPrefixDelimiter>
<removeOperationIdPrefixCount>3</removeOperationIdPrefixCount>
</additionalProperties>
<outputDirectory>${project.basedir}/src/main/java</outputDirectory>
<apiMaturity>released</apiMaturity>
<enableOneOfAnyOfGeneration>true</enableOneOfAnyOfGeneration>
<compileScope>COMPILE</compileScope>
<deleteOutputDirectory>true</deleteOutputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<executions>
<execution>
<id>aicore</id>
<goals>
<goal>generate</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<inputSpec>${project.basedir}/src/main/resources/spec/aicore.yaml</inputSpec>
<apiPackage>com.sap.ai.sdk.core.client</apiPackage>
<modelPackage>com.sap.ai.sdk.core.client.model</modelPackage>
<additionalProperties>
<pojoBuilderMethodName>create</pojoBuilderMethodName>
<pojoBuildMethodName/>
<pojoConstructorVisibility>protected</pojoConstructorVisibility>
<enumUnknownDefaultCase>true</enumUnknownDefaultCase>
<removeOperationIdPrefix>true</removeOperationIdPrefix>
<removeOperationIdPrefixDelimiter>\.</removeOperationIdPrefixDelimiter>
<removeOperationIdPrefixCount>3</removeOperationIdPrefixCount>
</additionalProperties>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
81 changes: 46 additions & 35 deletions orchestration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,41 +120,52 @@
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>com.sap.cloud.sdk.datamodel</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
<!-- skip automatic generation until we can omit API classes from code generation -->
<outputDirectory>${project.basedir}/src/main/java</outputDirectory>
<apiMaturity>beta</apiMaturity>
<enableOneOfAnyOfGeneration>true</enableOneOfAnyOfGeneration>
<compileScope>COMPILE</compileScope>
<deleteOutputDirectory>true</deleteOutputDirectory>
</configuration>
<executions>
<execution>
<id>orchestration</id>
<goals>
<goal>generate</goal>
</goals>
<phase>generate-sources</phase>
<profiles>
<profile>
<id>generate</id>
<activation>
<activeByDefault>false</activeByDefault>
<property>
<name>generate</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>com.sap.cloud.sdk.datamodel</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<configuration>
<inputSpec>${project.basedir}/src/main/resources/spec/orchestration.yaml</inputSpec>
<apiPackage>com.sap.ai.sdk.orchestration.client</apiPackage>
<modelPackage>com.sap.ai.sdk.orchestration.client.model</modelPackage>
<additionalProperties>
<pojoBuilderMethodName>create</pojoBuilderMethodName>
<pojoBuildMethodName/>
<pojoConstructorVisibility>protected</pojoConstructorVisibility>
<enumUnknownDefaultCase>true</enumUnknownDefaultCase>
</additionalProperties>
<skip>true</skip>
<!-- skip automatic generation until we can omit API classes from code generation -->
<outputDirectory>${project.basedir}/src/main/java</outputDirectory>
<apiMaturity>beta</apiMaturity>
<enableOneOfAnyOfGeneration>true</enableOneOfAnyOfGeneration>
<compileScope>COMPILE</compileScope>
<deleteOutputDirectory>true</deleteOutputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<executions>
<execution>
<id>orchestration</id>
<goals>
<goal>generate</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<inputSpec>${project.basedir}/src/main/resources/spec/orchestration.yaml</inputSpec>
<apiPackage>com.sap.ai.sdk.orchestration.client</apiPackage>
<modelPackage>com.sap.ai.sdk.orchestration.client.model</modelPackage>
<additionalProperties>
<pojoBuilderMethodName>create</pojoBuilderMethodName>
<pojoBuildMethodName/>
<pojoConstructorVisibility>protected</pojoConstructorVisibility>
<enumUnknownDefaultCase>true</enumUnknownDefaultCase>
</additionalProperties>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

0 comments on commit b7d7f6e

Please sign in to comment.