diff options
| author | ruki <[email protected]> | 2019-08-24 13:02:00 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-08-24 13:02:00 +0800 |
| commit | 3fd6fc731109c138f3eb2cfcc4700c9004921e2c (patch) | |
| tree | 639659a2e53b7415348779c3adf0cfd0ccd83468 | |
| parent | b501224bebec32d28f721d51373115cd27fbef89 (diff) | |
| parent | 9943cbae2e39a219cd5f889802d9db11aaefda5c (diff) | |
Merge pull request #547 from OpportunityLiu/dev
fix path resolve
4 files changed, 23 insertions, 23 deletions
diff --git a/xmake/plugins/project/vsxmake/getinfo.lua b/xmake/plugins/project/vsxmake/getinfo.lua index 8cfe46591..149df6721 100644 --- a/xmake/plugins/project/vsxmake/getinfo.lua +++ b/xmake/plugins/project/vsxmake/getinfo.lua @@ -267,7 +267,7 @@ function main(outputdir, vsinfo) -- init solution directory vsinfo.solution_dir = path.absolute(path.join(outputdir, "vsxmake" .. vsinfo.vstudio_version)) - vsinfo.programdir = xmake.programdir() + vsinfo.programdir = _make_dirs(xmake.programdir()) vsinfo.projectdir = project.directory() vsinfo.sln_projectfile = path.relative(project.file(), vsinfo.solution_dir) local projectfile = path.filename(project.file()) diff --git a/xmake/plugins/project/vsxmake/vsproj/Xmake.Defaults.props b/xmake/plugins/project/vsxmake/vsproj/Xmake.Defaults.props index df0b5f9e5..29359c951 100644 --- a/xmake/plugins/project/vsxmake/vsproj/Xmake.Defaults.props +++ b/xmake/plugins/project/vsxmake/vsproj/Xmake.Defaults.props @@ -2,19 +2,19 @@ <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup Label="XmakePathsResolve"> - <XmakeProgramDirResolved>$(XmakeProgramDir)</XmakeProgramDirResolved> - <XmakeProjectDirResolved>$(XmakeProjectDir)</XmakeProjectDirResolved> - <XmakeScriptDirResolved>$(XmakeScriptDir)</XmakeScriptDirResolved> + <_XmakeProgramDir>$(XmakeProgramDir)</_XmakeProgramDir> + <_XmakeProjectDir>$(XmakeProjectDir)</_XmakeProjectDir> + <_XmakeScriptDir>$(XmakeScriptDir)</_XmakeScriptDir> <!-- resolve if they are relative paths --> - <XmakeProjectDirResolved Condition="!$([System.IO.Path]::IsPathRooted('$(XmakeProjectDirResolved)'))">$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(XmakeProjectDirResolved)'))</XmakeProjectDirResolved> - <XmakeScriptDirResolved Condition="!$([System.IO.Path]::IsPathRooted('$(XmakeScriptDirResolved)'))">$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(XmakeScriptDirResolved)'))</XmakeScriptDirResolved> - <XmakeBuilDirResolved Condition="!$([System.IO.Path]::IsPathRooted('$(XmakeBuilDirResolved)'))">$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(XmakeBuilDirResolved)'))</XmakeBuilDirResolved> + <_XmakeProgramDir Condition="!$([System.IO.Path]::IsPathRooted('$(_XmakeProgramDir)'))">$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(_XmakeProgramDir)'))</_XmakeProgramDir> + <_XmakeProjectDir Condition="!$([System.IO.Path]::IsPathRooted('$(_XmakeProjectDir)'))">$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(_XmakeProjectDir)'))</_XmakeProjectDir> + <_XmakeScriptDir Condition="!$([System.IO.Path]::IsPathRooted('$(_XmakeScriptDir)'))">$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(_XmakeScriptDir)'))</_XmakeScriptDir> <!-- normalize paths --> - <XmakeProgramDir>$([System.IO.Path]::GetFullPath('$(XmakeProgramDirResolved)'))</XmakeProgramDir> - <XmakeProjectDir>$([System.IO.Path]::GetFullPath('$(XmakeProjectDirResolved)'))</XmakeProjectDir> - <XmakeScriptDir>$([System.IO.Path]::GetFullPath('$(XmakeScriptDirResolved)'))</XmakeScriptDir> + <XmakeProgramDir>$([System.IO.Path]::GetFullPath('$(_XmakeProgramDir)'))</XmakeProgramDir> + <XmakeProjectDir>$([System.IO.Path]::GetFullPath('$(_XmakeProjectDir)'))</XmakeProjectDir> + <XmakeScriptDir>$([System.IO.Path]::GetFullPath('$(_XmakeScriptDir)'))</XmakeScriptDir> </PropertyGroup> </Project> diff --git a/xmake/plugins/project/vsxmake/vsproj/Xmake.targets b/xmake/plugins/project/vsxmake/vsproj/Xmake.targets index 81efe2b9b..62639139d 100644 --- a/xmake/plugins/project/vsxmake/vsproj/Xmake.targets +++ b/xmake/plugins/project/vsxmake/vsproj/Xmake.targets @@ -8,9 +8,6 @@ </ImportGroup> <PropertyGroup Label="XmakePathsResolve"> - <XmakeProgramDirResolved>$(XmakeProgramDir)</XmakeProgramDirResolved> - <XmakeProjectDirResolved>$(XmakeProjectDir)</XmakeProjectDirResolved> - <XmakeScriptDirResolved>$(XmakeScriptDir)</XmakeScriptDirResolved> <XmakeBuilDirResolved>$(XmakeBuilDir)</XmakeBuilDirResolved> <XmakeTargetDirResolved>$(XmakeTargetDir)</XmakeTargetDirResolved> <XmakeConfigDirResolved>$(XmakeConfigDir)</XmakeConfigDirResolved> @@ -18,8 +15,6 @@ <XmakeRunDirResolved>$(XmakeRunDir)</XmakeRunDirResolved> <!-- resolve if they are relative paths --> - <XmakeProjectDirResolved Condition="!$([System.IO.Path]::IsPathRooted('$(XmakeProjectDirResolved)'))">$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(XmakeProjectDirResolved)'))</XmakeProjectDirResolved> - <XmakeScriptDirResolved Condition="!$([System.IO.Path]::IsPathRooted('$(XmakeScriptDirResolved)'))">$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(XmakeScriptDirResolved)'))</XmakeScriptDirResolved> <XmakeBuilDirResolved Condition="!$([System.IO.Path]::IsPathRooted('$(XmakeBuilDirResolved)'))">$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(XmakeBuilDirResolved)'))</XmakeBuilDirResolved> <XmakeTargetDirResolved Condition="!$([System.IO.Path]::IsPathRooted('$(XmakeTargetDirResolved)'))">$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(XmakeTargetDirResolved)'))</XmakeTargetDirResolved> <XmakeConfigDirResolved Condition="!$([System.IO.Path]::IsPathRooted('$(XmakeConfigDirResolved)'))">$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(XmakeConfigDirResolved)'))</XmakeConfigDirResolved> @@ -27,14 +22,16 @@ <XmakeRunDirResolved Condition="!$([System.IO.Path]::IsPathRooted('$(XmakeRunDirResolved)'))">$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(XmakeRunDirResolved)'))</XmakeRunDirResolved> <!-- normalize paths --> - <XmakeProgramDirResolved>$([System.IO.Path]::GetFullPath('$(XmakeProgramDirResolved)/'))</XmakeProgramDirResolved> - <XmakeProjectDirResolved>$([System.IO.Path]::GetFullPath('$(XmakeProjectDirResolved)/'))</XmakeProjectDirResolved> - <XmakeScriptDirResolved>$([System.IO.Path]::GetFullPath('$(XmakeScriptDirResolved)/'))</XmakeScriptDirResolved> <XmakeBuilDirResolved>$([System.IO.Path]::GetFullPath('$(XmakeBuilDirResolved)/'))</XmakeBuilDirResolved> <XmakeTargetDirResolved>$([System.IO.Path]::GetFullPath('$(XmakeTargetDirResolved)/'))</XmakeTargetDirResolved> <XmakeConfigDirResolved>$([System.IO.Path]::GetFullPath('$(XmakeConfigDirResolved)/'))</XmakeConfigDirResolved> <XmakeConfigFileDirResolved>$([System.IO.Path]::GetFullPath('$(XmakeConfigFileDirResolved)/'))</XmakeConfigFileDirResolved> <XmakeRunDirResolved>$([System.IO.Path]::GetFullPath('$(XmakeRunDirResolved)/'))</XmakeRunDirResolved> + + <!-- these paths resolved in Xmake.Default.props, just normalize --> + <XmakeProgramDirResolved>$([System.IO.Path]::GetFullPath('$(XmakeProgramDir)/'))</XmakeProgramDirResolved> + <XmakeProjectDirResolved>$([System.IO.Path]::GetFullPath('$(XmakeProjectDir)/'))</XmakeProjectDirResolved> + <XmakeScriptDirResolved>$([System.IO.Path]::GetFullPath('$(XmakeScriptDir)/'))</XmakeScriptDirResolved> </PropertyGroup> <PropertyGroup Label="XmakeInternal"> @@ -155,6 +152,7 @@ MSBuild Properties: XmakeVerbose: $(XmakeVerbose) XmakeDiagnosis: $(XmakeDiagnosis) XmakeRebuildFile: $(XmakeRebuildFile) + XmakeCleanAll: $(XmakeCleanAll) XmakeCommonFlags: $(XmakeCommonFlags) XmakeConfigFlags: $(XmakeConfigFlags) XmakeBuildFlags: $(XmakeBuildFlags) diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/#target#.vcxproj b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/#target#.vcxproj index cb47d68db..45fcab98b 100644 --- a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/#target#.vcxproj +++ b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/#target#.vcxproj @@ -16,8 +16,6 @@ </ItemGroup> <PropertyGroup Label="Globals"> <ProjectGuid>{#target_id#}</ProjectGuid> - <XmakeProgramDir Condition="'$(XmakeProgramDir)' == ''">$(XMAKE_PROGRAM_DIR)</XmakeProgramDir> - <XmakeProgramDir Condition="'$(XmakeProgramDir)' == ''">#programdir#</XmakeProgramDir> <Configuration Condition="'$(Configuration)' == ''">release</Configuration> <Platform Condition="'$(Platform)' == ''">Win32</Platform> <XmakeScriptDir>#scriptdir#</XmakeScriptDir> @@ -25,10 +23,14 @@ <XmakeProjectFile>#projectfile#</XmakeProjectFile> <XmakeTarget>#target#</XmakeTarget> </PropertyGroup> - <Import Project="$(XmakeProgramDir)\plugins\project\vsxmake\vsproj\xmake.Defaults.props" /> + <PropertyGroup Label="XmakeProgram"> + <XmakeProgramDir Condition="'$(XmakeProgramDir)' == ''">$(XMAKE_PROGRAM_DIR)</XmakeProgramDir> + <XmakeProgramDir Condition="'$(XmakeProgramDir)' == ''">#programdir#</XmakeProgramDir> + </PropertyGroup> + <Import Project="$(XmakeProgramDir)\plugins\project\vsxmake\vsproj\Xmake.Defaults.props" /> #Import(XmakeConfig)# #Import(XmakePath)# - <Import Project="$(XmakeProgramDir)\plugins\project\vsxmake\vsproj\xmake.props" /> + <Import Project="$(XmakeProgramDir)\plugins\project\vsxmake\vsproj\Xmake.props" /> <ItemGroup> #Import(Include)# </ItemGroup> @@ -50,5 +52,5 @@ <!-- <ItemGroup> #Import(ProjectRef)# </ItemGroup> --> - <Import Project="$(XmakeProgramDir)\plugins\project\vsxmake\vsproj\xmake.targets" /> + <Import Project="$(XmakeProgramDir)\plugins\project\vsxmake\vsproj\Xmake.targets" /> </Project> |
