mirror of
https://github.com/git-for-windows/git.git
synced 2026-03-26 03:51:40 -05:00
vcxproj: unclash project directories with build outputs
It already caused problems with the test suite that the directory containing `git.vcxproj` is called the same as the Git executable without its file extension: `./git` is ambiguous, it could refer both to the directory `git/` as well as to `git.exe`. Now there is one more problem: when our GitHub workflow runs on the `vs/master` branch, it fails in all but the Windows builds, as they want to write the file `git` but there is already a directory in the way. Let's just go ahead and append `.proj` to all of those directories, e.g. `git.proj/` instead of `git/`. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
@@ -756,7 +756,7 @@ vcxproj:
|
|||||||
|
|
||||||
# Make .vcxproj files and add them
|
# Make .vcxproj files and add them
|
||||||
perl contrib/buildsystems/generate -g Vcxproj
|
perl contrib/buildsystems/generate -g Vcxproj
|
||||||
git add -f git.sln {*,*/lib,t/helper/*}/*.vcxproj
|
git add -f git.sln {*,*/lib.proj,t/helper/*}/*.vcxproj
|
||||||
|
|
||||||
# Generate the LinkOrCopyBuiltins.targets and LinkOrCopyRemoteHttp.targets file
|
# Generate the LinkOrCopyBuiltins.targets and LinkOrCopyRemoteHttp.targets file
|
||||||
(echo '<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">' && \
|
(echo '<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">' && \
|
||||||
@@ -766,7 +766,7 @@ vcxproj:
|
|||||||
echo ' <Copy SourceFiles="$$(OutDir)\git.exe" DestinationFiles="$$(OutDir)\'"$$name"'" SkipUnchangedFiles="true" UseHardlinksIfPossible="true" />'; \
|
echo ' <Copy SourceFiles="$$(OutDir)\git.exe" DestinationFiles="$$(OutDir)\'"$$name"'" SkipUnchangedFiles="true" UseHardlinksIfPossible="true" />'; \
|
||||||
done && \
|
done && \
|
||||||
echo ' </Target>' && \
|
echo ' </Target>' && \
|
||||||
echo '</Project>') >git/LinkOrCopyBuiltins.targets
|
echo '</Project>') >git.proj/LinkOrCopyBuiltins.targets
|
||||||
(echo '<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">' && \
|
(echo '<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">' && \
|
||||||
echo ' <Target Name="CopyBuiltins_AfterBuild" AfterTargets="AfterBuild">' && \
|
echo ' <Target Name="CopyBuiltins_AfterBuild" AfterTargets="AfterBuild">' && \
|
||||||
for name in $(REMOTE_CURL_ALIASES); \
|
for name in $(REMOTE_CURL_ALIASES); \
|
||||||
@@ -774,8 +774,8 @@ vcxproj:
|
|||||||
echo ' <Copy SourceFiles="$$(OutDir)\'"$(REMOTE_CURL_PRIMARY)"'" DestinationFiles="$$(OutDir)\'"$$name"'" SkipUnchangedFiles="true" UseHardlinksIfPossible="true" />'; \
|
echo ' <Copy SourceFiles="$$(OutDir)\'"$(REMOTE_CURL_PRIMARY)"'" DestinationFiles="$$(OutDir)\'"$$name"'" SkipUnchangedFiles="true" UseHardlinksIfPossible="true" />'; \
|
||||||
done && \
|
done && \
|
||||||
echo ' </Target>' && \
|
echo ' </Target>' && \
|
||||||
echo '</Project>') >git-remote-http/LinkOrCopyRemoteHttp.targets
|
echo '</Project>') >git-remote-http.proj/LinkOrCopyRemoteHttp.targets
|
||||||
git add -f git/LinkOrCopyBuiltins.targets git-remote-http/LinkOrCopyRemoteHttp.targets
|
git add -f git.proj/LinkOrCopyBuiltins.targets git-remote-http.proj/LinkOrCopyRemoteHttp.targets
|
||||||
|
|
||||||
# Add generated headers
|
# Add generated headers
|
||||||
$(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 $(GENERATED_H)
|
$(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 $(GENERATED_H)
|
||||||
|
|||||||
@@ -58,8 +58,8 @@ sub createProject {
|
|||||||
my $uuid = generate_guid($name);
|
my $uuid = generate_guid($name);
|
||||||
$$build_structure{"$prefix${target}_GUID"} = $uuid;
|
$$build_structure{"$prefix${target}_GUID"} = $uuid;
|
||||||
my $vcxproj = $target;
|
my $vcxproj = $target;
|
||||||
$vcxproj =~ s/(.*\/)?(.*)/$&\/$2.vcxproj/;
|
$vcxproj =~ s/(.*\/)?(.*)/$&.proj\/$2.vcxproj/;
|
||||||
$vcxproj =~ s/([^\/]*)(\/lib)\/(lib.vcxproj)/$1$2\/$1_$3/;
|
$vcxproj =~ s/([^\/]*)(\/lib\.proj)\/(lib.vcxproj)/$1$2\/$1_$3/;
|
||||||
$$build_structure{"$prefix${target}_VCXPROJ"} = $vcxproj;
|
$$build_structure{"$prefix${target}_VCXPROJ"} = $vcxproj;
|
||||||
|
|
||||||
my @srcs = sort(map("$rel_dir\\$_", @{$$build_structure{"$prefix${name}_SOURCES"}}));
|
my @srcs = sort(map("$rel_dir\\$_", @{$$build_structure{"$prefix${name}_SOURCES"}}));
|
||||||
@@ -89,7 +89,9 @@ sub createProject {
|
|||||||
$defines =~ s/>/>/g;
|
$defines =~ s/>/>/g;
|
||||||
$defines =~ s/\'//g;
|
$defines =~ s/\'//g;
|
||||||
|
|
||||||
die "Could not create the directory $target for $label project!\n" unless (-d "$target" || mkdir "$target");
|
my $dir = $vcxproj;
|
||||||
|
$dir =~ s/\/[^\/]*$//;
|
||||||
|
die "Could not create the directory $dir for $label project!\n" unless (-d "$dir" || mkdir "$dir");
|
||||||
|
|
||||||
open F, ">$vcxproj" or die "Could not open $vcxproj for writing!\n";
|
open F, ">$vcxproj" or die "Could not open $vcxproj for writing!\n";
|
||||||
binmode F, ":crlf :utf8";
|
binmode F, ":crlf :utf8";
|
||||||
@@ -237,7 +239,7 @@ EOM
|
|||||||
|
|
||||||
print F << "EOM";
|
print F << "EOM";
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="$cdup\\libgit\\libgit.vcxproj">
|
<ProjectReference Include="$cdup\\libgit.proj\\libgit.vcxproj">
|
||||||
<Project>$uuid_libgit</Project>
|
<Project>$uuid_libgit</Project>
|
||||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
@@ -252,7 +254,7 @@ EOM
|
|||||||
}
|
}
|
||||||
if (!($name =~ 'xdiff')) {
|
if (!($name =~ 'xdiff')) {
|
||||||
print F << "EOM";
|
print F << "EOM";
|
||||||
<ProjectReference Include="$cdup\\xdiff\\lib\\xdiff_lib.vcxproj">
|
<ProjectReference Include="$cdup\\xdiff\\lib.proj\\xdiff_lib.vcxproj">
|
||||||
<Project>$uuid_xdiff_lib</Project>
|
<Project>$uuid_xdiff_lib</Project>
|
||||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
@@ -261,7 +263,7 @@ EOM
|
|||||||
if ($name =~ /(test-(line-buffer|svn-fe)|^git-remote-testsvn)\.exe$/) {
|
if ($name =~ /(test-(line-buffer|svn-fe)|^git-remote-testsvn)\.exe$/) {
|
||||||
my $uuid_vcs_svn_lib = $$build_structure{"LIBS_vcs-svn/lib_GUID"};
|
my $uuid_vcs_svn_lib = $$build_structure{"LIBS_vcs-svn/lib_GUID"};
|
||||||
print F << "EOM";
|
print F << "EOM";
|
||||||
<ProjectReference Include="$cdup\\vcs-svn\\lib\\vcs-svn_lib.vcxproj">
|
<ProjectReference Include="$cdup\\vcs-svn\\lib.proj\\vcs-svn_lib.vcxproj">
|
||||||
<Project>$uuid_vcs_svn_lib</Project>
|
<Project>$uuid_vcs_svn_lib</Project>
|
||||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
@@ -338,7 +340,7 @@ sub createGlueProject {
|
|||||||
my $vcxproj = $build_structure{"APPS_${appname}_VCXPROJ"};
|
my $vcxproj = $build_structure{"APPS_${appname}_VCXPROJ"};
|
||||||
$vcxproj =~ s/\//\\/g;
|
$vcxproj =~ s/\//\\/g;
|
||||||
$appname =~ s/.*\///;
|
$appname =~ s/.*\///;
|
||||||
print F "\"${appname}\", \"${vcxproj}\", \"${uuid}\"";
|
print F "\"${appname}.proj\", \"${vcxproj}\", \"${uuid}\"";
|
||||||
print F "$SLN_POST";
|
print F "$SLN_POST";
|
||||||
}
|
}
|
||||||
foreach (@libs) {
|
foreach (@libs) {
|
||||||
@@ -348,7 +350,7 @@ sub createGlueProject {
|
|||||||
my $vcxproj = $build_structure{"LIBS_${libname}_VCXPROJ"};
|
my $vcxproj = $build_structure{"LIBS_${libname}_VCXPROJ"};
|
||||||
$vcxproj =~ s/\//\\/g;
|
$vcxproj =~ s/\//\\/g;
|
||||||
$libname =~ s/\//_/g;
|
$libname =~ s/\//_/g;
|
||||||
print F "\"${libname}\", \"${vcxproj}\", \"${uuid}\"";
|
print F "\"${libname}.proj\", \"${vcxproj}\", \"${uuid}\"";
|
||||||
print F "$SLN_POST";
|
print F "$SLN_POST";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user