81
81
<UsingTask Condition =" $(OnPremiseBuild)" TaskName =" CorporateValidation" AssemblyFile =" $(CIToolsPath)/Microsoft.WindowsAzure.Tools.Build.Tasks.OnPremise.dll" />
82
82
<Import Condition =" $(OnPremiseBuild)" Project =" $(CIToolsPath)/Microsoft.WindowsAzure.Build.OnPremise.msbuild" />
83
83
<UsingTask TaskName =" ESRPSignTask" AssemblyFile =" $(CISignRepoPath)/tools/sdkbuildtools/tasks/MS.Az.Sdk.OnPremise.Build.Tasks.dll" />
84
+ <UsingTask TaskName =" FilesChangedTask" AssemblyFile =" $(RepoArtifacts)Microsoft.Azure.Build.Tasks/Microsoft.Azure.Build.Tasks.dll" />
85
+ <UsingTask TaskName =" FilterTask" AssemblyFile =" $(RepoArtifacts)Microsoft.Azure.Build.Tasks/Microsoft.Azure.Build.Tasks.dll" />
84
86
85
87
<Target Name =" Clean" >
86
88
<Message Importance =" high" Text =" Cleaning Cmdlets..." />
93
95
<Exec Command =" $(PowerShellCoreCommandPrefix) " Get-ChildItem -Path $(MSBuildThisFileDirectory) -Recurse -Include 'bin','obj','TestResults' | Remove-Item -Recurse -Force -ErrorAction Ignore" " IgnoreExitCode =" true" />
94
96
</Target >
95
97
96
- <Target Name =" FilterBuild" >
98
+ <Target Name =" FilterBuild" Condition =" $(PullRequestNumber) != ''" >
99
+ <Message Importance =" high" Text =" Filtering projects and modules..." />
97
100
<Exec Command =" $(PowerShellCoreCommandPrefix) " . $(RepoTools)/CreateFilterMappings.ps1" " />
98
101
102
+ <!-- Build the Microsoft.Azure.Build.Tasks project -->
103
+ <Exec Command =" dotnet publish $(RepoTools)BuildPackagesTask/Microsoft.Azure.Build.Tasks/Microsoft.Azure.Build.Tasks.csproj -c $(Configuration) -f netstandard2.0" />
104
+
99
105
<!-- Get all of the files changed in the given pull request -->
100
106
<FilesChangedTask RepositoryOwner =" Azure" RepositoryName =" azure-powershell" PullRequestNumber =" $(PullRequestNumber)" >
101
107
<Output TaskParameter =" FilesChanged" ItemName =" FilesChanged" />
105
111
<FilterTask FilesChanged =" @(FilesChanged)" MapFilePath =" ./ModuleMappings.json" >
106
112
<Output TaskParameter =" Output" ItemName =" ModulesChanged" />
107
113
</FilterTask >
108
- <Message Text =" Filtering help generation and StaticAnalysis by the following modules:" />
109
- <Message Text =" %(ModulesChanged.Identity)" />
110
- <Message Text =" Total: @(ModulesChanged->Count())" />
111
- <Message Text =" " />
112
-
113
- <!-- Get the list of solutions to build -->
114
- <FilterTask FilesChanged =" @(FilesChanged)" MapFilePath =" ./SolutionMappings.json" >
115
- <Output TaskParameter =" Output" ItemName =" CmdletSolutionsToBuild" />
116
- </FilterTask >
117
- <Message Text =" Filtering solutions to build by the following:" />
118
- <Message Text =" %(CmdletSolutionsToBuild.Identity)" />
119
- <Message Text =" Total: @(CmdletSolutionsToBuild->Count())" />
120
- <Message Text =" " />
121
-
122
- <!-- Get the list of tests to be run based on files changed from a specified PullRequestNumber. Mapping between paths and test DLLs is used to produce the list.-->
123
- <FilterTask FilesChanged =" @(FilesChanged)" MapFilePath =" ./TestMappings.json" >
124
- <Output TaskParameter =" Output" ItemName =" XUnitTests" />
114
+ <Message Importance =" high" Text =" Filtering help generation and StaticAnalysis by the following modules:" />
115
+ <Message Importance =" high" Text =" %(ModulesChanged.Identity)" />
116
+ <Message Importance =" high" Text =" Total: @(ModulesChanged->Count())" />
117
+ <Message Importance =" high" Text =" " />
118
+
119
+ <!-- Get the list of projects to build -->
120
+ <FilterTask FilesChanged =" @(FilesChanged)" MapFilePath =" ./CsprojMappings.json" >
121
+ <Output TaskParameter =" Output" ItemName =" ProjectsToBuild" />
125
122
</FilterTask >
126
- <Message Text =" Using these test assemblies :" />
127
- <Message Text =" %(XUnitTests .Identity)" />
128
- <Message Text =" Total: @(XunitTests ->Count())" />
129
- <Message Text =" " />
123
+ <Message Importance = " high " Text =" Filtering projects to build by the following :" />
124
+ <Message Importance = " high " Text =" %(ProjectsToBuild .Identity)" />
125
+ <Message Importance = " high " Text =" Total: @(ProjectsToBuild ->Count())" />
126
+ <Message Importance = " high " Text =" " />
130
127
</Target >
131
128
132
129
<!-- Build all flavors of the Cmdlets -->
133
- <!-- TODO: Reimplement the FilterBuild and update RepoTasks to NetStandard -->
134
- <Target Name =" Build" >
130
+ <Target Name =" Build" DependsOnTargets =" FilterBuild" >
135
131
<Message Importance =" high" Text =" Building Cmdlets..." />
136
132
137
133
<MakeDir Directories =" $(RepoArtifacts)" />
142
138
<!-- Build and create package content -->
143
139
<Exec Command =" dotnet --version" />
144
140
<Exec Command =" dotnet new sln -n Azure.PowerShell -o $(RepoArtifacts) --force" />
145
- <ItemGroup >
141
+ <ItemGroup Condition = " $(PullRequestNumber) == '' " >
146
142
<CsprojFiles Include =" $(RepoRoot)src/**/*.csproj" Exclude =" $(RepoRoot)src/**/*.Test.csproj;$(RepoRoot)src/**/Authenticators.csproj" />
147
143
<CsprojFiles Include =" $(RepoRoot)src/**/*.Test.csproj" Exclude =" $(Net472TestExclude)" Condition =" '$(Configuration)' != 'Release' and '$(TestsToRun)' == 'All'" />
148
144
<CsprojFiles Include =" $(RepoRoot)src/**/*.Test.csproj" Exclude =" $(CoreTests)$(Net472TestExclude)" Condition =" '$(Configuration)' != 'Release' and '$(TestsToRun)' == 'NonCore'" />
149
145
<CsprojFiles Include =" $(CoreTests)" Exclude =" $(Net472TestExclude)" Condition =" '$(Configuration)' != 'Release' and '$(TestsToRun)' == 'Core'" />
150
146
<CsprojFiles Include =" $(RepoRoot)src/**/Authenticators.csproj" Condition =" '$([MSBuild]::IsOsPlatform(" Windows" ))' == 'true' and '$(TestFramework)' != 'net472'" />
151
147
</ItemGroup >
148
+ <ItemGroup Condition =" $(PullRequestNumber) != ''" >
149
+ <!-- Always build and test common code -->
150
+ <CsprojFiles Include =" $(LibraryRoot)src/Accounts/**/*.csproj;$(LibraryRoot)tools/TestFx/TestFx.csproj" Exclude =" $(LibraryRoot)src/**/Authenticators.csproj" />
151
+ <CsprojFiles Include =" %(ProjectsToBuild.Identity)" />
152
+ <CsprojFiles Include =" $(LibraryRoot)src/**/Authenticators.csproj" Condition =" '$([MSBuild]::IsOsPlatform(" Windows" ))' == 'true'" />
153
+ </ItemGroup >
152
154
<!-- https://github.com/dotnet/cli/issues/6295#issuecomment-346973582 -->
153
155
<Exec Command =" dotnet sln $(RepoArtifacts)Azure.PowerShell.sln add " %(CsprojFiles.FullPath)" " />
154
156
<PropertyGroup >
@@ -297,7 +299,7 @@ $(RepoArtifacts)/$(Configuration)/**/Microsoft.Azure.PowerShell.Authenticators.d
297
299
<!-- RemoveCodeSignArtifacts.ps1 -->
298
300
<Message Text =" variables.Remove artifacts section" Importance =" high" />
299
301
<Exec Command =" $(PowerShellCoreCommandPrefix) " Get-ChildItem -Path $(RepoArtifacts) -Recurse -Include 'Signed','Unsigned' | Remove-Item -Recurse -Force -Confirm:$false -ErrorAction Ignore" " IgnoreExitCode =" true" />
300
-
302
+
301
303
<!-- CheckSignature.ps1 -->
302
304
<Message Text =" variables.CheckSignature section" Importance =" high" />
303
305
<Exec Command =" $(PowerShellCoreCommandPrefix) " . $(RepoTools)/CheckSignature.ps1 -CustomPath $(RepoArtifacts)/$(Configuration)" " Condition =" '$(Scope)' != 'Stack'" />
@@ -326,4 +328,4 @@ $(RepoArtifacts)/$(Configuration)/**/Microsoft.Azure.PowerShell.Authenticators.d
326
328
<SetEnvVar EnvName =" SignedMsiDir" EnvValue =" $(SignedOutputRootDir)" />
327
329
</Target >
328
330
329
- </Project >
331
+ </Project >
0 commit comments