Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加并行构建功能,添加依赖任务配置 #66

Merged
merged 8 commits into from
May 7, 2022

Conversation

XiaoHeitu
Copy link
Contributor

可以为每个Build任务配置WaitPre属性。当WaitPre为True 时,会等待前面的所有任务完成后,再执行当前任务。当WaitPre为false时,会开启新线程来执行BUILD,以榨干CPU性能。当没有配置WaitPre时,默认为True。

构建速度在4核心CPU上提升20% 以上。CPU逻辑核心越多,提升越大。

@XiaoHeitu XiaoHeitu changed the title 添加多少线程构建,添加WaitPre 添加多线程构建,添加WaitPre Mar 11, 2022
@XiaoHeitu XiaoHeitu changed the title 添加多线程构建,添加WaitPre 添加并行构建功能,添加依赖任务配置 Mar 15, 2022
@XiaoHeitu
Copy link
Contributor Author

完善了任务依赖,移除了单任务并行代码。
依赖任务属性写法
image
image

@Ahoo-Wang
Copy link
Member

great job!

…ependOn配置。所以构建任务按顺序一次执行。这样可以抱枕用户在升级新版本smarcode 后,不修改模版也能正常使用。
@XiaoHeitu
Copy link
Contributor Author

XiaoHeitu commented Mar 15, 2022

不好意思。为了模版兼容性又添加 了一个新的属性。

为项目添加 AllowParallel 属性。当AllowParallel 为false 或者AllowParallel 不存在时,忽略DependOn配置。所以构建任务按顺序一次执行。这样可以抱枕用户在升级新版本smarcode 后,不修改模版也能正常使用。当 AllowParallel 为 true 时,会自动根据DependOn配置在适当的时机启动并发构建,

image

@@ -5,6 +5,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

只添加了 System.Threading 没有使用?

@Ahoo-Wang Ahoo-Wang merged commit 30e2b52 into dotnetcore:master May 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants