java build path -- source folders on build path

本文详细解析了sourcefolders下的配置含义,包括构建路径上的源文件夹、.class编译输出目录、包含与排除规则、本地库文件夹及可选编译问题的处理方式。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Source folders 下的配置是什么意思:

source folders on build path:构建路径上的源文件夹

Out folder:.class编译输出的目录,如果不设置output folder,默认输出路径为与.java文件同一个文件夹下。
Included:(All)包含classes下的所有东西
Excluded: (* * /.svn/**) 去除classes下的所有svn的东西。
Native library location:本地库文件夹配置
Ignore optional compile problem:忽略的可选编译问题
 

PS C:\Users\Administrator> # Ultimate-ProjectCleanup.ps1 >> $projectRoot = "E:\ProjectEcosystem\ProjectMonitor" >> >> # 1. 创建完整的文件夹结构 >> $folders = @( >> "SQLite", >> "Logs", >> "Database", >> "Scripts", >> "Config", >> "Binaries", >> "SourceFiles", >> "Documentation", >> "Libraries", >> "BuildOutputs" >> ) >> >> foreach ($folder in $folders) { >> $path = Join-Path $projectRoot $folder >> if (-not (Test-Path $path)) { >> New-Item -ItemType Directory -Path $path -Force | Out-Null >> } >> } >> >> # 2. 增强的SQLite文件移动(包含PDB和XML) >> $sqlitePatterns = @( >> "System.Data.SQLite.*", >> "SQLite.Interop.*", >> "sqlite3.*", >> "SQLite.NET.*" >> ) >> >> foreach ($pattern in $sqlitePatterns) { >> $files = Get-ChildItem -Path $projectRoot -Filter $pattern -File >> foreach ($file in $files) { >> $destDir = Join-Path $projectRoot "SQLite" >> $destPath = Join-Path $destDir $file.Name >> >> if (-not (Test-Path $destDir)) { >> New-Item -ItemType Directory -Path $destDir -Force | Out-Null >> } >> >> Move-Item -Path $file.FullName -Destination $destPath -Force -ErrorAction SilentlyContinue >> if ($?) { >> Write-Host "✅ 已移动SQLite文件: $($file.Name) -> SQLite\" -ForegroundColor Cyan >> } >> } >> } >> >> # 3. 移动所有程序数据库文件(PDB)到BuildOutputs >> $pdbFiles = Get-ChildItem -Path $projectRoot -Filter "*.pdb" -File >> foreach ($pdb in $pdbFiles) { >> $destDir = Join-Path $projectRoot "BuildOutputs" >> $destPath = Join-Path $destDir $pdb.Name >> >> Move-Item -Path $pdb.FullName -Destination $destPath -Force >> Write-Host "✅ 已移动PDB文件: $($pdb.Name) -> BuildOutputs\" -ForegroundColor Cyan >> } >> >> # 4. 移动所有XML文档文件到Documentation >> $xmlFiles = Get-ChildItem -Path $projectRoot -Filter "*.xml" -File >> foreach ($xml in $xmlFiles) { >> $destDir = Join-Path $projectRoot "Documentation" >> $destPath = Join-Path $destDir $xml.Name >> >> Move-Item -Path $xml.FullName -Destination $destPath -Force >> Write-Host "✅ 已移动文档: $($xml.Name) -> Documentation\" -ForegroundColor Cyan >> } >> >> # 5. 移动其他库文件到Libraries >> $libraryPatterns = @("*.dll", "*.lib", "*.a") >> foreach ($pattern in $libraryPatterns) { >> $files = Get-ChildItem -Path $projectRoot -Filter $pattern -File >> foreach ($file in $files) { >> # 排除已处理的SQLite文件 >> if ($file.FullName -notlike "*\SQLite\*") { >> $destDir = Join-Path $projectRoot "Libraries" >> $destPath = Join-Path $destDir $file.Name >> >> Move-Item -Path $file.FullName -Destination $destPath -Force >> Write-Host "✅ 已移动库文件: $($file.Name) -> Libraries\" -ForegroundColor Cyan >> } >> } >> } >> >> # 6. 项目感知型清理 - 保留项目结构 >> $projectFolders = @("APIServer", "BackendService", "DataAnalysis", "EcoMonitor", "MyApp", "MyWebApp") >> foreach ($project in $projectFolders) { >> $projectPath = Join-Path $projectRoot $project >> if (Test-Path $projectPath) { >> Write-Host "🔍 清理项目: $project" -ForegroundColor Yellow >> >> # 清理项目中的临时文件 >> $tempPatterns = @("*.tmp", "*.bak", "Thumbs.db") >> foreach ($pattern in $tempPatterns) { >> Get-ChildItem -Path $projectPath -Filter $pattern -File -Recurse -ErrorAction SilentlyContinue | >> Remove-Item -Force -ErrorAction SilentlyContinue >> } >> >> # 清理项目中的空文件夹 >> Get-ChildItem -Path $projectPath -Directory -Recurse | >> Where-Object { >> $_.GetFiles().Count -eq 0 -and >> $_.GetDirectories().Count -eq 0 >> } | >> Remove-Item -Force -Recurse -ErrorAction SilentlyContinue >> } >> } >> >> # 7. 生成目录结构报告 >> $structureReport = Join-Path $projectRoot "Project_Structure_Report.txt" >> tree $projectRoot /F /A | Out-File -FilePath $structureReport -Encoding UTF8 >> >> # 8. 最终结果展示 >> Write-Host "✨ 终极清理完成!项目目录完美整理 ✨" -ForegroundColor Green >> Write-Host "当前目录结构:" >> tree $projectRoot /F /A >> Write-Host "完整报告已保存至: $structureReport" -ForegroundColor Yellow >> ✅ 已移动PDB文件: Installer.pdb -> BuildOutputs\ ✅ 已移动PDB文件: SQLite.Designer.pdb -> BuildOutputs\ ✅ 已移动PDB文件: test.pdb -> BuildOutputs\ ✅ 已移动PDB文件: testef6.pdb -> BuildOutputs\ ✅ 已移动PDB文件: testlinq.pdb -> BuildOutputs\ ✅ 已移动文档: SQLite.Designer.xml -> Documentation\ ✅ 已移动库文件: SQLite.Designer.dll -> Libraries\ 🔍 清理项目: APIServer 🔍 清理项目: BackendService 🔍 清理项目: DataAnalysis 🔍 清理项目: EcoMonitor 🔍 清理项目: MyApp 🔍 清理项目: MyWebApp ✨ 终极清理完成!项目目录完美整理 ✨ 当前目录结构: 卷 ="模型响应", 的文件夹 PATH 列表 卷序列号为 7648-2CD3 E:\PROJECTECOSYSTEM\PROJECTMONITOR | Project_Structure_Report.txt | +---APIServer | | .gitignore | | APIServer.code-workspace | | package.json | | | \---src | index.js | +---BackendService | | .gitignore | | BackendService.code-workspace | | BackendService.sln | | | \---src | \---BackendService | BackendService.csproj | Program.cs | +---Binaries | Installer.exe | test.exe | testef6.exe | testlinq.exe | +---BuildOutputs | Installer.pdb | SQLite.Designer.pdb | test.pdb | testef6.pdb | testlinq.pdb | +---Config | System.Data.SQLite.dll.config | test.exe.config | testef6.exe.config | testlinq.exe.config | +---DataAnalysis | | .gitignore | | DataAnalysis.code-workspace | | requirements.txt | | | \---src | main.py | +---Database | northwindEF.db | project_state.db | +---Documentation | SQLite.Designer.xml | +---EcoMonitor | | .gitignore | | README.md | | | \---config | settings.psd1 | +---Libraries | SQLite.Designer.dll | +---Logs +---MyApp | | .gitignore | | MyApp.code-workspace | | | \---src | index.html | main.js | style.css | +---MyWebApp | | .gitignore | | MyWebApp.code-workspace | | | \---src | index.html | main.js | style.css | +---Scripts | Initialize-DevEnv.psm1 | Monitor-Project.ps1 | Start-Ecosystem.ps1 | +---SourceFiles | db_init.py | monitor.py | state_analyzer.py | \---SQLite System.Data.SQLite.dll System.Data.SQLite.EF6.dll System.Data.SQLite.EF6.pdb System.Data.SQLite.EF6.xml System.Data.SQLite.Linq.dll System.Data.SQLite.Linq.pdb System.Data.SQLite.Linq.xml System.Data.SQLite.pdb System.Data.SQLite.xml 完整报告已保存至: E:\ProjectEcosystem\ProjectMonitor\Project_Structure_Report.txt PS C:\Users\Administrator> # 处理PDB文件 >> Get-ChildItem -Path $projectRoot -Filter "*.pdb" -File | >> Move-Item -Destination "$projectRoot\BuildOutputs" >> >> # 处理XML文档 >> Get-ChildItem -Path $projectRoot -Filter "*.xml" -File | >> Move-Item -Destination "$projectRoot\Documentation" >> PS C:\Users\Administrator> # 只清理项目目录中的临时文件,保留项目结构 >> $projectFolders | ForEach-Object { >> Get-ChildItem -Path (Join-Path $projectRoot $_) -Filter "*.tmp" -Recurse | >> Remove-Item -Force >> } >> PS C:\Users\Administrator> # 创建目录结构报告 >> tree $projectRoot /F /A | Out-File "Project_Structure_Report.txt" >> PS C:\Users\Administrator> # Permanent-ProjectOrganizer.ps1 >> $organizerScript = @" >> # 自动维护脚本 - 每天运行 >> `$projectRoot = "E:\ProjectEcosystem\ProjectMonitor" >> >> # 1. 清理临时文件 >> Get-ChildItem -Path `$projectRoot -Include *.tmp, *.bak, Thumbs.db -Recurse | >> Remove-Item -Force -ErrorAction SilentlyContinue >> >> # 2. 自动分类新文件 >> `$watcher = @{ >> "*.ps*1" = "Scripts" >> "*.exe" = "Binaries" >> "*.dll" = "Libraries" >> "*.pdb" = "BuildOutputs" >> "*.xml" = "Documentation" >> "*.db" = "Database" >> "*.py" = "SourceFiles" >> "*.json" = "Config" >> } >> >> Get-ChildItem -Path `$projectRoot -File | ForEach-Object { >> foreach (`$rule in `$watcher.GetEnumerator()) { >> if (`$_.Name -like `$rule.Key) { >> `$targetDir = Join-Path `$projectRoot `$rule.Value >> if (-not (Test-Path `$targetDir)) { >> New-Item -ItemType Directory -Path `$targetDir | Out-Null >> } >> Move-Item -Path `$_.FullName -Destination `$targetDir -Force >> break >> } >> } >> } >> >> # 3. 每周生成报告 >> if ((Get-Date).DayOfWeek -eq [System.DayOfWeek]::Monday) { >> tree `$projectRoot /F /A | Out-File (Join-Path `$projectRoot "Weekly_Structure_Report.txt") >> } >> "@ >> >> Set-Content -Path "E:\ProjectEcosystem\ProjectOrganizer.ps1" -Value $organizerScript >> PS C:\Users\Administrator> # 创建Windows计划任务 >> $action = New-ScheduledTaskAction -Execute "PowerShell.exe" ` >> -Argument "-ExecutionPolicy Bypass -File `"E:\ProjectEcosystem\ProjectOrganizer.ps1`"" >> >> $trigger = New-ScheduledTaskTrigger -Daily -At 3am >> >> Register-ScheduledTask -Action $action -Trigger $trigger ` >> -TaskName "ProjectMonitor_Organizer" -Description "每日自动整理项目目录" ` >> -User "SYSTEM" -RunLevel Highest >> TaskPath TaskName State -------- -------- ----- \ ProjectMonitor_Organizer Ready PS C:\Users\Administrator>
最新发布
08-14
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值