blob: 1ac6e73e78286e7e96ae147b9fbf466c33c87837 [file] [log] [blame]
<Project>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<PropertyGroup>
<AssemblyName>Org.Apache.REEF.Bridge.JAR</AssemblyName>
<Description>Helper project that builds the Bridge JAR </Description>
<TargetFramework>net461</TargetFramework>
</PropertyGroup>
<Import Project="..\build.props" />
<PropertyGroup>
<IsPackable>false</IsPackable>
<OutputPath>$(BinDir)$(Configuration)\Org.Apache.REEF.Bridge.JAR\</OutputPath>
</PropertyGroup>
<Import Project="..\build.targets" />
<Import Project="..\pomversion.targets" />
<!--
Check that maven is installed
-->
<Target Name="CheckMavenInstall">
<Error Condition=" '$(M2_HOME)' == '' " Text="$M2_HOME is not set. Please make sure that Maven is installed and configured. See https://cwiki.apache.org/confluence/display/REEF/Compiling+REEF for details." />
<Error Condition=" '$(JAVA_HOME)' == '' " Text="$JAVA_HOME is not set. Please make sure that Java is installed and configured. See https://cwiki.apache.org/confluence/display/REEF/Compiling+REEF for details." />
<Message Text="Using the maven installation found in $(M2_HOME)" Importance="high" />
</Target>
<Target Name="CheckJavaInstall">
<Error Condition=" '$(JAVA_HOME)' == '' " Text="$JAVA_HOME is not set. Please make sure that Java is installed and configured. See https://cwiki.apache.org/confluence/display/REEF/Compiling+REEF for details." />
<Message Text="Using the java installation found in $(JAVA_HOME)" Importance="high" />
</Target>
<Target Name="CheckProtocInstall">
<Exec ContinueOnError="True" IgnoreExitCode="true" Command="&quot;cmd /c where protoc.exe&quot;">
<Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
</Exec>
<Message Text="The exit code is $(ErrorCode)" Importance="high" />
<Error Text="protoc.exe not found. Please make sure that protoc.exe is on the path. See https://cwiki.apache.org/confluence/display/REEF/Compiling+REEF for details." Condition="'$(ErrorCode)' &gt; '0'" />
</Target>
<!--
Executes 'mvn install', if the JAR does not exist.
-->
<Target Name="Build" DependsOnTargets="CheckMavenInstall;CheckJavaInstall;CheckProtocInstall" Outputs="$(OutputPath)">
<PropertyGroup>
<!--The shaded jar of the bridge (driver side) -->
<Bridge_JAR_Name>reef-bridge-java-$(REEF_Version)-shaded.jar</Bridge_JAR_Name>
<Bridge_JAR>$(REEF_Source_Folder)\lang\java\reef-bridge-java\target\$(Bridge_JAR_Name)</Bridge_JAR>
<!--The shaded jar of the bridge (client side) -->
<Client_JAR_Name>reef-bridge-client-$(REEF_Version)-shaded.jar</Client_JAR_Name>
<Client_JAR>$(REEF_Source_Folder)\lang\java\reef-bridge-client\target\$(Client_JAR_Name)</Client_JAR>
</PropertyGroup>
<Exec Command="call &quot;$(M2_HOME)\bin\mvn.cmd&quot; --projects lang/java/reef-bridge-java,lang/java/reef-bridge-client --also-make -TC1 -DskipTests -P!code-quality install" Condition="!Exists('$(Bridge_JAR)')" WorkingDirectory="$(REEF_Source_Folder)" />
<Message Text="Copying jar files to $(OutputPath)" Importance="high" />
<Copy DestinationFolder="$(OutputPath)" SourceFiles="$(Bridge_JAR)" />
<Copy DestinationFolder="$(OutputPath)" SourceFiles="$(Client_JAR)" />
</Target>
<!--
Executes 'mvn clean', if the JAR exists.
-->
<Target Name="Clean" DependsOnTargets="CheckMavenInstall;CheckJavaInstall;CheckProtocInstall">
<PropertyGroup>
<!--The shaded jar of the bridge (driver side) -->
<Bridge_JAR_Name>reef-bridge-java-$(REEF_Version)-shaded.jar</Bridge_JAR_Name>
<Bridge_JAR>$(REEF_Source_Folder)\lang\java\reef-bridge-java\target\$(Bridge_JAR_Name)</Bridge_JAR>
<!--The shaded jar of the bridge (client side) -->
<Client_JAR_Name>reef-bridge-client-$(REEF_Version)-shaded.jar</Client_JAR_Name>
<Client_JAR>$(REEF_Source_Folder)\lang\java\reef-bridge-client\target\$(Client_JAR_Name)</Client_JAR>
</PropertyGroup>
<Exec Command="call &quot;$(M2_HOME)\bin\mvn.cmd&quot; -TC1 -DskipTests -q clean" Condition="Exists('$(Bridge_JAR)')" WorkingDirectory="$(REEF_Source_Folder)" />
<Delete Files="$(OutputPath)\$(Bridge_JAR_Name)" />
<Delete Files="$(OutputPath)\$(Client_JAR_Name)" />
</Target>
<Target Name="Rebuild" DependsOnTargets="Clean;Build" />
<Target Name="CheckPrerequisites" DependsOnTargets="Build" />
</Project>