Skip to content

Commit 5f27c72

Browse files
Merge pull request #34 from DevExpress-Examples/update_for_testing
Add script for testing example
2 parents 78ff015 + e0106bb commit 5f27c72

File tree

3 files changed

+74
-1
lines changed

3 files changed

+74
-1
lines changed

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/340354634/24.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/T1129779)
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)

jQuery/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "1.0.0",
44
"scripts": {
55
"start": "npm run lite",
6+
"build": "npm run lint",
67
"lite": "lite-server -c ./bs-config.json",
78
"lint-html": "prettier --check src/*",
89
"lint-js": "eslint --ext .js .",

test-example.ps1

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
param (
2+
[string]$version = "latest"
3+
)
4+
5+
function Process-JavaScriptProjects {
6+
param (
7+
[string]$Path = ".",
8+
[string[]]$Folders = @("jQuery", "Angular", "Vue", "React")
9+
)
10+
Write-Host "Processing JavaScript Projects"
11+
12+
foreach ($folder in $Folders) {
13+
if (-not (Test-Path $folder)) {
14+
Write-Host "Directory $folder does not exist. Skipping..."
15+
continue
16+
}
17+
18+
Write-Host "`nProcessing folder: $folder"
19+
20+
Set-Location $folder
21+
22+
Write-Host "Running 'npm install' in $folder"
23+
$installResult = & npm install -PassThru
24+
if ($LASTEXITCODE -ne 0) {
25+
Write-Error "npm install failed in $folder"
26+
$errorCode = 1
27+
}
28+
29+
Write-Host "Running 'npm run build' in $folder"
30+
$buildResult = & npm run build -PassThru
31+
if ($LASTEXITCODE -ne 0) {
32+
Write-Error "npm run build failed in $folder"
33+
$errorCode = 1
34+
}
35+
36+
Set-Location ..
37+
}
38+
}
39+
40+
function Process-DotNetProjects {
41+
param (
42+
[string]$RootDirectory = "."
43+
)
44+
Write-Host "`nProcessing .NET Projects";
45+
46+
$slnFiles = Get-ChildItem -Path $RootDirectory -Filter *.sln -Recurse -Depth 1
47+
48+
if ($slnFiles.Count -eq 0) {
49+
Write-Host "No solution files (.sln) found in the specified directory at level 1."
50+
exit 1
51+
}
52+
53+
foreach ($slnFile in $slnFiles) {
54+
Write-Host "Found solution file: $($slnFile.FullName)"
55+
56+
dotnet build $slnFile.FullName -c Release
57+
58+
if ($LASTEXITCODE -eq 0) {
59+
Write-Host "Build succeeded for $($slnFile.FullName)."
60+
} else {
61+
Write-Host "Build failed for $($slnFile.FullName)."
62+
errorCode = 1;
63+
}
64+
}
65+
}
66+
67+
$errorCode = 0;
68+
69+
Write-Host "Version: $version"
70+
Process-JavaScriptProjects
71+
Process-DotNetProjects
72+
73+
exit $errorCode

0 commit comments

Comments
 (0)