Add incremental build and project references to java projects (#25707)
* Add incremental build and project references to java projects * fb * fix version
This commit is contained in:
parent
0a33267c1c
commit
4718c11f4d
|
|
@ -217,6 +217,7 @@
|
||||||
<Import Project="eng\targets\CSharp.Common.props" Condition="'$(MSBuildProjectExtension)' == '.csproj'" />
|
<Import Project="eng\targets\CSharp.Common.props" Condition="'$(MSBuildProjectExtension)' == '.csproj'" />
|
||||||
<Import Project="eng\targets\Wix.Common.props" Condition="'$(MSBuildProjectExtension)' == '.wixproj'" />
|
<Import Project="eng\targets\Wix.Common.props" Condition="'$(MSBuildProjectExtension)' == '.wixproj'" />
|
||||||
<Import Project="eng\targets\Npm.Common.props" Condition="'$(MSBuildProjectExtension)' == '.npmproj'" />
|
<Import Project="eng\targets\Npm.Common.props" Condition="'$(MSBuildProjectExtension)' == '.npmproj'" />
|
||||||
|
<Import Project="eng\targets\Java.Common.props" Condition="'$(MSBuildProjectExtension)' == '.javaproj'" />
|
||||||
<Import Project="eng\targets\Helix.props" Condition="'$(IsTestProject)' == 'true'" />
|
<Import Project="eng\targets\Helix.props" Condition="'$(IsTestProject)' == 'true'" />
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
||||||
|
|
@ -186,6 +186,7 @@
|
||||||
<Import Project="eng\targets\FSharp.Common.targets" Condition="'$(MSBuildProjectExtension)' == '.fsproj'" />
|
<Import Project="eng\targets\FSharp.Common.targets" Condition="'$(MSBuildProjectExtension)' == '.fsproj'" />
|
||||||
<Import Project="eng\targets\Wix.Common.targets" Condition="'$(MSBuildProjectExtension)' == '.wixproj'" />
|
<Import Project="eng\targets\Wix.Common.targets" Condition="'$(MSBuildProjectExtension)' == '.wixproj'" />
|
||||||
<Import Project="eng\targets\Npm.Common.targets" Condition="'$(MSBuildProjectExtension)' == '.npmproj'" />
|
<Import Project="eng\targets\Npm.Common.targets" Condition="'$(MSBuildProjectExtension)' == '.npmproj'" />
|
||||||
|
<Import Project="eng\targets\Java.Common.targets" Condition="'$(MSBuildProjectExtension)' == '.javaproj'" />
|
||||||
<Import Project="eng\targets\Helix.targets" Condition="'$(IsTestProject)' == 'true'" />
|
<Import Project="eng\targets\Helix.targets" Condition="'$(IsTestProject)' == 'true'" />
|
||||||
<Import Project="eng\targets\FunctionalTestAsset.targets" Condition="'$(IsTestAssetProject)' == 'true'" />
|
<Import Project="eng\targets\FunctionalTestAsset.targets" Condition="'$(IsTestAssetProject)' == 'true'" />
|
||||||
<Import Project="eng\targets\FunctionalTestWithAssets.targets" Condition="'$(ContainsFunctionalTestAssets)' == 'true'" />
|
<Import Project="eng\targets\FunctionalTestWithAssets.targets" Condition="'$(ContainsFunctionalTestAssets)' == 'true'" />
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
<Project>
|
||||||
|
<PropertyGroup>
|
||||||
|
<!-- Disable gradle daemon on CI since the CI seems to try to wait for the daemon to shut down, which it doesn't do -->
|
||||||
|
<GradleOptions Condition="'$(ContinuousIntegrationBuild)' == 'true'">$(GradleOptions) -Dorg.gradle.daemon=false</GradleOptions>
|
||||||
|
<PackOnBuild>false</PackOnBuild>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
|
|
@ -0,0 +1,77 @@
|
||||||
|
<Project DefaultTargets="Build">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)' == ''">$(ArtifactsDir)\obj\</BaseIntermediateOutputPath>
|
||||||
|
<IntermediateOutputPath>$([MSBuild]::NormalizeDirectory('$(BaseIntermediateOutputPath)'))$(Configuration)\</IntermediateOutputPath>
|
||||||
|
<BuildDependsOn>
|
||||||
|
PrepareForBuild;
|
||||||
|
ResolveProjectReferences;
|
||||||
|
_Build;
|
||||||
|
</BuildDependsOn>
|
||||||
|
<JavaBuildArgs Condition="'$(JavaBuildArgs)' == ''">../gradlew $(GradleOptions) compileJava</JavaBuildArgs>
|
||||||
|
<GradleOptions>$(GradleOptions) -PpackageVersion="$(PackageVersion)"</GradleOptions>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<JavaFiles Include="src\**\*.java" />
|
||||||
|
<JavaFiles Include="*.javaproj" />
|
||||||
|
<JavaFiles Include="build.gradle" />
|
||||||
|
|
||||||
|
<BuildOutputFiles Include="$(BaseIntermediateOutputPath)build-sentinel" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<Target Name="Restore" />
|
||||||
|
|
||||||
|
<Target Name="PrepareForBuild">
|
||||||
|
<MakeDir Directories="$(IntermediateOutputPath);$(PackageOutputPath)" />
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
<Target Name="ResolveProjectReferences">
|
||||||
|
<MSBuild Projects="@(ProjectReference)"
|
||||||
|
BuildInParallel="true" />
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
<Target Name="Build" DependsOnTargets="$(BuildDependsOn)" />
|
||||||
|
|
||||||
|
<Target Name="GetBuildInputCacheFile">
|
||||||
|
<Hash ItemsToHash="@(JavaFiles)">
|
||||||
|
<Output TaskParameter="HashResult" PropertyName="_JavaFileHash" />
|
||||||
|
</Hash>
|
||||||
|
|
||||||
|
<WriteLinesToFile
|
||||||
|
Lines="$(_JavaFileHash)"
|
||||||
|
File="$(BaseIntermediateOutputPath)javafiles.cache"
|
||||||
|
Overwrite="True"
|
||||||
|
WriteOnlyWhenDifferent="True" />
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
<Target Name="_Build"
|
||||||
|
Condition="'$(IsBuildable)' != 'false'"
|
||||||
|
DependsOnTargets="GetBuildInputCacheFile"
|
||||||
|
Inputs="@(JavaFiles);$(BaseIntermediateOutputPath)javafiles.cache"
|
||||||
|
Outputs="@(BuildOutputFiles)">
|
||||||
|
<Telemetry EventName="NETCORE_ENGINEERING_TELEMETRY" EventData="Category=Build" />
|
||||||
|
<Exec Command="$(JavaBuildArgs)" />
|
||||||
|
<WriteLinesToFile Overwrite="true" File="$(BaseIntermediateOutputPath)build-sentinel" />
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<PackDependsOn Condition="'$(NoBuild)' != 'true'">
|
||||||
|
Build;
|
||||||
|
$(PackDependsOn);
|
||||||
|
</PackDependsOn>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<Target Name="Pack" Condition="'$(IsPackable)' == 'true'" DependsOnTargets="$(PackDependsOn)">
|
||||||
|
<Telemetry EventName="NETCORE_ENGINEERING_TELEMETRY" EventData="Category=Pack" />
|
||||||
|
<Message Text="> gradlew $(GradleOptions) createPackage" Importance="high" />
|
||||||
|
<Exec Command="../gradlew $(GradleOptions) createPackage" />
|
||||||
|
<Message Importance="high" Text="$(PackageId) -> $(PackageOutputPath)%(JavaBuildFiles.Identity)" />
|
||||||
|
<Copy SourceFiles="$(MSBuildProjectDirectory)\build\libs\%(JavaBuildFiles.Identity)" DestinationFolder="$(PackageOutputPath)" />
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
<Target Name="Test" />
|
||||||
|
|
||||||
|
<Target Name="Publish" />
|
||||||
|
|
||||||
|
</Project>
|
||||||
|
|
@ -7,8 +7,6 @@
|
||||||
<!-- In servicing builds, this will be set to value if the Java client is not configured to be released in the currently building patch. -->
|
<!-- In servicing builds, this will be set to value if the Java client is not configured to be released in the currently building patch. -->
|
||||||
<IsPackable>true</IsPackable>
|
<IsPackable>true</IsPackable>
|
||||||
<IsTestProject>false</IsTestProject>
|
<IsTestProject>false</IsTestProject>
|
||||||
<!-- Disable gradle daemon on CI since the CI seems to try to wait for the daemon to shut down, which it doesn't do :) -->
|
|
||||||
<GradleOptions Condition="'$(ContinuousIntegrationBuild)' == 'true'">$(GradleOptions) -Dorg.gradle.daemon=false</GradleOptions>
|
|
||||||
<PublishDir>$(OutputPath)</PublishDir>
|
<PublishDir>$(OutputPath)</PublishDir>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|
@ -21,37 +19,5 @@
|
||||||
<JavaBuildFiles Include="@(Jars);@(PomFile)"/>
|
<JavaBuildFiles Include="@(Jars);@(PomFile)"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="Restore" />
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<PackDependsOn Condition=" '$(NoBuild)' != 'true' ">
|
|
||||||
$(PackDependsOn);
|
|
||||||
Build
|
|
||||||
</PackDependsOn>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.targets))\Directory.Build.targets" />
|
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.targets))\Directory.Build.targets" />
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<GradleOptions>$(GradleOptions) -PpackageVersion="$(PackageVersion)"</GradleOptions>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<!-- Define Target overrides after importing Directory.Build.targets so these don't get overridden -->
|
|
||||||
<Target Name="Pack" DependsOnTargets="$(PackDependsOn)" Condition="'$(IsPackable)' == 'true'">
|
|
||||||
<Telemetry EventName="NETCORE_ENGINEERING_TELEMETRY" EventData="Category=Pack" />
|
|
||||||
<Message Text="> gradlew $(GradleOptions) createPackage" Importance="high" />
|
|
||||||
<Exec Command="../gradlew $(GradleOptions) createPackage" />
|
|
||||||
<Message Importance="high" Text="java:signalr -> $(PackageOutputPath)%(JavaBuildFiles.Identity)" />
|
|
||||||
<Copy SourceFiles="$(MSBuildThisFileDirectory)build\libs\%(JavaBuildFiles.Identity)" DestinationFolder="$(PackageOutputPath)" />
|
|
||||||
</Target>
|
|
||||||
|
|
||||||
<Target Name="Build">
|
|
||||||
<Telemetry EventName="NETCORE_ENGINEERING_TELEMETRY" EventData="Category=Build" />
|
|
||||||
<Exec Command="../gradlew $(GradleOptions) compileJava" />
|
|
||||||
</Target>
|
|
||||||
|
|
||||||
<Target Name="Test" />
|
|
||||||
|
|
||||||
<Target Name="Publish" />
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,6 @@
|
||||||
<!-- In servicing builds, this will be set to value if the Java client is not configured to be released in the currently building patch. -->
|
<!-- In servicing builds, this will be set to value if the Java client is not configured to be released in the currently building patch. -->
|
||||||
<IsPackable>true</IsPackable>
|
<IsPackable>true</IsPackable>
|
||||||
<IsTestProject>false</IsTestProject>
|
<IsTestProject>false</IsTestProject>
|
||||||
<!-- Disable gradle daemon on CI since the CI seems to try to wait for the daemon to shut down, which it doesn't do :) -->
|
|
||||||
<GradleOptions Condition="'$(ContinuousIntegrationBuild)' == 'true'">$(GradleOptions) -Dorg.gradle.daemon=false</GradleOptions>
|
|
||||||
<PublishDir>$(OutputPath)</PublishDir>
|
<PublishDir>$(OutputPath)</PublishDir>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|
@ -21,37 +19,9 @@
|
||||||
<JavaBuildFiles Include="@(Jars);@(PomFile)"/>
|
<JavaBuildFiles Include="@(Jars);@(PomFile)"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="Restore" />
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="../core/signalr.client.java.core.javaproj" />
|
||||||
<PropertyGroup>
|
</ItemGroup>
|
||||||
<PackDependsOn Condition=" '$(NoBuild)' != 'true' ">
|
|
||||||
$(PackDependsOn);
|
|
||||||
Build
|
|
||||||
</PackDependsOn>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.targets))\Directory.Build.targets" />
|
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.targets))\Directory.Build.targets" />
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<GradleOptions>$(GradleOptions) -PpackageVersion="$(PackageVersion)"</GradleOptions>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<!-- Define Target overrides after importing Directory.Build.targets so these don't get overridden -->
|
|
||||||
<Target Name="Pack" DependsOnTargets="$(PackDependsOn)" Condition="'$(IsPackable)' == 'true'">
|
|
||||||
<Telemetry EventName="NETCORE_ENGINEERING_TELEMETRY" EventData="Category=Pack" />
|
|
||||||
<Message Text="> gradlew $(GradleOptions) createPackage" Importance="high" />
|
|
||||||
<Exec Command="../gradlew $(GradleOptions) createPackage" />
|
|
||||||
<Message Importance="high" Text="java:signalr-messagepack -> $(PackageOutputPath)%(JavaBuildFiles.Identity)" />
|
|
||||||
<Copy SourceFiles="$(MSBuildThisFileDirectory)build\libs\%(JavaBuildFiles.Identity)" DestinationFolder="$(PackageOutputPath)" />
|
|
||||||
</Target>
|
|
||||||
|
|
||||||
<Target Name="Build">
|
|
||||||
<Telemetry EventName="NETCORE_ENGINEERING_TELEMETRY" EventData="Category=Build" />
|
|
||||||
<Exec Command="../gradlew $(GradleOptions) compileJava" />
|
|
||||||
</Target>
|
|
||||||
|
|
||||||
<Target Name="Test" />
|
|
||||||
|
|
||||||
<Target Name="Publish" />
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
||||||
|
|
@ -8,12 +8,15 @@
|
||||||
<SkipHelixArm>true</SkipHelixArm>
|
<SkipHelixArm>true</SkipHelixArm>
|
||||||
<!-- Skipping on Helix for now -->
|
<!-- Skipping on Helix for now -->
|
||||||
<BuildHelixPayload>false</BuildHelixPayload>
|
<BuildHelixPayload>false</BuildHelixPayload>
|
||||||
<!-- Disable gradle daemon on CI since the CI seems to try to wait for the daemon to shut down, which it doesn't do :) -->
|
|
||||||
<GradleOptions Condition="'$(ContinuousIntegrationBuild)' == 'true'">$(GradleOptions) -Dorg.gradle.daemon=false</GradleOptions>
|
|
||||||
<PublishDir>$(OutputPath)</PublishDir>
|
<PublishDir>$(OutputPath)</PublishDir>
|
||||||
<TestDependsOnJava>true</TestDependsOnJava>
|
<TestDependsOnJava>true</TestDependsOnJava>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="../core/signalr.client.java.core.javaproj" />
|
||||||
|
<ProjectReference Include="../messagepack/signalr.client.java.messagepack.javaproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="Restore" />
|
<Target Name="Restore" />
|
||||||
|
|
||||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.targets))\Directory.Build.targets" />
|
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.targets))\Directory.Build.targets" />
|
||||||
|
|
@ -21,9 +24,7 @@
|
||||||
<!-- Define Target overrides after importing Directory.Build.targets so these don't get overridden -->
|
<!-- Define Target overrides after importing Directory.Build.targets so these don't get overridden -->
|
||||||
<Target Name="Pack" />
|
<Target Name="Pack" />
|
||||||
|
|
||||||
<Target Name="Build" />
|
<Target Name="Test" Condition="'$(SkipTests)' != 'true'" DependsOnTargets="Build">
|
||||||
|
|
||||||
<Target Name="Test" Condition="'$(SkipTests)' != 'true'">
|
|
||||||
<Telemetry EventName="NETCORE_ENGINEERING_TELEMETRY" EventData="Category=Test" />
|
<Telemetry EventName="NETCORE_ENGINEERING_TELEMETRY" EventData="Category=Test" />
|
||||||
<Message Text="Running Java client tests" Importance="high" />
|
<Message Text="Running Java client tests" Importance="high" />
|
||||||
<Message Text="> gradlew $(GradleOptions) test" Importance="high" />
|
<Message Text="> gradlew $(GradleOptions) test" Importance="high" />
|
||||||
|
|
@ -46,8 +47,6 @@
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<!-- Pass the Java Package Version down to Gradle -->
|
|
||||||
<GradleOptions>$(GradleOptions) -PpackageVersion="$(PackageVersion)"</GradleOptions>
|
|
||||||
<HelixCommand>chmod +x ./gradlew && ./gradlew $(GradleOptions) test</HelixCommand>
|
<HelixCommand>chmod +x ./gradlew && ./gradlew $(GradleOptions) test</HelixCommand>
|
||||||
<HelixCommand Condition="'$(IsWindowsHelixQueue)' == 'true'">call gradlew $(GradleOptions) test</HelixCommand>
|
<HelixCommand Condition="'$(IsWindowsHelixQueue)' == 'true'">call gradlew $(GradleOptions) test</HelixCommand>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue