Skip to content

Commit

Permalink
add feature to auto generate protocol versions via maven (#2314)
Browse files Browse the repository at this point in the history
  • Loading branch information
AFine-gs authored Sep 27, 2023
1 parent a33edab commit c9844c1
Show file tree
Hide file tree
Showing 17 changed files with 579 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -368,4 +368,42 @@
</dependency>
<!-- TEST -->
</dependencies>
<profiles>
<profile>
<id>generate-protocol-version</id>
<properties>
<folderPath>core/pure/binding/protocols/pure</folderPath>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>create-protocol-file</id>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target name="protocol">
<copy todir="${basedir}/src/main/resources/${folderPath}/${protocol.TargetVersion}">
<fileset dir="${basedir}/src/main/resources/${folderPath}/${protocol.SourceVersion}" />
</copy>
<replace dir="${basedir}/src/main/resources/${folderPath}/${protocol.TargetVersion}" token= "${protocol.SourceVersion}" value="${protocol.TargetVersion}" />
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>





</project>
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,43 @@
</dependency>
<!-- ECLIPSE COLLECTIONS -->
</dependencies>

<profiles>
<profile>
<id>generate-protocol-version</id>
<properties>
<folderPath>core_authentication/pure</folderPath>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>create-protocol-file</id>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target name="protocol">
<copy todir="${basedir}/src/main/resources/${folderPath}/${protocol.TargetVersion}">
<fileset dir="${basedir}/src/main/resources/${folderPath}/${protocol.SourceVersion}" />
</copy>
<replace dir="${basedir}/src/main/resources/${folderPath}/${protocol.TargetVersion}" token= "${protocol.SourceVersion}" value="${protocol.TargetVersion}" />
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>





</project>
33 changes: 33 additions & 0 deletions legend-engine-xts-avro/legend-engine-xt-avro-pure/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,37 @@

<!-- TEST -->
</dependencies>

<profiles>
<profile>
<id>generate-protocol-version</id>
<properties>
<folderPath>core_external_format_avro/protocol</folderPath>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>create-protocol-file</id>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target name="protocol">
<copy file="${basedir}/src/main/resources/${folderPath}/protocol_${protocol.SourceVersion}.pure" tofile="${basedir}/src/main/resources/${folderPath}/protocol_${protocol.TargetVersion}.pure" />
<replace file="${basedir}/src/main/resources/${folderPath}/protocol_${protocol.TargetVersion}.pure" token= "${protocol.SourceVersion}" value="${protocol.TargetVersion}" />
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -213,4 +213,38 @@
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>generate-protocol-version</id>
<properties>
<folderPath>core_elasticsearch_seven_metamodel/protocol</folderPath>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>create-protocol-file</id>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target name="protocol">
<copy todir="${basedir}/src/main/resources/${folderPath}/${protocol.TargetVersion}">
<fileset dir="${basedir}/src/main/resources/${folderPath}/${protocol.SourceVersion}" />
</copy>
<replace dir="${basedir}/src/main/resources/${folderPath}/${protocol.TargetVersion}" token= "${protocol.SourceVersion}" value="${protocol.TargetVersion}" />
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,41 @@
<packaging>jar</packaging>
<name>Legend Engine - Language Pure - DSL Generation - PAR/JAVA</name>

<profiles>
<profile>
<id>generate-protocol-version</id>
<properties>
<folderPath>core_generation/generation/protocol</folderPath>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>create-protocol-file</id>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target name="protocol">
<copy file="${basedir}/src/main/resources/${folderPath}/protocol_${protocol.SourceVersion}.pure" tofile="${basedir}/src/main/resources/${folderPath}/protocol_${protocol.TargetVersion}.pure" />
<replace file="${basedir}/src/main/resources/${folderPath}/protocol_${protocol.TargetVersion}.pure" token= "${protocol.SourceVersion}" value="${protocol.TargetVersion}" />
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>


<build>

<plugins>
<plugin>
<groupId>org.finos.legend.pure</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,35 @@
</dependency>

</dependencies>

<profiles>
<profile>
<id>generate-protocol-version</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>create-protocol-file</id>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target name="protocol">
<copy todir="${basedir}/src/main/resources/core_nonrelational_mongodb/protocols/pure/${protocol.TargetVersion}">
<fileset dir="${basedir}/src/main/resources/core_nonrelational_mongodb/protocols/pure/v_X_X_X" />
</copy>
<replace dir="${basedir}/src/main/resources/core_nonrelational_mongodb/protocols/pure/${protocol.TargetVersion}" token= "vX_X_X" value="${protocol.TargetVersion}" />
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
32 changes: 32 additions & 0 deletions legend-engine-xts-protobuf/legend-engine-xt-protobuf-pure/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -196,4 +196,36 @@

<!-- TEST -->
</dependencies>

<profiles>
<profile>
<id>generate-protocol-version</id>
<properties>
<folderPath>core_external_format_protobuf/protocol</folderPath>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>create-protocol-file</id>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target name="protocol">
<copy file="${basedir}/src/main/resources/${folderPath}/protocol_${protocol.SourceVersion}.pure" tofile="${basedir}/src/main/resources/${folderPath}/protocol_${protocol.TargetVersion}.pure" />
<replace file="${basedir}/src/main/resources/${folderPath}/protocol_${protocol.TargetVersion}.pure" token= "${protocol.SourceVersion}" value="${protocol.TargetVersion}" />
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,46 @@
<artifactId>jackson-core</artifactId>
<scope>test</scope>
</dependency>

<!-- TEST -->
</dependencies>
<!-- TEST -->


<profiles>
<profile>
<id>generate-protocol-version</id>
<properties>
<folderPath>core_relational_athena/relational/protocols/pure</folderPath>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>create-protocol-file</id>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target name="protocol">
<copy todir="${basedir}/src/main/resources/${folderPath}/${protocol.TargetVersion}">
<fileset dir="${basedir}/src/main/resources/${folderPath}/${protocol.SourceVersion}" />
</copy>
<replace dir="${basedir}/src/main/resources/${folderPath}/${protocol.TargetVersion}" token= "${protocol.SourceVersion}" value="${protocol.TargetVersion}" />
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>





</project>
Original file line number Diff line number Diff line change
Expand Up @@ -248,4 +248,38 @@

<!-- TEST -->
</dependencies>

<profiles>
<profile>
<id>generate-protocol-version</id>
<properties>
<folderPath>core_relational_bigquery/relational/protocols/pure</folderPath>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>create-protocol-file</id>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target name="protocol">
<copy todir="${basedir}/src/main/resources/${folderPath}/${protocol.TargetVersion}">
<fileset dir="${basedir}/src/main/resources/${folderPath}/${protocol.SourceVersion}" />
</copy>
<replace dir="${basedir}/src/main/resources/${folderPath}/${protocol.TargetVersion}" token= "${protocol.SourceVersion}" value="${protocol.TargetVersion}" />
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Loading

0 comments on commit c9844c1

Please sign in to comment.