forked from devonfw/cobigen
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
devonfw#1509 implemented testAdaptMonolithicTemplatesAndGenerate and …
…testBasicOpenAPIGenerationWithAdaptMonolithicTemplates
- Loading branch information
1 parent
4c5cfab
commit 7ef6a4f
Showing
10 changed files
with
248 additions
and
0 deletions.
There are no files selected for viewing
83 changes: 83 additions & 0 deletions
83
...n/resources/AdaptTemplatesTest/template-sets/adapted/crud-java-server-app-complex/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" | ||
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>com.devonfw.test</groupId> | ||
<artifactId>crud-java-server-app-complex</artifactId> | ||
<version>1.0.0</version> | ||
<packaging>jar</packaging> | ||
<properties> | ||
<maven.compiler.source>1.8</maven.compiler.source> | ||
<maven.compiler.target>1.8</maven.compiler.target> | ||
</properties> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<version>2.3.1</version> | ||
<configuration> | ||
<outputDirectory>../../downloaded</outputDirectory> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-source-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>attach-sources</id> | ||
<goals> | ||
<goal>jar</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<skipSource>${skip.deployment}</skipSource> | ||
<outputDirectory>../../downloaded</outputDirectory> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-resources-plugin</artifactId> | ||
<version>2.7</version> | ||
<configuration> | ||
<encoding>UTF-8</encoding> | ||
</configuration> | ||
</plugin> | ||
<!-- Inject Maven Properties in java-templates source folder --> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>templating-maven-plugin</artifactId> | ||
<version>1.0.0</version> | ||
<executions> | ||
<execution> | ||
<id>generate-maven-properties-class</id> | ||
<goals> | ||
<goal>filter-sources</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-antrun-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<phase>prepare-package</phase> | ||
<goals> | ||
<goal>run</goal> | ||
</goals> | ||
<configuration> | ||
<tasks> | ||
<echo>Integrate POM manually</echo> | ||
<copy file="pom.xml" tofile="${project.build.outputDirectory}/pom.xml"/> | ||
</tasks> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
Empty file.
Empty file.
40 changes: 40 additions & 0 deletions
40
...st/template-sets/adapted/crud-java-server-app-complex/src/main/resources/template-set.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<tns:templateSetConfiguration version="6.0" xmlns:tns="http://capgemini.com/devonfw/cobigen/TemplateSetConfiguration" xmlns:cc="http://capgemini.com/devonfw/cobigen/ContextConfiguration" xmlns:tc="http://capgemini.com/devonfw/cobigen/TemplatesConfiguration" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://capgemini.com/devonfw/cobigen/TemplateSetConfiguration templateSetConfiguration.xsd "> | ||
<cc:contextConfiguration version="3.0"> | ||
<cc:trigger id="crud_java_server_app_complex" type="java"> | ||
<cc:containerMatcher type="package" value="((.+\.)?([^\.]+))\.([^\.]+)\.dataaccess\.api" retrieveObjectsRecursively="false" /> | ||
<cc:matcher type="fqn" value="((.+\.)?([^\.]+))\.([^\.]+)\.dataaccess\.api\.([^\.]+)Entity"> | ||
<cc:variableAssignment type="regex" key="rootPackage" value="1" /> | ||
<cc:variableAssignment type="regex" key="domain" value="3" /> | ||
<cc:variableAssignment type="regex" key="component" value="4" /> | ||
<cc:variableAssignment type="regex" key="entityName" value="5" /> | ||
</cc:matcher> | ||
</cc:trigger> | ||
<cc:tags> | ||
<cc:tag name="Java"></cc:tag> | ||
<cc:tag name="CRUD"></cc:tag> | ||
<cc:tag name="Server"></cc:tag> | ||
<cc:tag name="App"></cc:tag> | ||
</cc:tags> | ||
<cc:links> | ||
<cc:link url="https://docs.spring.io/spring-data/data-commons/docs/1.6.1.RELEASE/reference/html/repositories.html"></cc:link> | ||
</cc:links> | ||
</cc:contextConfiguration> | ||
|
||
<tc:templatesConfiguration version="5.0"> | ||
|
||
<tc:templates> | ||
<tc:templateExtension ref="${variables.entityName}Eto.java" mergeStrategy="javamerge"/> | ||
</tc:templates> | ||
|
||
<tc:templateScans> | ||
<tc:templateScan name="ts_scan" templatePath="templates" destinationPath="" /> | ||
</tc:templateScans> | ||
|
||
<tc:increments> | ||
<tc:increment name="tos" description="TO's"> | ||
<tc:templateRef ref="${variables.entityName}Eto.java"/> | ||
</tc:increment> | ||
</tc:increments> | ||
</tc:templatesConfiguration> | ||
</tns:templateSetConfiguration> |
1 change: 1 addition & 0 deletions
1
...bles.rootPackage}/${variables.component}/logic/api/to/${variables.entityName}Eto.java.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package test; |
83 changes: 83 additions & 0 deletions
83
.../src/main/resources/AdaptTemplatesTest/template-sets/adapted/crud-java-server-app/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" | ||
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>com.devonfw.test</groupId> | ||
<artifactId>crud-java-server-app</artifactId> | ||
<version>1.0.0</version> | ||
<packaging>jar</packaging> | ||
<properties> | ||
<maven.compiler.source>1.8</maven.compiler.source> | ||
<maven.compiler.target>1.8</maven.compiler.target> | ||
</properties> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<version>2.3.1</version> | ||
<configuration> | ||
<outputDirectory>../../downloaded</outputDirectory> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-source-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>attach-sources</id> | ||
<goals> | ||
<goal>jar</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<skipSource>${skip.deployment}</skipSource> | ||
<outputDirectory>../../downloaded</outputDirectory> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-resources-plugin</artifactId> | ||
<version>2.7</version> | ||
<configuration> | ||
<encoding>UTF-8</encoding> | ||
</configuration> | ||
</plugin> | ||
<!-- Inject Maven Properties in java-templates source folder --> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>templating-maven-plugin</artifactId> | ||
<version>1.0.0</version> | ||
<executions> | ||
<execution> | ||
<id>generate-maven-properties-class</id> | ||
<goals> | ||
<goal>filter-sources</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-antrun-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<phase>prepare-package</phase> | ||
<goals> | ||
<goal>run</goal> | ||
</goals> | ||
<configuration> | ||
<tasks> | ||
<echo>Integrate POM manually</echo> | ||
<copy file="pom.xml" tofile="${project.build.outputDirectory}/pom.xml"/> | ||
</tasks> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
Empty file.
Empty file.
40 changes: 40 additions & 0 deletions
40
...platesTest/template-sets/adapted/crud-java-server-app/src/main/resources/template-set.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<tns:templateSetConfiguration version="6.0" xmlns:tns="http://capgemini.com/devonfw/cobigen/TemplateSetConfiguration" xmlns:cc="http://capgemini.com/devonfw/cobigen/ContextConfiguration" xmlns:tc="http://capgemini.com/devonfw/cobigen/TemplatesConfiguration" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://capgemini.com/devonfw/cobigen/TemplateSetConfiguration templateSetConfiguration.xsd "> | ||
<cc:contextConfiguration version="3.0"> | ||
<cc:trigger id="crud_java_server_app" type="java"> | ||
<cc:containerMatcher type="package" value="((.+\.)?([^\.]+))\.([^\.]+)\.dataaccess\.api" retrieveObjectsRecursively="false" /> | ||
<cc:matcher type="fqn" value="((.+\.)?([^\.]+))\.([^\.]+)\.dataaccess\.api\.([^\.]+)Entity"> | ||
<cc:variableAssignment type="regex" key="rootPackage" value="1" /> | ||
<cc:variableAssignment type="regex" key="domain" value="3" /> | ||
<cc:variableAssignment type="regex" key="component" value="4" /> | ||
<cc:variableAssignment type="regex" key="entityName" value="5" /> | ||
</cc:matcher> | ||
</cc:trigger> | ||
<cc:tags> | ||
<cc:tag name="Java"></cc:tag> | ||
<cc:tag name="CRUD"></cc:tag> | ||
<cc:tag name="Server"></cc:tag> | ||
<cc:tag name="App"></cc:tag> | ||
</cc:tags> | ||
<cc:links> | ||
<cc:link url="https://docs.spring.io/spring-data/data-commons/docs/1.6.1.RELEASE/reference/html/repositories.html"></cc:link> | ||
</cc:links> | ||
</cc:contextConfiguration> | ||
|
||
<tc:templatesConfiguration version="5.0"> | ||
|
||
<tc:templates> | ||
<tc:templateExtension ref="${variables.entityName}Eto.java" mergeStrategy="javamerge"/> | ||
</tc:templates> | ||
|
||
<tc:templateScans> | ||
<tc:templateScan name="ts_scan" templatePath="templates" destinationPath="" /> | ||
</tc:templateScans> | ||
|
||
<tc:increments> | ||
<tc:increment name="tos" description="TO's"> | ||
<tc:templateRef ref="${variables.entityName}Eto.java"/> | ||
</tc:increment> | ||
</tc:increments> | ||
</tc:templatesConfiguration> | ||
</tns:templateSetConfiguration> |
1 change: 1 addition & 0 deletions
1
...bles.rootPackage}/${variables.component}/logic/api/to/${variables.entityName}Eto.java.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package test; |