From 81acc02e79365957d37e98fbe70887edccfebba6 Mon Sep 17 00:00:00 2001 From: OpportunityLiu Date: Sat, 20 Jul 2019 18:33:31 +0800 Subject: add property page --- xmake/plugins/project/vsxmake/vsproj/Xmake.props | 33 ++----- xmake/plugins/project/vsxmake/vsproj/Xmake.targets | 105 ++++++++++++++++----- xmake/plugins/project/vsxmake/vsproj/Xmake.xml | 76 +++++++++++++++ .../vsxmake/vsproj/templates/#target#.vcxproj.user | 10 -- .../vsxmake/vsproj/templates/Xmake.Custom.props | 11 ++- .../vsproj/templates/vcxproj.filters/File.c(filec) | 2 +- .../templates/vcxproj.filters/File.cu(filecu) | 2 +- .../templates/vcxproj.filters/File.cxx(filecxx) | 2 +- .../templates/vcxproj.filters/File.obj(fileobj) | 2 +- .../templates/vcxproj.filters/File.rc(filerc) | 2 +- .../vsproj/templates/vcxproj.filters/Include(inc) | 2 +- .../vsxmake/vsproj/templates/vcxproj/File.c(filec) | 2 +- .../vsproj/templates/vcxproj/File.cu(filecu) | 2 +- .../vsproj/templates/vcxproj/File.cxx(filecxx) | 2 +- .../vsproj/templates/vcxproj/File.obj(fileobj) | 2 +- .../vsproj/templates/vcxproj/File.rc(filerc) | 2 +- .../vsxmake/vsproj/templates/vcxproj/Include(inc) | 2 +- xmake/plugins/project/vsxmake/vsxmake.lua | 3 - 18 files changed, 184 insertions(+), 78 deletions(-) create mode 100644 xmake/plugins/project/vsxmake/vsproj/Xmake.xml delete mode 100644 xmake/plugins/project/vsxmake/vsproj/templates/#target#.vcxproj.user diff --git a/xmake/plugins/project/vsxmake/vsproj/Xmake.props b/xmake/plugins/project/vsxmake/vsproj/Xmake.props index e954a435b..55fd2bdc5 100644 --- a/xmake/plugins/project/vsxmake/vsproj/Xmake.props +++ b/xmake/plugins/project/vsxmake/vsproj/Xmake.props @@ -1,5 +1,6 @@ + $(Configuration) @@ -38,31 +39,11 @@ $(XmakeTargetDir) - - - $([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(XmakeProjectDir)')) - $([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(XmakeScriptDir)')) - $([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(XmakeBuilDir)')) - $([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(XmakeTargetDir)')) - $([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(XmakeConfigDir)')) - $([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(XmakeConfigFileDir)')) - $([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(XmakeRunDir)')) - - - $([System.IO.Path]::GetFullPath('$(XmakeProgramDir)/')) - $([System.IO.Path]::GetFullPath('$(XmakeProjectDir)/')) - $([System.IO.Path]::GetFullPath('$(XmakeScriptDir)/')) - $([System.IO.Path]::GetFullPath('$(XmakeBuilDir)/')) - $([System.IO.Path]::GetFullPath('$(XmakeTargetDir)/')) - $([System.IO.Path]::GetFullPath('$(XmakeConfigDir)/')) - $([System.IO.Path]::GetFullPath('$(XmakeConfigFileDir)/')) - $([System.IO.Path]::GetFullPath('$(XmakeRunDir)/')) - - true false false + false @@ -116,6 +97,12 @@ + + + Project + + + @@ -135,8 +122,8 @@ $(XmakeIncludeDir);$(IncludePath) $(XmakeLinkDir);$(LibraryPath) - $(XmakeTargetDir) - $(XmakeBuilDir).vs\$(TargetName)\$(XmakeArch)\$(XmakeMode)\ + $(XmakeTargetDir)\ + $(XmakeBuilDir)\.vs\$(TargetName)\$(XmakeArch)\$(XmakeMode)\ diff --git a/xmake/plugins/project/vsxmake/vsproj/Xmake.targets b/xmake/plugins/project/vsxmake/vsproj/Xmake.targets index 55a698927..8aa2db642 100644 --- a/xmake/plugins/project/vsxmake/vsproj/Xmake.targets +++ b/xmake/plugins/project/vsxmake/vsproj/Xmake.targets @@ -7,36 +7,80 @@ Project="$(VCTargetsPath)\BuildCustomizations\CUDA $(XmakeCudaVersion).targets" /> + + $(XmakeProgramDir) + $(XmakeProjectDir) + $(XmakeScriptDir) + $(XmakeBuilDir) + $(XmakeTargetDir) + $(XmakeConfigDir) + $(XmakeConfigFileDir) + $(XmakeRunDir) + + + $([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(XmakeProjectDirResolved)')) + $([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(XmakeScriptDirResolved)')) + $([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(XmakeBuilDirResolved)')) + $([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(XmakeTargetDirResolved)')) + $([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(XmakeConfigDirResolved)')) + $([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(XmakeConfigFileDirResolved)')) + $([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(XmakeRunDirResolved)')) + + + $([System.IO.Path]::GetFullPath('$(XmakeProgramDirResolved)/')) + $([System.IO.Path]::GetFullPath('$(XmakeProjectDirResolved)/')) + $([System.IO.Path]::GetFullPath('$(XmakeScriptDirResolved)/')) + $([System.IO.Path]::GetFullPath('$(XmakeBuilDirResolved)/')) + $([System.IO.Path]::GetFullPath('$(XmakeTargetDirResolved)/')) + $([System.IO.Path]::GetFullPath('$(XmakeConfigDirResolved)/')) + $([System.IO.Path]::GetFullPath('$(XmakeConfigFileDirResolved)/')) + $([System.IO.Path]::GetFullPath('$(XmakeRunDirResolved)/')) + + + + $(XmakeRunDirResolved) + $(XmakeRunEnvs) +$(LocalDebuggerEnvironment) + true + $(XmakeRunDirResolved) + WindowsRemoteDebugger + $(XmakeRunEnvs) +$(RemoteDebuggerEnvironment) + + <_XmakeProjectFlag Condition="'$(XmakeProjectFile)' != ''">-F "$(XmakeProjectFile)" <_XmakeProjectFlag Condition="'$(XmakeProjectFile)' == ''">-P . <_XmakeCommonFlags>$(XmakeCommonFlags.Trim()) - <_XmakeCommonFlags Condition="$(XmakeVerbose)">-v $(_XmakeCommonFlags) - <_XmakeCommonFlags Condition="$(XmakeDiagnosis)">-D $(_XmakeCommonFlags) - <_XmakeCommonFlags>$(XmakeCommonFlags.Trim()) - <_XmakeCommonFlags>$(_XmakeCommonFlags) $(_XmakeProjectFlag) + <_XmakeCommonFlags Condition="$(XmakeVerbose)">-v $(_XmakeCommonFlags.Trim()) + <_XmakeCommonFlags Condition="$(XmakeDiagnosis)">-D $(_XmakeCommonFlags.Trim()) + <_XmakeCommonFlags>$(_XmakeCommonFlags.Trim()) $(_XmakeProjectFlag) - <_XmakeBuilDir>$([MSBuild]::MakeRelative('$(XmakeProjectDir)', '$(XmakeBuilDir)').TrimEnd('/\'.ToCharArray())) + <_XmakeOutFlag>-o "$([MSBuild]::MakeRelative('$(XmakeProjectDirResolved)', '$(XmakeBuilDirResolved)').TrimEnd('/\'.ToCharArray()))" <_XmakeConfigFlags>$(XmakeConfigFlags.Trim()) - <_XmakeConfigFlags>-p $(XmakePlat) -m $(XmakeMode) -a $(XmakeArch) -o "$(_XmakeBuilDir)" $(_XmakeConfigFlags) + <_XmakeConfigFlags>-p $(XmakePlat) -m $(XmakeMode) -a $(XmakeArch) $(_XmakeOutFlag) $(_XmakeConfigFlags.Trim()) <_XmakeBuildFlags>$(XmakeBuildFlags.Trim()) - <_XmakeBuildFlags Condition="$(XmakeWarning)">-w $(_XmakeBuildFlags) + <_XmakeBuildFlags Condition="$(XmakeWarning)">-w $(_XmakeBuildFlags.Trim()) + + <_XmakeBuildFileFlags>$(_XmakeBuildFlags.Trim()) + <_XmakeBuildFileFlags Condition="$(XmakeRebuildFile)">$(_XmakeBuildFileFlags.Trim()) -r <_XmakeCleanFlags>$(XmakeCleanFlags.Trim()) <_XmakeBuildFlags>$(_XmakeBuildFlags.Trim()) + <_XmakeBuildFileFlags>$(_XmakeBuildFileFlags.Trim()) <_XmakeCleanFlags>$(_XmakeCleanFlags.Trim()) <_XmakeConfigFlags>$(_XmakeConfigFlags.Trim()) <_XmakeCommonFlags>$(_XmakeCommonFlags.Trim()) - <_XmakeExecutable>"$([System.IO.Path]::GetFullPath('$(XmakeProgramDir)xmake.exe'))" + <_XmakeExecutable>"$([System.IO.Path]::GetFullPath('$(XmakeProgramDirResolved)xmake.exe'))" <_XmakeEnv> chcp 65001 > NUL - set XMAKE_CONFIGDIR=$(XmakeConfigDir.TrimEnd('/\'.ToCharArray())) - set XMAKE_PROGRAM_DIR=$(XmakeProgramDir.TrimEnd('/\'.ToCharArray())) + set XMAKE_CONFIGDIR=$(XmakeConfigDirResolved.TrimEnd('/\'.ToCharArray())) + set XMAKE_PROGRAM_DIR=$(XmakeProgramDirResolved.TrimEnd('/\'.ToCharArray())) @@ -45,44 +89,44 @@ Text="File '$(VCTargetsPath)\BuildCustomizations\CUDA $(XmakeCudaVersion).targets' not found" /> - - - + + + - - - - + @(File) --files="$(FileList)" - - + + - @@ -99,6 +143,8 @@ MSBuild Properties: XmakeMfcKind: $(XmakeMfcKind) XmakeDefines: $(XmakeDefines) XmakeLanguages: $(XmakeLanguages) + XmakeIncludeDir: $(XmakeIncludeDir) + XmakeLinkDir: $(XmakeLinkDir) Xmake Path: XmakeProgramDir: $(XmakeProgramDir) XmakeProjectDir: $(XmakeProjectDir) @@ -106,12 +152,18 @@ MSBuild Properties: XmakeBuilDir: $(XmakeBuilDir) XmakeConfigDir: $(XmakeConfigDir) XmakeConfigFileDir: $(XmakeConfigFileDir) - XmakeIncludeDir: $(XmakeIncludeDir) - XmakeLinkDir: $(XmakeLinkDir) + Xmake Resolved Path: + XmakeProgramDir: $(XmakeProgramDirResolved) + XmakeProjectDir: $(XmakeProjectDirResolved) + XmakeScriptDir: $(XmakeScriptDirResolved) + XmakeBuilDir: $(XmakeBuilDirResolved) + XmakeConfigDir: $(XmakeConfigDirResolved) + XmakeConfigFileDir: $(XmakeConfigFileDirResolved) Xmake Flags: XmakeWarning: $(XmakeWarning) XmakeVerbose: $(XmakeVerbose) XmakeDiagnosis: $(XmakeDiagnosis) + XmakeRebuildFile: $(XmakeRebuildFile) XmakeCommonFlags: $(XmakeCommonFlags) XmakeConfigFlags: $(XmakeConfigFlags) XmakeBuildFlags: $(XmakeBuildFlags) @@ -120,6 +172,7 @@ MSBuild Properties: _XmakeCommonFlags: $(_XmakeCommonFlags) _XmakeConfigFlags: $(_XmakeConfigFlags) _XmakeBuildFlags: $(_XmakeBuildFlags) + _XmakeBuildFileFlags: $(_XmakeBuildFileFlags) _XmakeCleanFlags: $(_XmakeCleanFlags) _XmakeExecutable: $(_XmakeExecutable) _XmakeEnv: $(_XmakeEnv) diff --git a/xmake/plugins/project/vsxmake/vsproj/Xmake.xml b/xmake/plugins/project/vsxmake/vsproj/Xmake.xml new file mode 100644 index 000000000..5e35da3ff --- /dev/null +++ b/xmake/plugins/project/vsxmake/vsproj/Xmake.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/#target#.vcxproj.user b/xmake/plugins/project/vsxmake/vsproj/templates/#target#.vcxproj.user deleted file mode 100644 index a994443e1..000000000 --- a/xmake/plugins/project/vsxmake/vsproj/templates/#target#.vcxproj.user +++ /dev/null @@ -1,10 +0,0 @@ - - - - - $(XmakeRunDir) - $(XmakeRunEnvs) -$(LocalDebuggerEnvironment) - true - - \ No newline at end of file diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/Xmake.Custom.props b/xmake/plugins/project/vsxmake/vsproj/templates/Xmake.Custom.props index 55f596456..eaff91446 100644 --- a/xmake/plugins/project/vsxmake/vsproj/templates/Xmake.Custom.props +++ b/xmake/plugins/project/vsxmake/vsproj/templates/Xmake.Custom.props @@ -34,17 +34,20 @@ + + + - $(XmakeCleanflags) + - $(XmakeBuildFlags) + - $(XmakeConfigFlags) + - $(XmakeCommonFlags) + diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.c(filec) b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.c(filec) index 020488ce4..79327d35d 100644 --- a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.c(filec) +++ b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.c(filec) @@ -1,3 +1,3 @@ - + #dir# diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.cu(filecu) b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.cu(filecu) index 520e88430..189e6d220 100644 --- a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.cu(filecu) +++ b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.cu(filecu) @@ -1,3 +1,3 @@ - + #dir# diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.cxx(filecxx) b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.cxx(filecxx) index 020488ce4..79327d35d 100644 --- a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.cxx(filecxx) +++ b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.cxx(filecxx) @@ -1,3 +1,3 @@ - + #dir# diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.obj(fileobj) b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.obj(fileobj) index 5ee8281b7..e62ea9e9e 100644 --- a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.obj(fileobj) +++ b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.obj(fileobj) @@ -1,3 +1,3 @@ - + #dir# diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.rc(filerc) b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.rc(filerc) index c1118ab55..f7bd9969f 100644 --- a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.rc(filerc) +++ b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.rc(filerc) @@ -1,3 +1,3 @@ - + #dir# diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/Include(inc) b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/Include(inc) index 3a21dc7bf..8c9e8a547 100644 --- a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/Include(inc) +++ b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/Include(inc) @@ -1,3 +1,3 @@ - + #dir# diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.c(filec) b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.c(filec) index 68c1a7d5b..5a9bc59f3 100644 --- a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.c(filec) +++ b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.c(filec) @@ -1,3 +1,3 @@ - + CompileAsC diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.cu(filecu) b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.cu(filecu) index 1d1d98f7d..ee6f7ffce 100644 --- a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.cu(filecu) +++ b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.cu(filecu) @@ -1 +1 @@ - + diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.cxx(filecxx) b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.cxx(filecxx) index a8534b74b..92a8b031f 100644 --- a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.cxx(filecxx) +++ b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.cxx(filecxx) @@ -1,3 +1,3 @@ - + CompileAsCpp diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.obj(fileobj) b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.obj(fileobj) index 5c858884d..2e1c1ed1d 100644 --- a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.obj(fileobj) +++ b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.obj(fileobj) @@ -1 +1 @@ - + diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.rc(filerc) b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.rc(filerc) index e15b89bbe..34612f2ef 100644 --- a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.rc(filerc) +++ b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/File.rc(filerc) @@ -1 +1 @@ - + diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/Include(inc) b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/Include(inc) index dfd5df637..ddafd770a 100644 --- a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/Include(inc) +++ b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/Include(inc) @@ -1 +1 @@ - + diff --git a/xmake/plugins/project/vsxmake/vsxmake.lua b/xmake/plugins/project/vsxmake/vsxmake.lua index 2526b00cb..d38465489 100644 --- a/xmake/plugins/project/vsxmake/vsxmake.lua +++ b/xmake/plugins/project/vsxmake/vsxmake.lua @@ -30,7 +30,6 @@ local template_sln = path.join(template_root, "sln", "vsxmake.sln") local template_vcx = path.join(template_root, "vcxproj", "#target#.vcxproj") local template_fil = path.join(template_root, "vcxproj.filters", "#target#.vcxproj.filters") -local template_usr = path.join(template_root, "#target#.vcxproj.user") local template_props = path.join(template_root, "Xmake.Custom.props") local template_targets = path.join(template_root, "Xmake.Custom.targets") local template_items = path.join(template_root, "Xmake.Custom.items") @@ -168,8 +167,6 @@ function make(version) _trycp(template_targets, proj_dir) _trycp(template_items, proj_dir) _trycp(template_itemfil, proj_dir) - -- add project user file - _trycp(template_usr, proj_dir, target .. ".vcxproj.user") end end end -- cgit v1.3.1