Skip to content

Commit

Permalink
Merge pull request #856 from IgniteUI/vnext
Browse files Browse the repository at this point in the history
RELEASE - merging vnext into master
  • Loading branch information
HUSSAR-mtrela authored Dec 27, 2024
2 parents 95de1ff + acb40e4 commit d26a3b5
Show file tree
Hide file tree
Showing 1,016 changed files with 24,989 additions and 5,462 deletions.
File renamed without changes.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,21 @@ At this point, you should see a website hosted all examples of [Ignite UI for Bl

![Samples Browser Preview](./browser/IgBlazorSamples.Client/wwwroot/images/preview.PNG)

## Updating Packages in Samples

NOTE Do NOT find replace version of packages in package.json files.

- open this repo in VS Code
- open [./browser/IgBlazorSamples.Gulp/tasks/gulp-samples.js](./browser/tasks/gulp-samples.js) file
- navigate to the `updateIG` function
- update version of packages in `packageUpgrades` array
- open terminal window
- run `cd browser/IgBlazorSamples.Gulp` command
- run `npm install --legacy-peer-deps` command
- run the `gulp updateIG` command
- create AND merge a pull request with changes in all *.csproj files in this repository
- create 2nd pull request with similar changes in `/editor-templates/Blazor/main-template/BlazorClientApp.csproj` of the [igniteui-xplat-examples](https://github.com/IgniteUI/igniteui-xplat-examples) repository.


## Resources

Expand Down
4 changes: 3 additions & 1 deletion azure-pipelines/build-pipeline-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ stages:

- template: templates/build-steps-template.yml
parameters:
igVersion: '24.2.19'
igVersion: '24.2.52'
igNuGetFeedUrl: $(IG_Nuget_Feed_URL)
projectToBuild: Client
isVerbose: ${{ parameters.isVerbose }}
shouldCleanPostExectuion: ${{ parameters.shouldCleanPostExectuion }}
username: $(IG_Nuget_Feed_Username)
password: $(IG_Nuget_Feed_Password)
4 changes: 3 additions & 1 deletion azure-pipelines/build-pipeline-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ stages:

- template: templates/build-steps-template.yml
parameters:
igVersion: '24.2.19'
igVersion: '24.2.52'
igNuGetFeedUrl: $(IG_Nuget_Feed_URL)
projectToBuild: Server
isVerbose: ${{ parameters.isVerbose }}
shouldCleanPostExectuion: ${{ parameters.shouldCleanPostExectuion }}
username: $(IG_Nuget_Feed_Username)
password: $(IG_Nuget_Feed_Password)
191 changes: 191 additions & 0 deletions azure-pipelines/build-steps-template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
parameters:
- name: igVersion
- name: igNuGetFeedUrl
- name: projectToBuild
- name: isVerbose
default: false
- name: shouldCleanPostExectuion
- name: username
- name: password

steps:
- task: NodeTool@0
displayName: 'Install Node'
inputs:
versionSource: 'spec'
versionSpec: '16.x'

- task: Npm@1
displayName: 'npm ci'
inputs:
command: custom
workingDir: '$(Build.SourcesDirectory)\browser\IgBlazorSamples.Gulp'
verbose: ${{ parameters.isVerbose }}
customCommand: ci

- task: CmdLine@2
displayName: 'npx gulp copySamplesTo${{ parameters.projectToBuild }}'
inputs:
script: 'npx gulp copySamplesTo${{ parameters.projectToBuild }}'
workingDirectory: '$(Build.SourcesDirectory)\browser\IgBlazorSamples.Gulp'
failOnStderr: true

- task: UseDotNet@2
displayName: 'Install dotnet if not already present'
inputs:
packageType: 'sdk'
version: '9.0.101' # we are currently building a 8.0 app. TODO: Try upgrading to 8.x in the future
performMultiLevelLookup: false


- task: PowerShell@2
displayName: 'Generate NuGet.config for IG ProGet NuGet feed and u'
inputs:
targetType: 'inline'
script: |
dotnet new nugetconfig --force
# The name of the source doesn't currently matter as the credentials are attached thanks to URL matching - according to MS docs
dotnet nuget add source ${{ parameters.igNuGetFeedUrl }} --name "IG ProGet NuGet" --allow-insecure-connections
# Manually add the allowInsecureConnections attribute to the nuget.config file
$nugetConfigPath = "$(Build.SourcesDirectory)\NuGet.config"
[xml]$nugetConfig = Get-Content $nugetConfigPath
$nugetConfig.configuration.packageSources.add | Where-Object { $_.name -eq "IG ProGet NuGet" } | ForEach-Object { $_.allowInsecureConnections = "true" }
$nugetConfig.Save($nugetConfigPath)
failOnStderr: true
showWarnings: true
workingDirectory: '$(Build.SourcesDirectory)'

- task: PowerShell@2
displayName: 'Identify trial packages and use licensed ones instead'
inputs:
targetType: 'inline'
script: |
$xml = [XML](Get-Content '.\IgBlazorSamples.${{ parameters.projectToBuild }}.csproj');
$nodes = $xml.SelectNodes("//PackageReference[starts-with(@Include,'IgniteUI')]") |
ForEach-Object {
$_.SetAttribute("Include",$_.Include.Replace(".Trial",""));
$_.SetAttribute("Version", "${{ parameters.igVersion }}");
Write-Host $_.Version
}
$xml.Save('.\IgBlazorSamples.${{ parameters.projectToBuild }}.csproj')
failOnStderr: true
showWarnings: true
workingDirectory: '$(Build.SourcesDirectory)\browser\IgBlazorSamples.${{ parameters.projectToBuild }}'

- task: DotNetCoreCLI@2
displayName: 'dotnet restore'
continueOnError: true
enabled: true
inputs:
command: 'restore'
projects: '$(Build.SourcesDirectory)\browser\IgBlazorSamples.${{ parameters.projectToBuild }}'
# We want the dependency tree to be evaluated each time and to be sure that the dependencies are freshly downloaded
restoreArguments: '--ignore-failed-sources --no-cache --force'
feedsToUse: 'config'
nugetConfigPath: '$(Build.SourcesDirectory)\nuget.config'
# This task cannot use an apiKey directly (yet) so use any other service connection not based on an api key
externalFeedCredentials: 'IG ProGet IgniteUINuGet - Staging'
verbosityRestore: 'Diagnostic'

- task: PowerShell@2
displayName: 'Generate NuGet.config for IG ProGet NuGet feed'
inputs:
targetType: 'inline'
script: |
dotnet new nugetconfig --force
dotnet nuget add source ${{ parameters.igNuGetFeedUrl }} --name "IG ProGet NuGet" --allow-insecure-connections
# Manually add the allowInsecureConnections attribute to the nuget.config file
$nugetConfigPath = "$(Build.SourcesDirectory)\NuGet.config"
[xml]$nugetConfig = Get-Content $nugetConfigPath
$nugetConfig.configuration.packageSources.add | Where-Object { $_.name -eq "IG ProGet NuGet" } | ForEach-Object { $_.allowInsecureConnections = "true" }
# Add credentials to the nuget.config file
$packageSourceCredentials = $nugetConfig.CreateElement("packageSourceCredentials")
$source = $packageSourceCredentials.CreateElement("IG ProGet NuGet")
$add = $source.CreateElement("add")
$add.SetAttribute("key", "Username")
$add.SetAttribute("value", "$(username)")
$source.AppendChild($add)
$add = $source.CreateElement("add")
$add.SetAttribute("key", "ClearTextPassword")
$add.SetAttribute("value", "$(password)")
$source.AppendChild($add)
$packageSourceCredentials.AppendChild($source)
$nugetConfig.configuration.AppendChild($packageSourceCredentials)
$nugetConfig.Save($nugetConfigPath)
failOnStderr: true
showWarnings: true
workingDirectory: '$(Build.SourcesDirectory)'

- task: DotNetCoreCLI@2
displayName: 'dotnet restore B'
continueOnError: true
enabled: true
inputs:
command: 'restore'
projects: '$(Build.SourcesDirectory)\browser\IgBlazorSamples.${{ parameters.projectToBuild }}'
# We want the dependency tree to be evaluated each time and to be sure that the dependencies are freshly downloaded
restoreArguments: '--ignore-failed-sources --no-cache --force'
feedsToUse: 'config'
nugetConfigPath: '$(Build.SourcesDirectory)\nuget.config'
# This task cannot use an apiKey directly (yet) so use any other service connection not based on an api key
verbosityRestore: 'Diagnostic'


- task: DotNetCoreCLI@2
displayName: 'dotnet restore 2'
continueOnError: true
enabled: true
inputs:
command: 'restore'
projects: '$(Build.SourcesDirectory)\browser\IgBlazorSamples.${{ parameters.projectToBuild }}'
# We want the dependency tree to be evaluated each time and to be sure that the dependencies are freshly downloaded
restoreArguments: '--ignore-failed-sources --no-cache --force --configfile $(Build.SourcesDirectory)\nuget.config'
# This task cannot use an apiKey directly (yet) so use any other service connection not based on an api key
externalFeedCredentials: 'IG ProGet IgniteUINuGet - Staging'
verbosityRestore: 'Diagnostic'

- task: NuGetCommand@2
inputs:
command: 'restore'
restoreSolution: '$(Build.SourcesDirectory)\browser\IgBlazorSamples.${{ parameters.projectToBuild }}\IgBlazorSamples.Client.csproj'
feedsToUse: 'config'
nugetConfigPath: '$(Build.SourcesDirectory)\nuget.config'
externalFeedCredentials: 'IG ProGet IgniteUINuGet - Staging'




- task: DeleteFiles@1
displayName: 'Delete NuGet.config file - used only at build time'
enabled: false
inputs:
SourceFolder: '$(Build.SourcesDirectory)\'
Contents: '**/nuget.config'

- task: CmdLine@2
# Using a CmldLine call for this opeation, because I couldn't get it to work as expected with the DotNetCoreCLI task
displayName: 'dotnet publish'
inputs:
# Skip the restore process as it is already done. Got an error when I tried skipping the build process (which is already done as well)
script: 'dotnet publish --no-restore -c release -o $(Build.SourcesDirectory)\browser\IgBlazorSamples.${{ parameters.projectToBuild }}\publish'
workingDirectory: '$(Build.SourcesDirectory)\browser\IgBlazorSamples.${{ parameters.projectToBuild }}'

- task: ArchiveFiles@2
displayName: 'Package samples browser'
inputs:
verbose: ${{ parameters.isVerbose }}
rootFolderOrFile: '$(Build.SourcesDirectory)/browser/IgBlazorSamples.${{ parameters.projectToBuild }}/publish'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/BlazorSamples${{ parameters.projectToBuild }}.zip'
replaceExistingArchive: true

- task: PublishPipelineArtifact@1
displayName: 'Publish pipeline artifact'
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)/BlazorSamples${{ parameters.projectToBuild }}.zip'
artifact: 'BlazorSamples${{ parameters.projectToBuild }}'

- ${{ if eq(parameters.shouldCleanPostExectuion, true) }}:
- task: PostBuildCleanup@4
75 changes: 56 additions & 19 deletions azure-pipelines/templates/build-steps-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ parameters:
- name: isVerbose
default: false
- name: shouldCleanPostExectuion
- name: username
- name: password

steps:
- task: NodeTool@0
Expand Down Expand Up @@ -32,21 +34,59 @@ steps:
displayName: 'Install dotnet if not already present'
inputs:
packageType: 'sdk'
version: '8.0.100' # we are currently building a 8.0 app. TODO: Try upgrading to 8.x in the future
version: '9.0.101' # we are currently building a 8.0 app. TODO: Try upgrading to 8.x in the future
performMultiLevelLookup: false


- task: PowerShell@2
displayName: 'Generate NuGet.config for IG ProGet NuGet feed and u'
displayName: 'Generate NuGet.config for IG ProGet NuGet feed'
continueOnError: true
inputs:
targetType: 'inline'
script: |
script: |
dotnet new nugetconfig --force
# The name of the source doesn't currently matter as the credentials are attached thanks to URL matching - according to MS docs
dotnet nuget add source ${{ parameters.igNuGetFeedUrl }} --name "IG ProGet NuGet"
dotnet nuget add source ${{ parameters.igNuGetFeedUrl }} --name "IG ProGet NuGet" --allow-insecure-connections
# Manually add the allowInsecureConnections attribute to the nuget.config file
Write-Host "getting config file"
Write-Host "$(Build.SourcesDirectory)\nuget.config"
$nugetConfigPath = "$(Build.SourcesDirectory)\nuget.config"
Write-Host "getting xml content"
[xml]$nugetConfig = Get-Content $nugetConfigPath
$nugetConfig.configuration.packageSources.add | Where-Object { $_.name -eq "IG ProGet NuGet" } | ForEach-Object { $_.allowInsecureConnections = "true" }
# Add credentials to the nuget.config file
Write-Host "current config"
Write-Host $nugetConfig
Write-Host "adding credentials"
$packageSourceCredentials = $nugetConfig.CreateElement("packageSourceCredentials")
Write-Host "adding source"
$source = $nugetConfig.CreateElement("IG_x0020_ProGet_x0020_NuGet")
$addUsername = $nugetConfig.CreateElement("add")
Write-Host "adding username"
$userName = "${{ parameters.username }}"
# $userName = ConvertTo-SecureString "${{ parameters.username }}" -asPlainText -Force
Write-Host "username is"
Write-Host "$userName"
$addUsername.SetAttribute("key", "Username")
Write-Host "setting attribute"
$addUsername.SetAttribute("value", $userName)
$source.AppendChild($addUsername)
$addPassword = $nugetConfig.CreateElement("add")
Write-Host "adding password"
#$password = ConvertTo-SecureString "${{ parameters.password}}" -asPlainText -Force
$password = "${{ parameters.password}}"
$addPassword.SetAttribute("key", "ClearTextPassword")
$addPassword.SetAttribute("value", "$password")
$source.AppendChild($addPassword)
$packageSourceCredentials.AppendChild($source)
$nugetConfig.configuration.AppendChild($packageSourceCredentials)
Write-Host "writing contents to file"
$nugetConfig.OuterXml | Set-Content -Path $nugetConfigPath
failOnStderr: true
showWarnings: true
workingDirectory: '$(Build.SourcesDirectory)\browser\IgBlazorSamples.${{ parameters.projectToBuild }}'
workingDirectory: '$(Build.SourcesDirectory)'

- task: PowerShell@2
displayName: 'Identify trial packages and use licensed ones instead'
Expand All @@ -64,30 +104,27 @@ steps:
$xml.Save('.\IgBlazorSamples.${{ parameters.projectToBuild }}.csproj')
failOnStderr: true
showWarnings: true
workingDirectory: '$(Build.SourcesDirectory)\browser\IgBlazorSamples.${{ parameters.projectToBuild }}'
workingDirectory: '$(Build.SourcesDirectory)\browser\IgBlazorSamples.${{ parameters.projectToBuild }}'

- task: DotNetCoreCLI@2
displayName: 'dotnet restore'
enabled: true
inputs:
command: 'restore'
projects: '$(Build.SourcesDirectory)\browser\IgBlazorSamples.${{ parameters.projectToBuild }}'
# We want the dependency tree to be evaluated each time and to be sure that the dependencies are freshly downloaded
restoreArguments: '--ignore-failed-sources --no-cache --force'
restoreArguments: '--ignore-failed-sources --no-cache --force'
feedsToUse: 'config'
nugetConfigPath: '$(Build.SourcesDirectory)\browser\IgBlazorSamples.${{ parameters.projectToBuild }}\NuGet.Config'
nugetConfigPath: '$(Build.SourcesDirectory)\nuget.config'
# This task cannot use an apiKey directly (yet) so use any other service connection not based on an api key
externalFeedCredentials: 'IG ProGet IgniteUINuGet - Staging'
${{ if eq(parameters.isVerbose, true) }}:
verbosityRestore: 'Diagnostic'
${{ else }}:
verbosityRestore: 'Normal'

verbosityRestore: 'Diagnostic'

- task: DeleteFiles@1
displayName: 'Delete NuGet.config file - used only at build time'
enabled: true
inputs:
SourceFolder: '$(Build.SourcesDirectory)\browser\IgBlazorSamples.${{ parameters.projectToBuild }}\'
Contents: '**/NuGet.config'
SourceFolder: '$(Build.SourcesDirectory)\'
Contents: '**/nuget.config'

- task: CmdLine@2
# Using a CmldLine call for this opeation, because I couldn't get it to work as expected with the DotNetCoreCLI task
Expand All @@ -114,4 +151,4 @@ steps:
artifact: 'BlazorSamples${{ parameters.projectToBuild }}'

- ${{ if eq(parameters.shouldCleanPostExectuion, true) }}:
- task: PostBuildCleanup@4
- task: PostBuildCleanup@4
Loading

0 comments on commit d26a3b5

Please sign in to comment.