-
Notifications
You must be signed in to change notification settings - Fork 10.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add incremental build and project references to java projects (#25707)
* Add incremental build and project references to java projects * fb * fix version
- Loading branch information
1 parent
0a33267
commit 4718c11
Showing
7 changed files
with
95 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters