Skip to content

Commit

Permalink
HADOOP-18428. Parameterize platform toolset version (#4815)
Browse files Browse the repository at this point in the history
* This PR adds an option
  use.platformToolsetVersion that
  makes the build systems to use
  this platform toolset version.
* This also makes sure that
  win-vs-upgrade.cmd does not get
  executed when the
  use.platformToolsetVersion
  option is specified.
  • Loading branch information
GauthamBanasandra committed Aug 30, 2022
1 parent 8a47ed6 commit c334ba8
Showing 1 changed file with 84 additions and 0 deletions.
84 changes: 84 additions & 0 deletions hadoop-common-project/hadoop-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,36 @@
</execution>
</executions>
</plugin>
<plugin>
<!--Sets the skip.platformToolsetDetection to true if use.platformToolsetVersion is specified.
This implies that the automatic detection of which platform toolset to use will be skipped
and the one specified with use.platformToolsetVersion will be used.-->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<exportAntProperties>true</exportAntProperties>
<target>
<condition property="skip.platformToolsetDetection" value="true" else="false">
<isset property="use.platformToolsetVersion"/>
</condition>
<!--Unfortunately, Maven doesn't have a way to negate a flag, thus we declare a
property which holds the negated value of skip.platformToolsetDetection.-->
<condition property="skip.platformToolsetDetection.negated" value="false" else="true">
<isset property="use.platformToolsetVersion"/>
</condition>
<echo>Skip platform toolset version detection = ${skip.platformToolsetDetection}</echo>
</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
Expand All @@ -852,6 +882,7 @@
<goal>exec</goal>
</goals>
<configuration>
<skip>${skip.platformToolsetDetection}</skip>
<executable>${basedir}\..\..\dev-support\bin\win-vs-upgrade.cmd</executable>
<arguments>
<argument>${basedir}\src\main\winutils</argument>
Expand All @@ -866,6 +897,27 @@
<goal>exec</goal>
</goals>
<configuration>
<skip>${skip.platformToolsetDetection}</skip>
<executable>msbuild</executable>
<arguments>
<argument>${basedir}/src/main/winutils/winutils.sln</argument>
<argument>/nologo</argument>
<argument>/p:Configuration=Release</argument>
<argument>/p:OutDir=${project.build.directory}/bin/</argument>
<argument>/p:IntermediateOutputPath=${project.build.directory}/winutils/</argument>
<argument>/p:WsceConfigDir=${wsce.config.dir}</argument>
<argument>/p:WsceConfigFile=${wsce.config.file}</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>compile-ms-winutils-using-build-tools</id>
<phase>compile</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<skip>${skip.platformToolsetDetection.negated}</skip>
<executable>msbuild</executable>
<arguments>
<argument>${basedir}/src/main/winutils/winutils.sln</argument>
Expand All @@ -875,6 +927,7 @@
<argument>/p:IntermediateOutputPath=${project.build.directory}/winutils/</argument>
<argument>/p:WsceConfigDir=${wsce.config.dir}</argument>
<argument>/p:WsceConfigFile=${wsce.config.file}</argument>
<argument>/p:PlatformToolset=${use.platformToolsetVersion}</argument>
</arguments>
</configuration>
</execution>
Expand All @@ -885,6 +938,7 @@
<goal>exec</goal>
</goals>
<configuration>
<skip>${skip.platformToolsetDetection}</skip>
<executable>${basedir}\..\..\dev-support\bin\win-vs-upgrade.cmd</executable>
<arguments>
<argument>${basedir}\src\main\native</argument>
Expand All @@ -899,6 +953,35 @@
<goal>exec</goal>
</goals>
<configuration>
<skip>${skip.platformToolsetDetection}</skip>
<executable>msbuild</executable>
<arguments>
<argument>${basedir}/src/main/native/native.sln</argument>
<argument>/nologo</argument>
<argument>/p:Configuration=Release</argument>
<argument>/p:OutDir=${project.build.directory}/bin/</argument>
<argument>/p:CustomZstdPrefix=${zstd.prefix}</argument>
<argument>/p:CustomZstdLib=${zstd.lib}</argument>
<argument>/p:CustomZstdInclude=${zstd.include}</argument>
<argument>/p:RequireZstd=${require.zstd}</argument>
<argument>/p:CustomOpensslPrefix=${openssl.prefix}</argument>
<argument>/p:CustomOpensslLib=${openssl.lib}</argument>
<argument>/p:CustomOpensslInclude=${openssl.include}</argument>
<argument>/p:RequireOpenssl=${require.openssl}</argument>
<argument>/p:RequireIsal=${require.isal}</argument>
<argument>/p:CustomIsalPrefix=${isal.prefix}</argument>
<argument>/p:CustomIsalLib=${isal.lib}</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>compile-ms-native-dll-using-build-tools</id>
<phase>compile</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<skip>${skip.platformToolsetDetection.negated}</skip>
<executable>msbuild</executable>
<arguments>
<argument>${basedir}/src/main/native/native.sln</argument>
Expand All @@ -916,6 +999,7 @@
<argument>/p:RequireIsal=${require.isal}</argument>
<argument>/p:CustomIsalPrefix=${isal.prefix}</argument>
<argument>/p:CustomIsalLib=${isal.lib}</argument>
<argument>/p:PlatformToolset=${use.platformToolsetVersion}</argument>
</arguments>
</configuration>
</execution>
Expand Down

0 comments on commit c334ba8

Please sign in to comment.