Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions build-tools/automation/azure-pipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ jobs:
nativeAotRid: win-x64
platformName: .NET - Windows

- template: templates\fail-on-dirty-tree.yaml

- template: templates\fail-on-issue.yaml

- task: PublishPipelineArtifact@1
Expand Down Expand Up @@ -92,6 +94,8 @@ jobs:
nativeAotRid: osx-x64
platformName: .NET - MacOS

- template: templates\fail-on-dirty-tree.yaml

- template: templates\fail-on-issue.yaml


Expand Down
22 changes: 22 additions & 0 deletions build-tools/automation/templates/fail-on-dirty-tree.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Ensure the build did not produce any modified checked in files

parameters:
condition: succeeded()

steps:
- powershell: |
# Run this to log the output for the user
git status

# Run this to error the build if untracked files
$process= git status --porcelain --untracked-files=no

if ($process)
{
Write-Host "##vso[task.logissue type=error]git tree has modified tracked files."
Write-Host "##vso[task.complete result=Failed;]"
}

git diff
displayName: Ensure no modified committed files
condition: ${{ parameters.condition }}
14 changes: 14 additions & 0 deletions src/Java.Base/Java.Base.targets
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,18 @@
</PropertyGroup>
</Target>

<!--
The <GenAPITask/> task always generates files with WIndows line endings,
which causes `git status` to show the file as modified.

Update `$(GenAPITargetPath)` so that it contains Unix line endings..
-->
<Target Name="_FixGenApiLineEndings"
Condition=" !$([MSBuild]::IsOSPlatform ('windows')) "
AfterTargets="GenerateReferenceAssemblySource">
<Move SourceFiles="$(GenAPITargetPath)" DestinationFiles="$(GenAPITargetPath).crlf" />
<Exec Command="tr -d '\015' &lt; $(GenAPITargetPath).crlf > $(GenAPITargetPath)" />
<Delete Files="$(GenAPITargetPath).crlf" />
</Target>

</Project>