Skip to content

Commit 15c2f11

Browse files
Copilotrolfbjarne
andcommitted
Fix git blame caret issue in create-make-config.sh for Linux builds
Co-authored-by: rolfbjarne <249268+rolfbjarne@users.noreply.github.com>
1 parent 1456993 commit 15c2f11

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

create-make-config.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ export LANG
1414
# Compute commit distances
1515
for platform in $ALL_DOTNET_PLATFORMS; do
1616
PLATFORM=$(echo "$platform" | tr '[:lower:]' '[:upper:]')
17-
COMMIT=$(git blame -- ./Make.versions HEAD | grep "${PLATFORM}_NUGET_OS_VERSION=" | sed 's/ .*//')
17+
COMMIT=$(git blame -- ./Make.versions HEAD | grep "${PLATFORM}_NUGET_OS_VERSION=" | sed 's/ .*//' | sed 's/^\^//')
1818
COMMIT_DISTANCE=$(git log "$COMMIT..HEAD" --oneline | wc -l | sed -e 's/ //g')
1919
TOTAL_DISTANCE=$((NUGET_VERSION_COMMIT_DISTANCE_START+COMMIT_DISTANCE))
2020
printf "${PLATFORM}_NUGET_COMMIT_DISTANCE:=$TOTAL_DISTANCE\\n" >> "$OUTPUT_FILE"
2121
done
2222

23-
STABLE_COMMIT=$(git blame -L '/^[#[:blank:]]*NUGET_RELEASE_BRANCH=/,+1' -- ./Make.config HEAD | sed 's/ .*//')
23+
STABLE_COMMIT=$(git blame -L '/^[#[:blank:]]*NUGET_RELEASE_BRANCH=/,+1' -- ./Make.config HEAD | sed 's/ .*//' | sed 's/^\^//')
2424
STABLE_COMMIT_DISTANCE=$(git log "$STABLE_COMMIT..HEAD" --oneline | wc -l | sed -e 's/ //g')
2525
STABLE_TOTAL_DISTANCE=$((STABLE_COMMIT_DISTANCE+NUGET_VERSION_STABLE_COMMIT_DISTANCE_START))
2626

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<!-- All msbuild target logic needs to be inside a project tag -->
2+
<Project DefaultTargets="WriteProjectReferences" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
4+
<!-- Import the project we want to inspect -->
5+
<Import Project="$(ProjectFile)" Condition="'$(ProjectFile)' != ''" />
6+
7+
<!-- Iterates over project references, and output them to the 'ProjReferences' output variable -->
8+
<Target Name="IterateOverReferencedProjects" Condition="'$(ProjectFile)' != '' And '@(ProjectReference)' != ''">
9+
<MSBuild Projects="$(MSBuildProjectFile)" Properties="ProjectFile=$([System.IO.Path]::GetFullPath('$([System.IO.Path]::GetDirectoryName ($(ProjectFile)))/%(ProjectReference.Identity)'))" Targets="WriteProjectReferences" RebaseOutputs="true">
10+
<Output ItemName="ProjReferences" TaskParameter="TargetOutputs"/>
11+
</MSBuild>
12+
</Target>
13+
14+
<!-- Writes the list of project references to 'ReferenceListPath' -->
15+
<Target Name="WriteProjectReferences" Condition="'$(ProjectFile)' != ''" DependsOnTargets="IterateOverReferencedProjects" Outputs ="@(ProjReferences)">
16+
<CreateItem Include="$([System.IO.Path]::GetFullPath('$([System.IO.Path]::GetDirectoryName ($(ProjectFile)))/%(ProjectReference.Identity)'))" Condition="'%(ProjectReference.Identity)' != ''">
17+
<Output ItemName="ProjReferences" TaskParameter="Include"/>
18+
</CreateItem>
19+
<WriteLinesToFile File="$(ReferenceListPath)" Lines="@(ProjReferences)" Overwrite="True" Condition="'$(ReferenceListPath)' != ''" />
20+
</Target>
21+
22+
<!-- Write the list of input files to 'InputsPath' -->
23+
<Target Name="WriteInputs">
24+
<WriteLinesToFile
25+
File="$(InputsPath)"
26+
Lines="@(ProjectReference->'%(FullPath)');@(Compile->'%(FullPath)');@(EmbeddedResource->'%(FullPath)')"
27+
Overwrite="True"
28+
/>
29+
</Target>
30+
</Project>

0 commit comments

Comments
 (0)