summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpportunityLiu <[email protected]>2019-08-21 13:37:22 +0800
committerOpportunityLiu <[email protected]>2019-08-21 13:37:22 +0800
commitf6b1a4866e1c73aafe6decdc6bfc1d99653f2b64 (patch)
treed34c7d0935b6b9b95b0aad18eec09d04b6d54fec
parentdb2cb167b30b6b69af1ba2d4ea35e2fa4e56eca8 (diff)
make xmake clean --all cofigurable
-rw-r--r--xmake/plugins/project/vsxmake/vsproj/Xmake.props1
-rw-r--r--xmake/plugins/project/vsxmake/vsproj/Xmake.targets5
-rw-r--r--xmake/plugins/project/vsxmake/vsproj/Xmake.xml6
-rw-r--r--xmake/plugins/project/vsxmake/vsproj/templates/Xmake.Custom.props3
4 files changed, 13 insertions, 2 deletions
diff --git a/xmake/plugins/project/vsxmake/vsproj/Xmake.props b/xmake/plugins/project/vsxmake/vsproj/Xmake.props
index 3b4ae268e..ddec0f57d 100644
--- a/xmake/plugins/project/vsxmake/vsproj/Xmake.props
+++ b/xmake/plugins/project/vsxmake/vsproj/Xmake.props
@@ -40,6 +40,7 @@
</PropertyGroup>
<PropertyGroup Label="XmakeFlagsFallback">
+ <XmakeCleanAll Condition="'$(XmakeCleanAll)' == ''">true</XmakeCleanAll>
<XmakeWarning Condition="'$(XmakeWarning)' == ''">true</XmakeWarning>
<XmakeVerbose Condition="'$(XmakeVerbose)' == ''">false</XmakeVerbose>
<XmakeDiagnosis Condition="'$(XmakeDiagnosis)' == ''">false</XmakeDiagnosis>
diff --git a/xmake/plugins/project/vsxmake/vsproj/Xmake.targets b/xmake/plugins/project/vsxmake/vsproj/Xmake.targets
index 99583bf74..81efe2b9b 100644
--- a/xmake/plugins/project/vsxmake/vsproj/Xmake.targets
+++ b/xmake/plugins/project/vsxmake/vsproj/Xmake.targets
@@ -58,6 +58,7 @@
<_XmakeBuildFileFlags Condition="$(XmakeRebuildFile)">$(_XmakeBuildFileFlags.Trim()) -r</_XmakeBuildFileFlags>
<_XmakeCleanFlags>$(XmakeCleanFlags.Trim())</_XmakeCleanFlags>
+ <_XmakeCleanFlags Condition="$(XmakeCleanAll)">-a $(_XmakeCleanFlags.Trim())</_XmakeCleanFlags>
<_XmakeBuildFlags>$(_XmakeBuildFlags.Trim())</_XmakeBuildFlags>
<_XmakeBuildFileFlags>$(_XmakeBuildFileFlags.Trim())</_XmakeBuildFileFlags>
@@ -109,9 +110,9 @@
$(_XmakeExecutable) build $(_XmakeCommonFlags) $(_XmakeBuildFileFlags) $(FileFlag) $(XmakeTarget)" EchoOff="true" />
</Target>
<Target Name="_XmakeClean" DependsOnTargets="_XmakeProjCheck">
- <Message Text="$xmake clean $(_XmakeCommonFlags) -a $(_XmakeCleanFlags) $(XmakeTarget)" Importance="High" />
+ <Message Text="$xmake clean $(_XmakeCommonFlags) $(_XmakeCleanFlags) $(XmakeTarget)" Importance="High" />
<Exec StdOutEncoding="utf-8" StdErrEncoding="utf-8" Command="$(_XmakeEnv)
- $(_XmakeExecutable) clean $(_XmakeCommonFlags) -a $(_XmakeCleanFlags) $(XmakeTarget)" EchoOff="true" />
+ $(_XmakeExecutable) clean $(_XmakeCommonFlags) $(_XmakeCleanFlags) $(XmakeTarget)" EchoOff="true" />
</Target>
<Target Name="Show">
diff --git a/xmake/plugins/project/vsxmake/vsproj/Xmake.xml b/xmake/plugins/project/vsxmake/vsproj/Xmake.xml
index 5e35da3ff..e1bd4b5ec 100644
--- a/xmake/plugins/project/vsxmake/vsproj/Xmake.xml
+++ b/xmake/plugins/project/vsxmake/vsproj/Xmake.xml
@@ -32,6 +32,12 @@
Description="Enable the warnings output for build tasks."
Switch="warning" />
<BoolProperty
+ Name="XmakeCleanAll"
+ DisplayName="Clean all"
+ Category="Common"
+ Description="Clean all auto-generated files by xmake for clean tasks."
+ Switch="all" />
+ <BoolProperty
Name="XmakeRebuildFile"
DisplayName="Force rebuild selected files"
Category="Common"
diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/Xmake.Custom.props b/xmake/plugins/project/vsxmake/vsproj/templates/Xmake.Custom.props
index eaff91446..52b055455 100644
--- a/xmake/plugins/project/vsxmake/vsproj/templates/Xmake.Custom.props
+++ b/xmake/plugins/project/vsxmake/vsproj/templates/Xmake.Custom.props
@@ -25,6 +25,9 @@
For -w, -v and -D, use <XmakeWarning>, <XmakeVerbose> and <XmakeDiagnosis> is more convenient.
-->
+ <!-- Set -a for "xmake clean" -->
+ <!-- <XmakeCleanAll Condition="'$(XmakeCleanAll)' == ''">true</XmakeWarning> -->
+
<!-- Set -w for "xmake build" -->
<!-- <XmakeWarning Condition="'$(XmakeWarning)' == ''">true</XmakeWarning> -->