diff options
| author | OpportunityLiu <[email protected]> | 2019-07-17 18:01:47 +0800 |
|---|---|---|
| committer | OpportunityLiu <[email protected]> | 2019-07-19 11:48:32 +0800 |
| commit | 5f0af08bc708259905d8bb5921fbe0b354b56f5c (patch) | |
| tree | 4547d8c595da4ad856bee0d5154e0015773830b7 | |
| parent | 4aa3db8ef3c5814c4ac5751a53435f6c6e824e66 (diff) | |
add custom files
6 files changed, 55 insertions, 8 deletions
diff --git a/xmake/plugins/project/vsxmake/vsproj/Xmake.props b/xmake/plugins/project/vsxmake/vsproj/Xmake.props index 1814bc6b9..ac84bf1d7 100644 --- a/xmake/plugins/project/vsxmake/vsproj/Xmake.props +++ b/xmake/plugins/project/vsxmake/vsproj/Xmake.props @@ -138,4 +138,21 @@ <OutDir>$(XmakeTargetDir)</OutDir> <IntDir>$(XmakeBuilDir).vs\$(TargetName)\$(XmakeArch)\$(XmakeMode)\</IntDir> </PropertyGroup> + + <!-- Common files --> + <ItemGroup> + <None Condition="Exists('$(MSBuildProjectDirectory)\Xmake.Custom.props')" + Include="$(MSBuildProjectDirectory)\Xmake.Custom.props" /> + <None Condition="Exists('$(MSBuildProjectDirectory)\Xmake.Custom.targets')" + Include="$(MSBuildProjectDirectory)\Xmake.Custom.targets" /> + <None Condition="Exists('$(MSBuildProjectDirectory)\Xmake.Custom.files')" + Include="$(MSBuildProjectDirectory)\Xmake.Custom.files" /> + <None Condition="Exists('$(MSBuildProjectDirectory)\Xmake.Custom.files.filters')" + Include="$(MSBuildProjectDirectory)\Xmake.Custom.files.filters" /> + <None Condition="'$(XmakeScriptDir)' != '$(XmakeProjectDir)' And Exists('$(XmakeScriptDir)\xmake.lua')" + Include="$(XmakeScriptDir)\xmake.lua" /> + </ItemGroup> + + <Import Condition="Exists('$(MSBuildProjectDirectory)\Xmake.Custom.files')" + Project="$(MSBuildProjectDirectory)\Xmake.Custom.files" /> </Project> diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/Xmake.Custom.files b/xmake/plugins/project/vsxmake/vsproj/templates/Xmake.Custom.files new file mode 100644 index 000000000..a894e8d0d --- /dev/null +++ b/xmake/plugins/project/vsxmake/vsproj/templates/Xmake.Custom.files @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <!-- + Use this file to include custom files for visual studio projects. + + This file will be imported by .vcxproj + --> + <ItemGroup> + <!-- <None Include="$(XmakeProjectDir)\xxx\yyy\zzz" /> --> + </ItemGroup> +</Project> diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/Xmake.Custom.files.filters b/xmake/plugins/project/vsxmake/vsproj/templates/Xmake.Custom.files.filters new file mode 100644 index 000000000..f69e1abb7 --- /dev/null +++ b/xmake/plugins/project/vsxmake/vsproj/templates/Xmake.Custom.files.filters @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <!-- + Use this file to include custom files for visual studio projects. + + This file will be imported by .vcxproj.filters + --> + <ItemGroup> + <!-- <None Include="$(XmakeProjectDir)\xxx\yyy\zzz"> + <Filter>xxx\yyy</Filter> + </None> --> + </ItemGroup> +</Project> diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/#target#.vcxproj.filters b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/#target#.vcxproj.filters index a4c6cf5c1..80a13f280 100644 --- a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/#target#.vcxproj.filters +++ b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/#target#.vcxproj.filters @@ -15,10 +15,16 @@ #Import(Filter)# </ItemGroup> <ItemGroup> - <None Include="Xmake.Custom.props"> + <None Include="$(MSBuildProjectDirectory)\Xmake.Custom.props"> <Filter>Properties</Filter> </None> - <None Include="Xmake.Custom.targets"> + <None Include="$(MSBuildProjectDirectory)\Xmake.Custom.targets"> + <Filter>Properties</Filter> + </None> + <None Include="$(MSBuildProjectDirectory)\Xmake.Custom.files"> + <Filter>Properties</Filter> + </None> + <None Include="$(MSBuildProjectDirectory)\Xmake.Custom.files.filters"> <Filter>Properties</Filter> </None> <None Include="$(XmakeScriptDir)\xmake.lua"> @@ -43,4 +49,6 @@ <ItemGroup> #Import(File.rc)# </ItemGroup> + <Import Condition="Exists('$(MSBuildThisFileDirectory)\Xmake.Custom.files.filters')" + Project="$(MSBuildThisFileDirectory)\Xmake.Custom.files.filters" /> </Project> diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/#target#.vcxproj b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/#target#.vcxproj index 164140542..8df23001e 100644 --- a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/#target#.vcxproj +++ b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/#target#.vcxproj @@ -29,12 +29,6 @@ #Import(XmakePath)# <Import Project="$(XmakeProgramDir)\plugins\project\vsxmake\vsproj\xmake.props" /> <ItemGroup> - <None Include="Xmake.Custom.props" /> - <None Include="Xmake.Custom.targets" /> - <None Condition="'$(XmakeScriptDir)' != '$(XmakeProjectDir)' And Exists('$(XmakeScriptDir)\xmake.lua')" - Include="$(XmakeScriptDir)\xmake.lua" /> - </ItemGroup> - <ItemGroup> #Import(Include)# </ItemGroup> <ItemGroup> diff --git a/xmake/plugins/project/vsxmake/vsxmake.lua b/xmake/plugins/project/vsxmake/vsxmake.lua index cf91eb40e..424d30256 100644 --- a/xmake/plugins/project/vsxmake/vsxmake.lua +++ b/xmake/plugins/project/vsxmake/vsxmake.lua @@ -32,6 +32,8 @@ local template_fil = path.join(template_root, "vcxproj.filters", "#target#.vcxpr 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_files = path.join(template_root, "Xmake.Custom.files") +local template_filefil = path.join(template_root, "Xmake.Custom.files.filters") function _filter_files(files, exts) local extset = hashset.from(exts) @@ -153,6 +155,8 @@ function make(version) -- add project custom file _trycp(template_props, proj_dir) _trycp(template_targets, proj_dir) + _trycp(template_files, proj_dir) + _trycp(template_filefil, proj_dir) -- add project user file _trycp(template_usr, proj_dir, target .. ".vcxproj.user") end |
