Skip to content

Commit b4eda74

Browse files
Update files
1 parent 59e892e commit b4eda74

File tree

4 files changed

+244
-11
lines changed

4 files changed

+244
-11
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
* text=auto eol=lf
2+
13
VB/* linguist-vendored
24
scripts linguist-vendored
35
*.css linguist-detectable=false

angular/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ Run `ng test` to execute unit tests using [Karma](https://karma-runner.github.io
2222

2323
## Running end-to-end tests
2424

25-
Run `ng e2e` to execute end-to-end tests using [Protractor](http://www.protractortest.org/).
25+
Run `ng e2e` to execute end-to-end tests using [Protractor](https://www.protractortest.org/).
2626

2727
## Further help
2828

29-
For help with Angular CLI, use `ng help` or review the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
29+
For help with Angular CLI, use `ng help` or review the [Angular CLI Overview and Command Reference](https://v17.angular.io/cli) page.

react/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ You will also see any lint errors in the console.
1919
### `npm test`
2020

2121
Launches the test runner in the interactive watch mode.\
22-
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
22+
See the section about [running tests](https://create-react-app.dev/docs/running-tests) for more information.
2323

2424
### `npm run build`
2525

@@ -29,7 +29,7 @@ It correctly bundles React in production mode and optimizes the build for the be
2929
The build is minified and the filenames include the hashes.\
3030
Your app is ready to be deployed!
3131

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

3434
### `npm run eject`
3535

@@ -43,30 +43,30 @@ You don’t have to ever use `eject`. The curated feature set is suitable for sm
4343

4444
## Learn More
4545

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

4848
To learn React, check out the [React documentation](https://reactjs.org/).
4949

5050
### Code Splitting
5151

52-
This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
52+
This section has moved here: [https://create-react-app.dev/docs/code-splitting](https://create-react-app.dev/docs/code-splitting)
5353

5454
### Analyzing the Bundle Size
5555

56-
This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
56+
This section has moved here: [https://create-react-app.dev/docs/analyzing-the-bundle-size](https://create-react-app.dev/docs/analyzing-the-bundle-size)
5757

5858
### Making a Progressive Web App
5959

60-
This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
60+
This section has moved here: [https://create-react-app.dev/docs/making-a-progressive-web-app](https://create-react-app.dev/docs/making-a-progressive-web-app)
6161

6262
### Advanced Configuration
6363

64-
This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
64+
This section has moved here: [https://create-react-app.dev/docs/advanced-configuration](https://create-react-app.dev/docs/advanced-configuration)
6565

6666
### Deployment
6767

68-
This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
68+
This section has moved here: [https://create-react-app.dev/docs/deployment](https://create-react-app.dev/docs/deployment)
6969

7070
### `npm run build` fails to minify
7171

72-
This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
72+
This section has moved here: [https://create-react-app.dev/docs/troubleshooting](https://create-react-app.dev/docs/troubleshooting)

test-example.ps1

Lines changed: 231 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,231 @@
1+
# For local testing, you can pass branchName and/or buildVersion.
2+
# If both parameters are specified, only buildVersion will be used.
3+
# Example usage:
4+
# ./test-example.ps1 -branchName 23.1.3+
5+
# ./test-example.ps1 -buildVersion 23.1.13
6+
param (
7+
[string]$branchName = [Environment]::GetEnvironmentVariable("BRANCH_NAME", [EnvironmentVariableTarget]::Machine),
8+
[string]$buildVersion = [Environment]::GetEnvironmentVariable("BUILD_VERSION", [EnvironmentVariableTarget]::Machine)
9+
)
10+
11+
# Repository's branch name, e.g. 24.1.3+
12+
$global:BRANCH_NAME = $branchName
13+
# Masstest-specific parameter. Specifies the minor version (example: '21.1.5') !or daily build (example: '21.2.2005')
14+
$global:BUILD_VERSION = $buildVersion
15+
16+
$global:ERROR_CODE = 0
17+
$global:FAILED_PROJECTS = @()
18+
19+
$global:ALL_VERSIONS = @(
20+
"14.1", "14.2",
21+
"15.1", "15.2",
22+
"16.1", "16.2",
23+
"17.1", "17.2",
24+
"18.1", "18.2",
25+
"19.1", "19.2",
26+
"20.1", "20.2",
27+
"21.1", "21.2",
28+
"22.1", "22.2",
29+
"23.1", "23.2",
30+
"24.1", "24.2",
31+
"25.1", "25.2"
32+
)
33+
34+
function Install-Packages {
35+
param (
36+
[string]$folderName,
37+
[string[]]$packages,
38+
[string]$buildVersion
39+
)
40+
Write-Output "`nInstalling packages in folder: $folderName"
41+
42+
$packageList = $packages | ForEach-Object { "$_@$buildVersion" }
43+
Write-Output "`nPackages to install: $($packageList -join ", ")"
44+
# TODO: Uninstall DevExtreme packages to avoid potential peer-dependency issues
45+
npm install @($packageList) --save --save-exact --no-fund
46+
if (-not $?) {
47+
Write-Error "`nERROR: Failed to install DevExtreme packages in $folderName"
48+
throw "Installation failed in $folderName"
49+
}
50+
}
51+
52+
function Build-Project {
53+
param (
54+
[string]$folderName
55+
)
56+
Write-Output "`nBuilding the project in folder: $folderName"
57+
58+
npm run build
59+
if (-not $?) {
60+
Write-Error "`nERROR: Failed to build the project in $folderName"
61+
throw "Build failed in $folderName"
62+
}
63+
}
64+
65+
function Process-JavaScriptProjects {
66+
param (
67+
[string]$buildVersion
68+
)
69+
Write-Output "`n--== Starting JavaScript Projects Processing ==--"
70+
71+
[hashtable[]]$folders = @(
72+
@{ Name = "Angular"; Packages = @("devextreme", "devextreme-angular") },
73+
@{ Name = "React"; Packages = @("devextreme", "devextreme-react") },
74+
@{ Name = "Vue"; Packages = @("devextreme", "devextreme-vue") }
75+
)
76+
77+
$jQueryEntry = @{
78+
Name = "jQuery";
79+
Packages = if ([version]$buildVersion -ge [version]23.1) { # `devextreme-dist` appeared in 23.1
80+
@("devextreme", "devextreme-dist")
81+
} else {
82+
@("devextreme")
83+
}
84+
}
85+
86+
$folders = @($jQueryEntry) + $folders
87+
88+
foreach ($folder in $folders) {
89+
$folderName = $folder.Name
90+
$packages = $folder.Packages
91+
92+
if (-not (Test-Path $folderName)) {
93+
Write-Output "`nDirectory $folderName does not exist. Skipping..."
94+
continue
95+
}
96+
97+
Write-Output "`nProcessing folder: $folderName"
98+
Push-Location $folderName
99+
100+
try {
101+
Install-Packages -folderName $folderName -packages $packages -buildVersion $buildVersion
102+
Write-Output "`nInstalling remaining packages in $folderName"
103+
npm install --save --save-exact --no-fund --loglevel=error
104+
if (-not $?) {
105+
throw "ERROR: Failed to install remaining packages in $folderName"
106+
}
107+
Build-Project -folderName $folderName
108+
} catch {
109+
Write-Error "`nAn error occurred: $_"
110+
$global:LASTEXITCODE = 1
111+
$global:ERROR_CODE = 1
112+
$global:FAILED_PROJECTS += $folderName
113+
} finally {
114+
Pop-Location
115+
}
116+
}
117+
118+
Write-Output "`n--== JavaScript Projects Processing Completed ==--"
119+
}
120+
121+
function Process-DotNetProjects {
122+
param (
123+
[string]$RootDirectory = "."
124+
)
125+
126+
Write-Output "`n--== Starting .NET project processing in directory: $RootDirectory ==--"
127+
128+
$slnFiles = Get-ChildItem -Path $RootDirectory -Filter *.sln -Recurse -Depth 1
129+
130+
if ($slnFiles.Count -eq 0) {
131+
Write-Output "`nNo solution files (.sln) found in the specified directory at level 1."
132+
return
133+
}
134+
135+
foreach ($slnFile in $slnFiles) {
136+
Write-Output "`nFound solution file: $($slnFile.FullName)"
137+
138+
try {
139+
Write-Output "`nBuilding solution: $($slnFile.FullName)"
140+
dotnet build $slnFile.FullName -c Release
141+
142+
if ($?) {
143+
Write-Output "`nBuild succeeded for $($slnFile.FullName)."
144+
} else {
145+
throw "Build failed for $($slnFile.FullName)."
146+
}
147+
} catch {
148+
Write-Error "`nERROR: $_"
149+
$global:LASTEXITCODE = 1
150+
$global:ERROR_CODE = 1
151+
$global:FAILED_PROJECTS += "ASP.NET"
152+
}
153+
}
154+
155+
Write-Output "`nCompleted .NET project processing."
156+
}
157+
158+
function Set-BuildVersion {
159+
Write-Output "`n--== Starting Set-BuildVersion process. ==--"
160+
161+
$BUILD_VERSION = $global:BUILD_VERSION
162+
if ($BUILD_VERSION) {
163+
Write-Output "BUILD_VERSION is already set: $BUILD_VERSION"
164+
return
165+
}
166+
167+
$BUILD_VERSIONS_LIST = "BUILD_VERSIONS_LIST"
168+
169+
$inputMajorMinor = $global:BRANCH_NAME -replace "\.\d+\+$", ""
170+
Write-Output "Extracted major.minor version from branch name: $inputMajorMinor"
171+
172+
$filteredList = $global:ALL_VERSIONS | Where-Object {
173+
($_ -replace "\." -as [double]) -ge ($inputMajorMinor -replace "\." -as [double])
174+
}
175+
Write-Output "Filtered versions list: $filteredList"
176+
177+
$currentValue = [Environment]::GetEnvironmentVariable($BUILD_VERSIONS_LIST, [EnvironmentVariableTarget]::Machine)
178+
$currentList = if ($currentValue) {
179+
$currentValue -split ";"
180+
} else {
181+
$filteredList
182+
}
183+
Write-Output "Current versions list: $currentList"
184+
185+
if ($currentList.Count -gt 1) {
186+
$inputMajorMinor = $currentList[0]
187+
$updatedList = $currentList[1..($currentList.Count - 1)]
188+
} else {
189+
Write-Output "The list in the environment variable has only one item."
190+
$inputMajorMinor = $currentList[0]
191+
$updatedList = @()
192+
}
193+
194+
$global:BUILD_VERSION = $inputMajorMinor
195+
Write-Output "BUILD_VERSION set to: $global:BUILD_VERSION"
196+
197+
$newValue = $updatedList -join ";"
198+
[Environment]::SetEnvironmentVariable($BUILD_VERSIONS_LIST, $newValue, [EnvironmentVariableTarget]::Machine)
199+
200+
Write-Output "Environment variable '$BUILD_VERSIONS_LIST' updated."
201+
Write-Output "New list: $updatedList"
202+
}
203+
204+
function Write-BuildInfo {
205+
$BRANCH_NAME = if ($global:BRANCH_NAME -ne $null -and $global:BRANCH_NAME -ne "") {
206+
$global:BRANCH_NAME
207+
} else {
208+
"(empty)"
209+
}
210+
211+
$BUILD_VERSION = if ($global:BUILD_VERSION -ne $null -and $global:BUILD_VERSION -ne "") {
212+
$global:BUILD_VERSION
213+
} else {
214+
"(empty)"
215+
}
216+
217+
Write-Output "`nBranch Name: $BRANCH_NAME"
218+
Write-Output "Build Version: $BUILD_VERSION"
219+
}
220+
221+
Write-BuildInfo
222+
Set-BuildVersion
223+
Process-JavaScriptProjects -buildVersion $global:BUILD_VERSION
224+
Process-DotNetProjects
225+
226+
Write-Output "`nFinished testing version: $global:BUILD_VERSION. Error code: $global:ERROR_CODE"
227+
if ($global:ERROR_CODE -ne 0 -and $global:FAILED_PROJECTS.Count -gt 0) {
228+
Write-Output "`FAILED PROJECTS: $(($global:FAILED_PROJECTS -join ", "))"
229+
}
230+
231+
exit $global:ERROR_CODE

0 commit comments

Comments
 (0)