@@ -122,10 +122,18 @@ private List<string> GetBuildCsprojList(string moduleName, Dictionary<string, st
122
122
{
123
123
if ( moduleName . Equals ( AllModule ) )
124
124
{
125
- moduleName = ACCOUNT_MODULE_NAME ;
125
+ HashSet < string > csprojSet = new HashSet < string > ( ) ;
126
+ foreach ( string m in GetSelectedModuleList ( ) )
127
+ {
128
+ csprojSet . UnionWith ( GetBuildCsprojList ( m , csprojMap ) ) ;
129
+ }
130
+ return csprojSet . ToList ( ) ;
131
+ }
132
+ else
133
+ {
134
+ return GetRelatedCsprojList ( moduleName , csprojMap )
135
+ . Where ( x => ! x . Contains ( "Test" ) ) . ToList ( ) ;
126
136
}
127
- return GetRelatedCsprojList ( moduleName , csprojMap )
128
- . Where ( x => ! x . Contains ( "Test" ) ) . ToList ( ) ;
129
137
}
130
138
131
139
private string GetModuleNameFromCsprojPath ( string csprojPath )
@@ -137,6 +145,10 @@ private string GetModuleNameFromCsprojPath(string csprojPath)
137
145
138
146
private List < string > GetDependenceModuleList ( string moduleName , Dictionary < string , string [ ] > csprojMap )
139
147
{
148
+ if ( moduleName . Equals ( ACCOUNT_MODULE_NAME ) )
149
+ {
150
+ return GetSelectedModuleList ( ) ;
151
+ }
140
152
List < string > moduleList = new List < string > ( ) ;
141
153
142
154
foreach ( string key in csprojMap . Keys )
@@ -162,22 +174,45 @@ private List<string> GetDependentModuleList(string moduleName, Dictionary<string
162
174
{
163
175
if ( moduleName . Equals ( AllModule ) )
164
176
{
165
- moduleName = ACCOUNT_MODULE_NAME ;
177
+ HashSet < string > csprojSet = new HashSet < string > ( ) ;
178
+ foreach ( string m in GetSelectedModuleList ( ) )
179
+ {
180
+ csprojSet . UnionWith ( GetDependentModuleList ( m , csprojMap ) ) ;
181
+ }
182
+ return csprojSet . ToList ( ) ;
183
+ }
184
+ else
185
+ {
186
+ return GetRelatedCsprojList ( moduleName , csprojMap )
187
+ . Select ( GetModuleNameFromCsprojPath )
188
+ . Distinct ( )
189
+ . ToList ( ) ;
166
190
}
167
- return GetRelatedCsprojList ( moduleName , csprojMap )
168
- . Select ( GetModuleNameFromCsprojPath )
169
- . Distinct ( )
170
- . ToList ( ) ;
191
+ }
192
+
193
+ // Run a selected module list instead of run all the modules to speed up the CI process.
194
+ private List < string > GetSelectedModuleList ( )
195
+ {
196
+ string [ ] lines = System . IO . File . ReadAllLines ( @"./tools/BuildPackagesTask/Microsoft.Azure.Build.Tasks/SelectedModuleList.txt" ) ;
197
+ return new List < string > ( lines ) ;
171
198
}
172
199
173
200
private List < string > GetTestCsprojList ( string moduleName , Dictionary < string , string [ ] > csprojMap )
174
201
{
175
202
if ( moduleName . Equals ( AllModule ) )
176
203
{
177
- moduleName = ACCOUNT_MODULE_NAME ;
204
+ HashSet < string > csprojSet = new HashSet < string > ( ) ;
205
+ foreach ( string m in GetSelectedModuleList ( ) )
206
+ {
207
+ csprojSet . UnionWith ( GetTestCsprojList ( m , csprojMap ) ) ;
208
+ }
209
+ return csprojSet . ToList ( ) ;
210
+ }
211
+ else
212
+ {
213
+ return GetRelatedCsprojList ( moduleName , csprojMap )
214
+ . Where ( x => x . Contains ( "Test" ) ) . ToList ( ) ; ;
178
215
}
179
- return GetRelatedCsprojList ( moduleName , csprojMap )
180
- . Where ( x => x . Contains ( "Test" ) ) . ToList ( ) ; ;
181
216
}
182
217
183
218
private bool ProcessTargetModule ( Dictionary < string , string [ ] > csprojMap )
0 commit comments