| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- # 模块重命名验证脚本(PowerShell 版本)
- # 用于验证模块重命名是否成功
- Write-Host "=========================================" -ForegroundColor Cyan
- Write-Host "模块重命名验证" -ForegroundColor Cyan
- Write-Host "=========================================" -ForegroundColor Cyan
- Write-Host ""
- # 检查计数
- $successCount = 0
- $failCount = 0
- # 检查函数
- function Check-Item {
- param(
- [string]$Description,
- [bool]$Condition
- )
-
- if ($Condition) {
- Write-Host "✓ $Description" -ForegroundColor Green
- $script:successCount++
- } else {
- Write-Host "✗ $Description" -ForegroundColor Red
- $script:failCount++
- }
- }
- Write-Host "1. 检查目录结构..." -ForegroundColor Yellow
- Write-Host ""
- # 检查新目录是否存在
- Check-Item "yudao-module-order 目录存在" (Test-Path "yudao-module-order")
- Check-Item "yudao-module-product 目录存在" (Test-Path "yudao-module-product")
- # 检查旧目录是否已删除
- Check-Item "yudao-order-server 目录已删除" (-not (Test-Path "yudao-order-server"))
- Check-Item "yudao-product-server 目录已删除" (-not (Test-Path "yudao-product-server"))
- Write-Host ""
- Write-Host "2. 检查 POM 文件配置..." -ForegroundColor Yellow
- Write-Host ""
- # 检查根 pom.xml
- $rootPom = Get-Content "pom.xml" -Raw
- Check-Item "根 pom.xml 包含新模块声明" ($rootPom -match "yudao-module-order" -and $rootPom -match "yudao-module-product")
- Check-Item "根 pom.xml 不包含旧模块声明" ($rootPom -notmatch "yudao-order-server" -and $rootPom -notmatch "yudao-product-server")
- # 检查 yudao-server/pom.xml
- $serverPom = Get-Content "yudao-server/pom.xml" -Raw
- Check-Item "yudao-server/pom.xml 包含新模块依赖" ($serverPom -match "yudao-module-order" -and $serverPom -match "yudao-module-product")
- Check-Item "yudao-server/pom.xml 不包含旧模块依赖" ($serverPom -notmatch "yudao-order-server" -and $serverPom -notmatch "yudao-product-server")
- # 检查模块自身的 pom.xml
- if (Test-Path "yudao-module-order/pom.xml") {
- $orderPom = Get-Content "yudao-module-order/pom.xml" -Raw
- Check-Item "yudao-module-order/pom.xml artifactId 正确" ($orderPom -match "<artifactId>yudao-module-order</artifactId>")
- }
- if (Test-Path "yudao-module-product/pom.xml") {
- $productPom = Get-Content "yudao-module-product/pom.xml" -Raw
- Check-Item "yudao-module-product/pom.xml artifactId 正确" ($productPom -match "<artifactId>yudao-module-product</artifactId>")
- }
- Write-Host ""
- Write-Host "3. 检查源代码目录..." -ForegroundColor Yellow
- Write-Host ""
- # 检查源代码目录结构
- Check-Item "订单模块源代码目录存在" (Test-Path "yudao-module-order/src/main/java/cn/iocoder/yudao/module/order")
- Check-Item "生产模块源代码目录存在" (Test-Path "yudao-module-product/src/main/java/cn/iocoder/yudao/module/product")
- Write-Host ""
- Write-Host "=========================================" -ForegroundColor Cyan
- Write-Host "验证结果" -ForegroundColor Cyan
- Write-Host "=========================================" -ForegroundColor Cyan
- Write-Host ""
- Write-Host "成功: $successCount 项" -ForegroundColor Green
- Write-Host "失败: $failCount 项" -ForegroundColor Red
- Write-Host ""
- if ($failCount -eq 0) {
- Write-Host "✓ 模块重命名验证通过!" -ForegroundColor Green
- Write-Host ""
- Write-Host "下一步操作:" -ForegroundColor Yellow
- Write-Host " 1. mvn clean install -DskipTests"
- Write-Host " 2. 在 IDE 中刷新 Maven 项目"
- Write-Host " 3. 重启后端服务"
- exit 0
- }
- else {
- Write-Host "✗ 模块重命名验证失败,请检查上述失败项" -ForegroundColor Red
- Write-Host ""
- Write-Host "请参考 MODULE_RENAME_SUMMARY.md 文档"
- exit 1
- }
|