Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion tools/BuildScripts/BuildModules.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ if (($null -eq $RepoRoot) -or (0 -eq $RepoRoot.Length)) {

$notModules = @('lib', 'shared', 'helpers')
$coreTestModule = @('Compute', 'Network', 'Resources', 'Sql', 'Websites')
$RepoArtifacts = Join-Path $RepoRoot "Artifacts"
$RepoArtifacts = Join-Path $RepoRoot "artifacts"

$csprojFiles = @()
$testModule = @()
Expand Down Expand Up @@ -127,6 +127,9 @@ $prepareScriptPath = Join-Path $toolDirectory 'BuildScripts' 'PrepareAutorestMod
$isInvokedByPipeline = $false
if ($InvokedByPipeline) {
$isInvokedByPipeline = $true
$outputTargetPath = Join-Path $RepoArtifacts "TargetModule.txt"
New-Item -Path $outputTargetPath -Force
$TargetModule | Out-File -Path $outputTargetPath -Force
}
foreach ($moduleRootName in $TargetModule) {
Write-Host "Preparing $moduleRootName ..." -ForegroundColor DarkGreen
Expand Down
18 changes: 9 additions & 9 deletions tools/ExpandModules.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,21 @@ if ([string]::IsNullOrEmpty($Artifacts)) {
New-Item -Path (Get-Item $Artifacts).FullName -Name "tmp" -ItemType "directory"
$tmp = Join-Path -Path (Get-Item $Artifacts).FullName -ChildPath "tmp"

$ModifiedModulesPath = Join-Path $Artifacts -ChildPath "ModifiedModule.txt"
$ModifiedModules = @()
if (Test-Path $ModifiedModulesPath) {
$ModifiedModules = Get-Content $ModifiedModulesPath
$TargetModulePath = Join-Path $Artifacts -ChildPath "TargetModule.txt"
$TargetModule = @()
if (Test-Path $TargetModulePath) {
$TargetModule = Get-Content $TargetModulePath
}
Write-Host $ModifiedModules
Write-Host $TargetModule
try {
$AllPackages = Get-ChildItem -Path $Artifacts -Filter "*.nupkg"

if ($ModifiedModules.Length -eq 0) {
Write-Host "ModifiedModule.txt not finded, default expand all modules."
$ModifiedModules = $AllPackages.Name
if ($TargetModule.Length -eq 0) {
Write-Error "No target modules found."
exit 1
}
foreach ($package in $AllPackages) {
foreach ($module in $ModifiedModules) {
foreach ($module in $TargetModule) {
if (($package.Name -like "Az.$module.*.nupkg") -or ($package.Name -match '^Az(Preview)?\.\d+\.\d+\.\d+\.nupkg$')) {
$module_name = $package.Name
$zip_artifact = $package.FullName -replace ".nupkg$",".zip"
Expand Down
Loading