From 70af20f9699e4bacc3fb8f632a6f1ea0379fc051 Mon Sep 17 00:00:00 2001 From: Andrii Rosa Date: Fri, 8 Nov 2024 11:43:06 -0800 Subject: [PATCH] Support out of tree builds --- .gitignore | 2 +- pom.xml | 83 ++++++++++++++++++++++++++++++++++++++ presto-docs/pom.xml | 10 ++--- presto-thrift-spec/pom.xml | 4 +- 4 files changed, 91 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index dc9c1042f96fc..a4512f9f794d9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ *.iml *.ipr *.iws -target/ +target /var /*/var/ /presto-product-tests/**/var/ diff --git a/pom.xml b/pom.xml index a2dc8d37c01e4..4852f4f7b4663 100644 --- a/pom.xml +++ b/pom.xml @@ -2671,5 +2671,88 @@ + + out-of-tree-build + + false + + out-of-tree-build-root + + + + + + org.codehaus.mojo + exec-maven-plugin + + + unlink-out-of-tree-build-directory + exec + pre-clean + + rm + + -rf + ${project.build.directory} + + + + + remove-out-of-tree-build-directory + exec + pre-clean + + rm + + -rf + ${out-of-tree-build-root}/${project.groupId}:${project.artifactId} + + + + + create-out-of-tree-build-directory + exec + validate + + mkdir + + -p + ${out-of-tree-build-root}/${project.groupId}:${project.artifactId} + + + + + link-out-of-tree-build-directory + exec + validate + + ln + + -sT + ${out-of-tree-build-root}/${project.groupId}:${project.artifactId} + ${project.build.directory} + + + + + + false + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + + checkstyle + + ${out-of-tree-build-root}/${project.groupId}:${project.artifactId}/checkstyle-cachefile + + + + + + + diff --git a/presto-docs/pom.xml b/presto-docs/pom.xml index 7e56cc9ead566..316f59381b81a 100644 --- a/presto-docs/pom.xml +++ b/presto-docs/pom.xml @@ -40,12 +40,12 @@ drift-maven-plugin - validate + generate-sources generate-thrift-idl - ${project.build.directory}/PrestoThriftService.thrift + ${project.build.directory}/thrift/PrestoThriftService.thrift com.facebook.presto.thrift.api.connector.PrestoThriftService @@ -82,7 +82,7 @@ validate-thrift-idl - validate + process-sources exec @@ -92,13 +92,13 @@ -b -c ${project.basedir}/src/main/sphinx/include/PrestoThriftService.thrift - ${project.build.directory}/PrestoThriftService.thrift + ${project.build.directory}/thrift/PrestoThriftService.thrift run-sphinx - package + compile exec diff --git a/presto-thrift-spec/pom.xml b/presto-thrift-spec/pom.xml index 556b04e46689d..5bb6a1eb944a0 100644 --- a/presto-thrift-spec/pom.xml +++ b/presto-thrift-spec/pom.xml @@ -52,7 +52,7 @@ com.facebook.presto.execution.TaskStatus true - target/presto-internal-${project.version}.thrift + target/thrift/presto-internal-${project.version}.thrift @@ -70,7 +70,7 @@ - target/presto-internal-${project.version}.thrift + target/thrift/presto-internal-${project.version}.thrift thrift