Skip to content

Commit 7b9fe99

Browse files
Merge pull request #8 from DevExpress-Examples/update-repo-for-automation
Update demo
2 parents 751b199 + 4fb87bf commit 7b9fe99

File tree

5 files changed

+56
-48
lines changed

5 files changed

+56
-48
lines changed

ASP.NET Core/Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Download the example and use Visual Studio 2019 to open the project.
66

77
## Client-side resources and bundling
88

9-
This project uses [NPM](http://npmjs.com/) and [Gulp.js](https://gulpjs.com/) to install client-side libraries. The project restores NPM packages before the first build. Then, Gulp bundles required scripts and CSS files into the resulting package during the first and every next build.
9+
This project uses [NPM](https://www.npmjs.com/) and [Gulp.js](https://gulpjs.com/) to install client-side libraries. The project restores NPM packages before the first build. Then, Gulp bundles required scripts and CSS files into the resulting package during the first and every next build.
1010

1111
The resulted bundles will be located in the `wwwroot` folder:
1212
* `css/vendor.css` - a file with all CSS styles.

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<!-- default badges list -->
2-
![](https://img.shields.io/endpoint?url=https://codecentral.devexpress.com/api/v1/VersionRange/800447205/23.1.3%2B)
32
[![](https://img.shields.io/badge/Open_in_DevExpress_Support_Center-FF7200?style=flat-square&logo=DevExpress&logoColor=white)](https://supportcenter.devexpress.com/ticket/details/T1233410)
43
[![](https://img.shields.io/badge/📖_How_to_use_DevExpress_Examples-e9f6fc?style=flat-square)](https://docs.devexpress.com/GeneralInformation/403183)
54
[![](https://img.shields.io/badge/💬_Leave_Feedback-feecdd?style=flat-square)](#does-this-example-address-your-development-requirementsobjectives)

React/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ It correctly bundles React in production mode and optimizes the build for the be
2626
The build is minified and the filenames include the hashes.<br>
2727
Your app is ready to be deployed!
2828

29-
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
29+
See the section about [deployment](https://create-react-app.dev/docs/deployment/) for more information.
3030

3131
## Further help
3232

33-
You can learn more about React in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
33+
You can learn more about React in the [Create React App documentation](https://create-react-app.dev/docs/getting-started/).
3434

3535
To get more help on DevExtreme submit an issue on [GitHub](https://github.com/DevExpress/devextreme/issues) or [Support Center](https://www.devexpress.com/Support/Center/Question/Create)
3636

Vue/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has a
1919

2020
## Customize configuration
2121

22-
See [Vite Configuration Reference](https://vitejs.dev/config/).
22+
See [Vite Configuration Reference](https://vite.dev/config/).
2323

2424
## Project Setup
2525

test-example.ps1

Lines changed: 52 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
Write-Output "Branch name: $env:branchName"
21
$global:inputVersion = $env:branchName
32
$global:errorCode = 0
43

5-
$BUILD_VERSIONS_LIST = "BUILD_VERSIONS_LIST"
6-
7-
$allVersions = @(
4+
$global:allVersions = @(
85
"14.1", "14.2",
96
"15.1", "15.2",
107
"16.1", "16.2",
@@ -21,48 +18,55 @@ $allVersions = @(
2118

2219
function Process-JavaScriptProjects {
2320
param (
24-
[string]$Path = ".",
25-
[hashtable[]]$Folders = @(
26-
@{ Name = "jQuery"; Packages = @("devextreme-dist", "devextreme") },
27-
@{ Name = "Angular"; Packages = @("devextreme-angular", "devextreme") },
28-
@{ Name = "React"; Packages = @("devextreme-react", "devextreme") },
29-
@{ Name = "Vue"; Packages = @("devextreme-vue", "devextreme") }
30-
)
21+
[string]$buildVersion
22+
)
23+
Write-Output "`n--== Processing JavaScript Projects ==--"
24+
25+
[hashtable[]]$folders = @(
26+
@{ Name = "Angular"; Packages = @("devextreme-angular", "devextreme") },
27+
@{ Name = "React"; Packages = @("devextreme-react", "devextreme") },
28+
@{ Name = "Vue"; Packages = @("devextreme-vue", "devextreme") }
3129
)
32-
Write-Host "`n--== Processing JavaScript Projects ==--"
3330

34-
foreach ($folder in $Folders) {
31+
$jQueryEntry = @{
32+
Name = "jQuery";
33+
Packages = if ([double]$buildVersion -ge 23.1) { # `devextreme-dist` appeared in 23.1
34+
@("devextreme-dist", "devextreme")
35+
} else {
36+
@("devextreme")
37+
}
38+
}
39+
40+
$folders = @($jQueryEntry) + folders
41+
42+
foreach ($folder in $folders) {
3543
if (-not (Test-Path $($folder.Name))) {
36-
Write-Host "Directory $($folder.Name) does not exist. Skipping..."
44+
Write-Output "`nDirectory $($folder.Name) does not exist. Skipping..."
3745
continue
3846
}
3947

40-
Write-Host "`n<-- Processing folder: $($folder.Name) -->"
48+
Write-Output "`n<-- Processing folder: $($folder.Name) -->"
4149

4250
Set-Location $($folder.Name)
4351

44-
$packages = $folder.Packages | ForEach-Object { "$_@$global:buildVersion" }
52+
$packages = $folder.Packages | ForEach-Object { "$_@$buildVersion" }
4553

4654
$packageList = $packages -join " "
4755

48-
$command = "npm install $packageList --force --save --no-fund"
49-
50-
Write-Output "Running: $command"
51-
Invoke-Expression $command
56+
Write-Output "`nInstalling DevExtreme packages"
57+
npm install $packageList --save --save-exact --no-fund
5258

53-
Write-Host "Running 'npm install' in $($folder.Name)"
54-
$installResult = & npm install --force --no-fund --loglevel=error -PassThru
59+
Write-Output "`nInstalling the rest of the packages $($folder.Name)"
60+
npm install --save --save-exact --no-fund --loglevel=error
5561
if ($LASTEXITCODE -ne 0) {
56-
Write-Error "ERROR: npm install failed in $($folder.Name)"
62+
Write-Error "`nERROR: Failed to install packages: $($folder.Name)"
5763
$global:errorCode = 1
5864
}
5965

60-
Write-Host "`n<-- Updating packages... -->"
61-
62-
Write-Host "Running 'npm run build' in $($folder.Name)"
63-
$buildResult = & npm run build
66+
Write-Output "`nBuilding the project with 'npm run build' $($folder.Name)"
67+
npm run build
6468
if ($LASTEXITCODE -ne 0) {
65-
Write-Error "ERROR: npm run build failed in $($folder.Name)"
69+
Write-Error "`nERROR: Failed to build the project: $($folder.Name)"
6670
$global:errorCode = 1
6771
}
6872

@@ -74,33 +78,35 @@ function Process-DotNetProjects {
7478
param (
7579
[string]$RootDirectory = "."
7680
)
77-
Write-Host "`nProcessing .NET Projects"
81+
Write-Output "`nProcessing .NET projects"
7882

7983
$slnFiles = Get-ChildItem -Path $RootDirectory -Filter *.sln -Recurse -Depth 1
8084

8185
if ($slnFiles.Count -eq 0) {
82-
Write-Host "No solution files (.sln) found in the specified directory at level 1."
86+
Write-Output "`nNo solution files (.sln) found in the specified directory at level 1."
8387
return
8488
}
8589

8690
foreach ($slnFile in $slnFiles) {
87-
Write-Host "Found solution file: $($slnFile.FullName)"
91+
Write-Output "`nFound solution file: $($slnFile.FullName)"
8892

8993
dotnet build $slnFile.FullName -c Release
9094

9195
if ($LASTEXITCODE -eq 0) {
92-
Write-Host "Build succeeded for $($slnFile.FullName)."
96+
Write-Output "`nBuild succeeded for $($slnFile.FullName)."
9397
} else {
94-
Write-Error "Build failed for $($slnFile.FullName)."
98+
Write-Error "`nBuild failed for $($slnFile.FullName)."
9599
$global:errorCode = 1
96100
}
97101
}
98102
}
99103

100104
function Set-BuildVersion {
105+
$BUILD_VERSIONS_LIST = "BUILD_VERSIONS_LIST"
106+
101107
$inputMajorMinor = $global:inputVersion -replace "\.\d+\+$", ""
102108

103-
$filteredList = $allVersions | Where-Object {
109+
$filteredList = $global:allVersions | Where-Object {
104110
($_ -replace "\." -as [double]) -ge ($inputMajorMinor -replace "\." -as [double])
105111
}
106112

@@ -114,31 +120,34 @@ function Set-BuildVersion {
114120

115121
if ($currentList.Count -gt 1) {
116122
$inputMajorMinor = $currentList[0]
117-
Write-Output "Input version: '$inputMajorMinor'"
118-
$global:buildVersion = $inputMajorMinor
119123
$updatedList = $currentList[1..($currentList.Count - 1)]
120124
} else {
121-
Write-Output "The list in the environment variable has only one item. "
125+
Write-Output "`nThe list in the environment variable has only one item."
122126
$inputMajorMinor = $currentList
123-
$global:buildVersion = $inputMajorMinor
124-
Write-Output "Input version: '$inputMajorMinor'"
125127
$updatedList = ""
126128
}
127129

130+
$global:buildVersion = $inputMajorMinor
131+
Write-Output "Input version: '$inputMajorMinor'"
132+
128133
$newValue = $updatedList -join ";"
129134

130135
[Environment]::SetEnvironmentVariable($BUILD_VERSIONS_LIST, $newValue, [EnvironmentVariableTarget]::Machine)
131136

132-
Write-Output "Environment variable '$BUILD_VERSIONS_LIST' has been updated."
137+
Write-Output "`nEnvironment variable '$BUILD_VERSIONS_LIST' has been updated."
133138
Write-Output "New List: $updatedList"
134139
}
135140

136-
Write-Host "`nBranch Name: $global:branchName"
141+
Write-Output "`nBranch Name: $global:branchName"
137142

138143
Set-BuildVersion
139-
Process-JavaScriptProjects
144+
if (-not $global:buildVersion) {
145+
Write-Output "`nThe buildVersion is null or an empty string."
146+
exit 1
147+
}
148+
Process-JavaScriptProjects -buildVersion $global:buildVersion
140149
Process-DotNetProjects
141150

142-
Write-Host "Error code: $global:errorCode"
151+
Write-Output "`nFinished testing. Error code: $global:errorCode"
143152

144153
exit $global:errorCode

0 commit comments

Comments
 (0)