Explorar el Código

add set_group

ruki hace 5 años
padre
commit
c5681c187e

BIN
assets/img/manual/set_group.png


+ 47 - 0
manual/project_target.md

@@ -126,6 +126,7 @@ target("test2")
 | [set_plat](#targetset_plat)                     | Set the compilation platform for the specified target     | >= 2.3.5                    |
 | [set_arch](#targetset_arch)                     | Set the compilation architecture for the specified target | >= 2.3.5                    |
 | [set_runtimes](#targetset_runtimes)             | Set the runtime library of the compilation target         | >= 2.5.1                    |
+| [set_group](#targetset_group)                   | Set target group                                          | >= 2.5.1                    |
 
 ### target
 
@@ -2595,3 +2596,49 @@ Of course, we can also use `add_requires("xx", {configs = {vs_runtime = "MD"}})`
 We can also use `xmake f --vs_runtime=MD` to switch it globally through parameter configuration.
 
 Issues related to this api: [#1071](https://github.com/xmake-io/xmake/issues/1071#issuecomment-750817681)
+
+### target:set_group
+
+#### Set target group
+
+At present, this interface is only used to generate the vs/vsxmake project. The sub-project directory tree of the vs project is displayed in groups according to the specified structure, but grouping support may be added to other modules in the future.
+
+For example, for the following grouping configuration:
+
+```lua
+add_rules("mode.debug", "mode.release")
+
+target("test1")
+     set_kind("binary")
+     add_files("src/*.cpp")
+     set_group("group1")
+
+target("test2")
+     set_kind("binary")
+     add_files("src/*.cpp")
+     set_group("group1")
+
+target("test3")
+     set_kind("binary")
+     add_files("src/*.cpp")
+     set_group("group1/group2")
+
+target("test4")
+     set_kind("binary")
+     add_files("src/*.cpp")
+     set_group("group3/group4")
+
+target("test5")
+     set_kind("binary")
+     add_files("src/*.cpp")
+
+target("test6")
+     set_kind("binary")
+     add_files("src/*.cpp")
+```
+
+The effect of the generated VS project directory structure is as follows:
+
+![](assets/img/manual/set_group.png)
+
+For more details, please see: [#1026](https://github.com/xmake-io/xmake/issues/1026)

+ 42 - 0
mirror/manual/project_target.html

@@ -626,6 +626,11 @@ target("test2")
 <td>Set the runtime library of the compilation target</td>
 <td>>= 2.5.1</td>
 </tr>
+<tr>
+<td><a href="#targetset_group">set_group</a></td>
+<td>Set target group</td>
+<td>>= 2.5.1</td>
+</tr>
 </tbody>
 </table>
 <h3 id="target">target</h3>
@@ -2656,6 +2661,43 @@ target("test")
 <p>Of course, we can also use <code>add_requires("xx", {configs = {vs_runtime = "MD"}})</code> to modify the vs runtime library for specific packages.</p>
 <p>We can also use <code>xmake f --vs_runtime=MD</code> to switch it globally through parameter configuration.</p>
 <p>Issues related to this api: <a href="https://github.com/xmake-io/xmake/issues/1071#issuecomment-750817681">#1071</a></p>
+<h3 id="targetset_group">target:set_group</h3>
+<h4 id="settargetgroup">Set target group</h4>
+<p>At present, this interface is only used to generate the vs/vsxmake project. The sub-project directory tree of the vs project is displayed in groups according to the specified structure, but grouping support may be added to other modules in the future.</p>
+<p>For example, for the following grouping configuration:</p>
+<pre><code class="lang-lua">add_rules("mode.debug", "mode.release")
+
+target("test1")
+     set_kind("binary")
+     add_files("src/*.cpp")
+     set_group("group1")
+
+target("test2")
+     set_kind("binary")
+     add_files("src/*.cpp")
+     set_group("group1")
+
+target("test3")
+     set_kind("binary")
+     add_files("src/*.cpp")
+     set_group("group1/group2")
+
+target("test4")
+     set_kind("binary")
+     add_files("src/*.cpp")
+     set_group("group3/group4")
+
+target("test5")
+     set_kind("binary")
+     add_files("src/*.cpp")
+
+target("test6")
+     set_kind("binary")
+     add_files("src/*.cpp")
+</code></pre>
+<p>The effect of the generated VS project directory structure is as follows:</p>
+<p><img src="assets/img/manual/set_group.png" alt=""></p>
+<p>For more details, please see: <a href="https://github.com/xmake-io/xmake/issues/1026">#1026</a></p>
 </article>
 </body>
 </html>

+ 2 - 0
mirror/plugin/builtin_plugins.html

@@ -142,6 +142,7 @@ target("test")
      set_kind("binary")
      add_files("src/*.c")
 </code></pre>
+<p>In addition, we can group each target through the <code>set_group</code> interface, so that the generated vs project can be grouped according to the specified structure. For more details, please see: <a href="https://github.com/xmake-io/xmake/issues/1026">issue 1026</a></p>
 <h4 id="usingvsbuiltincompilationmechanism">Using vs built-in compilation mechanism</h4>
 <p>!> It is recommended to use the new version of the vs. plugin provided after v2.2.8 mentioned above. The support is more complete. The generation method here does not support the rules of xmake, and the generation of projects such as qt.</p>
 <pre><code class="lang-bash">$ xmake project -k [vs2008|vs2013|vs2015|..]
@@ -158,6 +159,7 @@ target("test")
 <pre><code class="lang-bash">$ xmake project -k vs2017
 </code></pre>
 <p>The effect is same.</p>
+<p>In addition, we can group each target through the <code>set_group</code> interface, so that the generated vs project can be grouped according to the specified structure. For more details, please see: <a href="https://github.com/xmake-io/xmake/issues/1026">issue 1026</a></p>
 <h2 id="runthecustomluascript">Run the Custom Lua Script</h2>
 <h3 id="runthegivenscript">Run the given script</h3>
 <p>Write a simple lua script:</p>

+ 42 - 0
mirror/zh-cn/manual/project_target.html

@@ -627,6 +627,11 @@ target("test2")
 <td>设置编译目标依赖的运行时库</td>
 <td>>= 2.5.1</td>
 </tr>
+<tr>
+<td><a href="#targetset_group">set_group</a></td>
+<td>设置目标分组</td>
+<td>>= 2.5.1</td>
+</tr>
 </tbody>
 </table>
 <h3 id="target">target</h3>
@@ -2669,6 +2674,43 @@ target("test")
 <p>当然,我们也可以通过 <code>add_requires("xx", {configs = {vs_runtime = "MD"}})</code> 对特定包修改 vs 运行时库。</p>
 <p>我们也可以通过 <code>xmake f --vs_runtime=MD</code> 通过参数配置来全局切换它。</p>
 <p>与此 api 相关的 issue:<a href="https://github.com/xmake-io/xmake/issues/1071#issuecomment-750817681">#1071</a></p>
+<h3 id="targetset_group">target:set_group</h3>
+<h4 id="">设置目标分组</h4>
+<p>目前此接口仅用于 vs/vsxmake 工程生成,对 vs 工程内部子工程目录树按指定结构分组展示,不过后续也可能对其他模块增加分组支持。</p>
+<p>比如对于下面的分组配置:</p>
+<pre><code class="lang-lua">add_rules("mode.debug", "mode.release")
+
+target("test1")
+    set_kind("binary")
+    add_files("src/*.cpp")
+    set_group("group1")
+
+target("test2")
+    set_kind("binary")
+    add_files("src/*.cpp")
+    set_group("group1")
+
+target("test3")
+    set_kind("binary")
+    add_files("src/*.cpp")
+    set_group("group1/group2")
+
+target("test4")
+    set_kind("binary")
+    add_files("src/*.cpp")
+    set_group("group3/group4")
+
+target("test5")
+    set_kind("binary")
+    add_files("src/*.cpp")
+
+target("test6")
+    set_kind("binary")
+    add_files("src/*.cpp")
+</code></pre>
+<p>生成的 vs 工程目录结构效果如下:</p>
+<p><img src="assets/img/manual/set_group.png" alt=""></p>
+<p>更多详情见:<a href="https://github.com/xmake-io/xmake/issues/1026">#1026</a></p>
 </article>
 </body>
 </html>

+ 2 - 0
mirror/zh-cn/plugin/builtin_plugins.html

@@ -148,6 +148,7 @@ target("test")
     set_kind("binary")
     add_files("src/*.c")
 </code></pre>
+<p>另外,我们可以通过 <code>set_group</code> 接口对每个 target 设置分组,使得生成的 vs 工程可以按指定结构进行分组。更多详情见:<a href="https://github.com/xmake-io/xmake/issues/1026">issue 1026</a></p>
 <h4 id="vs">使用vs内置编译机制</h4>
 <p>!> 建议尽量使用上文提到的v2.2.8之后提供的新版的vs生成插件,支持更加完善,此处的生成方式不支持xmake的rules,以及对qt等工程的生成。</p>
 <pre><code class="lang-console">$ xmake project -k [vs2008|vs2013|vs2015|..]
@@ -160,6 +161,7 @@ target("test")
 <pre><code class="lang-lua">-- 配置当前的工程,支持哪些编译模式
 add_rules("mode.debug", "mode.release")
 </code></pre>
+<p>另外,我们可以通过 <code>set_group</code> 接口对每个 target 设置分组,使得生成的 vs 工程可以按指定结构进行分组。更多详情见:<a href="https://github.com/xmake-io/xmake/issues/1026">issue 1026</a></p>
 <h2 id="lua">运行自定义lua脚本</h2>
 <p>这个跟宏脚本类似,只是省去了导入导出操作,直接指定lua脚本来加载运行,这对于想要快速测试一些接口模块,验证自己的某些思路,都是一个不错的方式。</p>
 <h3 id="">运行指定的脚本文件</h3>

+ 4 - 0
plugin/builtin_plugins.md

@@ -98,6 +98,8 @@ target("test")
      add_files("src/*.c")
 ```
 
+In addition, we can group each target through the `set_group` interface, so that the generated vs project can be grouped according to the specified structure. For more details, please see: [issue 1026](https://github.com/xmake-io/xmake/issues/1026)
+
 #### Using vs built-in compilation mechanism
 
 !> It is recommended to use the new version of the vs. plugin provided after v2.2.8 mentioned above. The support is more complete. The generation method here does not support the rules of xmake, and the generation of projects such as qt.
@@ -130,6 +132,8 @@ $ xmake project -k vs2017
 
 The effect is same.
 
+In addition, we can group each target through the `set_group` interface, so that the generated vs project can be grouped according to the specified structure. For more details, please see: [issue 1026](https://github.com/xmake-io/xmake/issues/1026)
+
 ## Run the Custom Lua Script
 
 ### Run the given script

+ 76 - 76
sitemap.xml

@@ -12,382 +12,382 @@
 
 <url>
   <loc>https://xmake.io/mirror/guide/project_examples.html</loc>
-  <lastmod>2021-01-15T23:35:01+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:18+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/other_features.html</loc>
-  <lastmod>2021-01-15T23:35:01+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:18+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/quickstart.html</loc>
-  <lastmod>2021-01-15T23:35:02+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:19+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/faq.html</loc>
-  <lastmod>2021-01-15T23:35:02+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:19+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/configuration.html</loc>
-  <lastmod>2021-01-15T23:35:02+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:19+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/syntax_description.html</loc>
-  <lastmod>2021-01-15T23:35:02+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:19+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/installation.html</loc>
-  <lastmod>2021-01-15T23:35:02+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:19+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/plugin/plugin_development.html</loc>
-  <lastmod>2021-01-15T23:35:02+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:19+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/plugin/more_plugins.html</loc>
-  <lastmod>2021-01-15T23:35:03+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:20+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/plugin/builtin_plugins.html</loc>
-  <lastmod>2021-01-15T23:35:03+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:20+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/old/zh/plugins.html</loc>
-  <lastmod>2021-01-15T23:35:03+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:20+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/old/zh/manual.html</loc>
-  <lastmod>2021-01-15T23:35:03+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:20+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/old/plugins.html</loc>
-  <lastmod>2021-01-15T23:35:03+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:20+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/old/manual.html</loc>
-  <lastmod>2021-01-15T23:35:04+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:20+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/awesome.html</loc>
-  <lastmod>2021-01-15T23:35:04+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:21+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/technical_support.html</loc>
-  <lastmod>2021-01-15T23:35:04+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:21+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/changelog.html</loc>
-  <lastmod>2021-01-15T23:35:04+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:21+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/contact.html</loc>
-  <lastmod>2021-01-15T23:35:04+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:21+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/introduction.html</loc>
-  <lastmod>2021-01-15T23:35:04+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:21+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/sponsor.html</loc>
-  <lastmod>2021-01-15T23:35:05+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:21+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/index.html</loc>
-  <lastmod>2021-01-15T23:35:05+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:22+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/project_examples.html</loc>
-  <lastmod>2021-01-15T23:35:05+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:22+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/other_features.html</loc>
-  <lastmod>2021-01-15T23:35:05+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:22+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/quickstart.html</loc>
-  <lastmod>2021-01-15T23:35:05+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:22+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/faq.html</loc>
-  <lastmod>2021-01-15T23:35:05+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:22+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/configuration.html</loc>
-  <lastmod>2021-01-15T23:35:06+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:22+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/syntax_description.html</loc>
-  <lastmod>2021-01-15T23:35:06+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:23+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/installation.html</loc>
-  <lastmod>2021-01-15T23:35:06+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:23+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/plugin/plugin_development.html</loc>
-  <lastmod>2021-01-15T23:35:06+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:23+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/plugin/more_plugins.html</loc>
-  <lastmod>2021-01-15T23:35:06+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:23+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/plugin/builtin_plugins.html</loc>
-  <lastmod>2021-01-15T23:35:06+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:23+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/awesome.html</loc>
-  <lastmod>2021-01-15T23:35:06+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:23+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/technical_support.html</loc>
-  <lastmod>2021-01-15T23:35:07+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:24+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/changelog.html</loc>
-  <lastmod>2021-01-15T23:35:07+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:24+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/contact.html</loc>
-  <lastmod>2021-01-15T23:35:07+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:24+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/peripheral_items.html</loc>
-  <lastmod>2021-01-15T23:35:07+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:24+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/introduction.html</loc>
-  <lastmod>2021-01-15T23:35:07+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:24+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/sponsor.html</loc>
-  <lastmod>2021-01-15T23:35:07+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:24+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/course.html</loc>
-  <lastmod>2021-01-15T23:35:08+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:24+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/index.html</loc>
-  <lastmod>2021-01-15T23:35:08+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:25+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/getting_started.html</loc>
-  <lastmod>2021-01-15T23:35:08+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:25+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/specification.html</loc>
-  <lastmod>2021-01-15T23:35:08+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:25+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/builtin_variables.html</loc>
-  <lastmod>2021-01-15T23:35:08+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:25+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/conditions.html</loc>
-  <lastmod>2021-01-15T23:35:08+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:25+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/custom_rule.html</loc>
-  <lastmod>2021-01-15T23:35:09+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:25+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/project_target.html</loc>
-  <lastmod>2021-01-15T23:35:09+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:26+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/builtin_modules.html</loc>
-  <lastmod>2021-01-15T23:35:09+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:26+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/custom_toolchain.html</loc>
-  <lastmod>2021-01-15T23:35:09+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:26+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/plugin_task.html</loc>
-  <lastmod>2021-01-15T23:35:09+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:26+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/package_dependencies.html</loc>
-  <lastmod>2021-01-15T23:35:09+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:26+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/configuration_option.html</loc>
-  <lastmod>2021-01-15T23:35:10+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:26+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/extension_modules.html</loc>
-  <lastmod>2021-01-15T23:35:10+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:27+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/global_interfaces.html</loc>
-  <lastmod>2021-01-15T23:35:10+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:27+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/theme/builtin_themes.html</loc>
-  <lastmod>2021-01-15T23:35:10+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:27+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/theme/switch_theme.html</loc>
-  <lastmod>2021-01-15T23:35:10+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:27+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/local_package.html</loc>
-  <lastmod>2021-01-15T23:35:10+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:27+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/system_package.html</loc>
-  <lastmod>2021-01-15T23:35:11+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:27+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/remote_package.html</loc>
-  <lastmod>2021-01-15T23:35:11+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:28+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/getting_started.html</loc>
-  <lastmod>2021-01-15T23:35:11+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:28+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/specification.html</loc>
-  <lastmod>2021-01-15T23:35:11+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:28+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/builtin_variables.html</loc>
-  <lastmod>2021-01-15T23:35:11+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:28+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/conditions.html</loc>
-  <lastmod>2021-01-15T23:35:11+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:28+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/custom_rule.html</loc>
-  <lastmod>2021-01-15T23:35:12+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:28+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/project_target.html</loc>
-  <lastmod>2021-01-15T23:35:12+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:29+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/builtin_modules.html</loc>
-  <lastmod>2021-01-15T23:35:12+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:29+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/custom_toolchain.html</loc>
-  <lastmod>2021-01-15T23:35:12+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:29+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/plugin_task.html</loc>
-  <lastmod>2021-01-15T23:35:12+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:29+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/package_dependencies.html</loc>
-  <lastmod>2021-01-15T23:35:12+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:29+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/configuration_option.html</loc>
-  <lastmod>2021-01-15T23:35:13+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:29+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/extension_modules.html</loc>
-  <lastmod>2021-01-15T23:35:13+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:30+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/global_interfaces.html</loc>
-  <lastmod>2021-01-15T23:35:13+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:30+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/theme/builtin_themes.html</loc>
-  <lastmod>2021-01-15T23:35:13+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:30+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/theme/switch_theme.html</loc>
-  <lastmod>2021-01-15T23:35:13+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:30+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/local_package.html</loc>
-  <lastmod>2021-01-15T23:35:13+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:30+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/system_package.html</loc>
-  <lastmod>2021-01-15T23:35:14+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:30+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/remote_package.html</loc>
-  <lastmod>2021-01-15T23:35:14+08:00</lastmod>
+  <lastmod>2021-01-15T23:47:31+08:00</lastmod>
 </url>
 
 </urlset>

+ 47 - 0
zh-cn/manual/project_target.md

@@ -127,6 +127,7 @@ target("test2")
 | [set_plat](#targetset_plat)                     | 设置指定目标的编译平台               | >= 2.3.5 |
 | [set_arch](#targetset_arch)                     | 设置指定目标的编译架构               | >= 2.3.5 |
 | [set_runtimes](#targetset_runtimes)             | 设置编译目标依赖的运行时库           | >= 2.5.1 |
+| [set_group](#targetset_group)                   | 设置目标分组                         | >= 2.5.1 |
 
 ### target
 
@@ -2598,3 +2599,49 @@ target("test")
 我们也可以通过 `xmake f --vs_runtime=MD` 通过参数配置来全局切换它。
 
 与此 api 相关的 issue:[#1071](https://github.com/xmake-io/xmake/issues/1071#issuecomment-750817681)
+
+### target:set_group
+
+#### 设置目标分组
+
+目前此接口仅用于 vs/vsxmake 工程生成,对 vs 工程内部子工程目录树按指定结构分组展示,不过后续也可能对其他模块增加分组支持。
+
+比如对于下面的分组配置:
+
+```lua
+add_rules("mode.debug", "mode.release")
+
+target("test1")
+    set_kind("binary")
+    add_files("src/*.cpp")
+    set_group("group1")
+
+target("test2")
+    set_kind("binary")
+    add_files("src/*.cpp")
+    set_group("group1")
+
+target("test3")
+    set_kind("binary")
+    add_files("src/*.cpp")
+    set_group("group1/group2")
+
+target("test4")
+    set_kind("binary")
+    add_files("src/*.cpp")
+    set_group("group3/group4")
+
+target("test5")
+    set_kind("binary")
+    add_files("src/*.cpp")
+
+target("test6")
+    set_kind("binary")
+    add_files("src/*.cpp")
+```
+
+生成的 vs 工程目录结构效果如下:
+
+![](assets/img/manual/set_group.png)
+
+更多详情见:[#1026](https://github.com/xmake-io/xmake/issues/1026)

+ 4 - 0
zh-cn/plugin/builtin_plugins.md

@@ -107,6 +107,8 @@ target("test")
     add_files("src/*.c")
 ```
 
+另外,我们可以通过 `set_group` 接口对每个 target 设置分组,使得生成的 vs 工程可以按指定结构进行分组。更多详情见:[issue 1026](https://github.com/xmake-io/xmake/issues/1026)
+
 #### 使用vs内置编译机制
 
 !> 建议尽量使用上文提到的v2.2.8之后提供的新版的vs生成插件,支持更加完善,此处的生成方式不支持xmake的rules,以及对qt等工程的生成。
@@ -130,6 +132,8 @@ $ xmake project -k vs2017 -m "debug,release"
 add_rules("mode.debug", "mode.release")
 ```
 
+另外,我们可以通过 `set_group` 接口对每个 target 设置分组,使得生成的 vs 工程可以按指定结构进行分组。更多详情见:[issue 1026](https://github.com/xmake-io/xmake/issues/1026)
+
 ## 运行自定义lua脚本
 
 这个跟宏脚本类似,只是省去了导入导出操作,直接指定lua脚本来加载运行,这对于想要快速测试一些接口模块,验证自己的某些思路,都是一个不错的方式。