Skip to content

Commit

Permalink
Support out of tree builds
Browse files Browse the repository at this point in the history
  • Loading branch information
arhimondr committed Nov 8, 2024
1 parent 12652e4 commit 8132a19
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
*.iml
*.ipr
*.iws
target/
target
/var
/*/var/
/presto-product-tests/**/var/
Expand Down
83 changes: 83 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2671,5 +2671,88 @@
</plugins>
</build>
</profile>
<profile>
<id>out-of-tree-build</id>
<activation>
<activeByDefault>false</activeByDefault>
<property>
<name>out-of-tree-build-root</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>unlink-out-of-tree-build-directory</id>
<goals><goal>exec</goal></goals>
<phase>pre-clean</phase>
<configuration>
<executable>rm</executable>
<arguments>
<argument>-rf</argument>
<argument>${project.build.directory}</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>remove-out-of-tree-build-directory</id>
<goals><goal>exec</goal></goals>
<phase>pre-clean</phase>
<configuration>
<executable>rm</executable>
<arguments>
<argument>-rf</argument>
<argument>${out-of-tree-build-root}/${project.groupId}:${project.artifactId}</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>create-out-of-tree-build-directory</id>
<goals><goal>exec</goal></goals>
<phase>validate</phase>
<configuration>
<executable>mkdir</executable>
<arguments>
<argument>-p</argument>
<argument>${out-of-tree-build-root}/${project.groupId}:${project.artifactId}</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>link-out-of-tree-build-directory</id>
<goals><goal>exec</goal></goals>
<phase>validate</phase>
<configuration>
<executable>ln</executable>
<arguments>
<argument>-sT</argument>
<argument>${out-of-tree-build-root}/${project.groupId}:${project.artifactId}</argument>
<argument>${project.build.directory}</argument>
</arguments>
</configuration>
</execution>
</executions>
<configuration>
<longModulepath>false</longModulepath>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<executions>
<execution>
<id>checkstyle</id>
<configuration>
<cacheFile>${out-of-tree-build-root}/${project.groupId}:${project.artifactId}/checkstyle-cachefile</cacheFile>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
10 changes: 5 additions & 5 deletions presto-docs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@
<artifactId>drift-maven-plugin</artifactId>
<executions>
<execution>
<phase>validate</phase>
<phase>generate-sources</phase>
<goals>
<goal>generate-thrift-idl</goal>
</goals>
<configuration>
<outputFile>${project.build.directory}/PrestoThriftService.thrift</outputFile>
<outputFile>${project.build.directory}/thrift/PrestoThriftService.thrift</outputFile>
<classes>
<class>com.facebook.presto.thrift.api.connector.PrestoThriftService</class>
</classes>
Expand Down Expand Up @@ -82,7 +82,7 @@
</execution>
<execution>
<id>validate-thrift-idl</id>
<phase>validate</phase>
<phase>process-sources</phase>
<goals>
<goal>exec</goal>
</goals>
Expand All @@ -92,13 +92,13 @@
<argument>-b</argument>
<argument>-c</argument>
<argument>${project.basedir}/src/main/sphinx/include/PrestoThriftService.thrift</argument>
<argument>${project.build.directory}/PrestoThriftService.thrift</argument>
<argument>${project.build.directory}/thrift/PrestoThriftService.thrift</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>run-sphinx</id>
<phase>package</phase>
<phase>compile</phase>
<goals>
<goal>exec</goal>
</goals>
Expand Down
4 changes: 2 additions & 2 deletions presto-thrift-spec/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<class>com.facebook.presto.execution.TaskStatus</class>
</classes>
<recursive>true</recursive>
<outputFile>target/presto-internal-${project.version}.thrift</outputFile>
<outputFile>target/thrift/presto-internal-${project.version}.thrift</outputFile>
</configuration>
</execution>
</executions>
Expand All @@ -70,7 +70,7 @@
<configuration>
<artifacts>
<artifact>
<file>target/presto-internal-${project.version}.thrift</file>
<file>target/thrift/presto-internal-${project.version}.thrift</file>
<type>thrift</type>
</artifact>
</artifacts>
Expand Down

0 comments on commit 8132a19

Please sign in to comment.