@@ -62,6 +62,10 @@ public class BuildScript : DefaultBuildScript {
6262 /// 忽略测试项目文件列表
6363 /// </summary>
6464 public List < FileFullPath > IgnoreTestProjecs { get ; set ; }
65+ /// <summary>
66+ /// 忽略打包项目文件列表
67+ /// </summary>
68+ public List < FileFullPath > IgnorePackProjecs { get ; set ; }
6569
6670 /// <summary>
6771 /// 获取集成测试项目文件列表
@@ -70,6 +74,13 @@ protected List<FileFullPath> GetIntegrationTestProjecs() {
7074 return IntegrationTestProjecs . Where ( t => IgnoreTestProjecs . Exists ( p => p . FileName == t . FileName ) == false ) . ToList ( ) ;
7175 }
7276
77+ /// <summary>
78+ /// 获取打包项目文件列表
79+ /// </summary>
80+ protected List < FileFullPath > GetPackProjecs ( ) {
81+ return Projects . Where ( t => IgnorePackProjecs . Exists ( p => p . FileName == t . FileName ) == false ) . ToList ( ) ;
82+ }
83+
7384 /// <summary>
7485 /// 构建前操作
7586 /// </summary>
@@ -79,7 +90,9 @@ protected override void BeforeBuildExecution( ITaskContext context ) {
7990 UnitTestProjecs = context . GetFiles ( TestDir , "*/*.Tests.csproj" ) ;
8091 IntegrationTestProjecs = context . GetFiles ( TestDir , "*/*.Tests.Integration.csproj" ) ;
8192 IgnoreTestProjecs = new List < FileFullPath > ( ) ;
93+ IgnorePackProjecs = new List < FileFullPath > ( ) ;
8294 AddIgnoreTestProjecs ( context ) ;
95+ AddIgnorePackProjecs ( context ) ;
8396 }
8497
8598 /// <summary>
@@ -88,8 +101,16 @@ protected override void BeforeBuildExecution( ITaskContext context ) {
88101 private void AddIgnoreTestProjecs ( ITaskContext context ) {
89102 IgnoreTestProjecs . AddRange ( context . GetFiles ( TestDir , "*/Util.Images.*.Tests.Integration.csproj" ) ) ;
90103 IgnoreTestProjecs . AddRange ( context . GetFiles ( TestDir , "*/*.Oracle.Tests.Integration.csproj" ) ) ;
91- IgnoreTestProjecs . AddRange ( context . GetFiles ( TestDir , "*/*.Dapper.*.Tests.Integration.csproj" ) ) ;
92- }
104+ IgnoreTestProjecs . AddRange ( context . GetFiles ( TestDir , "*/Util.Data.Dapper.PostgreSql.Tests.Integration.csproj" ) ) ;
105+ IgnoreTestProjecs . AddRange ( context . GetFiles ( TestDir , "*/*.Dapr.Tests.Integration.csproj" ) ) ;
106+ }
107+
108+ /// <summary>
109+ /// 添加忽略打包项目文件列表
110+ /// </summary>
111+ private void AddIgnorePackProjecs ( ITaskContext context ) {
112+ IgnorePackProjecs . AddRange ( context . GetFiles ( SourceDir , "*/*.WebApiClient.csproj" ) ) ;
113+ }
93114
94115 /// <summary>
95116 /// 配置构建目标
@@ -175,7 +196,7 @@ private ITarget Pack( ITaskContext context, params ITarget[] dependTargets ) {
175196 return context . CreateTarget ( "pack" )
176197 . SetDescription ( "Create nuget packages." )
177198 . DependsOn ( dependTargets )
178- . ForEach ( Projects , ( project , target ) => {
199+ . ForEach ( GetPackProjecs ( ) , ( project , target ) => {
179200 target . AddCoreTask ( t => t . Pack ( )
180201 . Project ( project )
181202 . IncludeSymbols ( )
0 commit comments