-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.ps1
More file actions
34 lines (28 loc) · 1.43 KB
/
Copy pathbuild.ps1
File metadata and controls
34 lines (28 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
$ErrorActionPreference = "Stop"
$jdk = "C:\Program Files\Java\jdk-26.0.2\bin"
$root = Split-Path -Parent $MyInvocation.MyCommand.Path
Push-Location $root
$files = Get-ChildItem -Path "C:\CLLL\libraries", "C:\CLLL\plugins" -Filter "*.jar" -Recurse |
Select-Object -ExpandProperty FullName
$cp = $files -join ";"
New-Item -ItemType Directory -Path build\classes -Force | Out-Null
New-Item -ItemType Directory -Path build\test-classes -Force | Out-Null
Remove-Item -Path build\classes\* -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path build\test-classes\* -Recurse -Force -ErrorAction SilentlyContinue
$mainSources = Get-ChildItem -Path src\main\java -Filter "*.java" -Recurse |
Select-Object -ExpandProperty FullName
& "$jdk\javac.exe" --release 25 -encoding UTF-8 -cp "$cp" -d build\classes $mainSources
if ($LASTEXITCODE -ne 0) { Pop-Location; exit 1 }
$testSources = Get-ChildItem -Path src\test\java -Filter "*.java" -Recurse -ErrorAction SilentlyContinue |
Select-Object -ExpandProperty FullName
if ($testSources) {
& "$jdk\javac.exe" --release 25 -encoding UTF-8 -cp "$cp;build\classes" -d build\test-classes $testSources
if ($LASTEXITCODE -ne 0) { Pop-Location; exit 1 }
}
Copy-Item src\main\resources\* build\classes\ -Force -Recurse
Push-Location build\classes
& "$jdk\jar.exe" cf ..\..\SunshineCommandGuard-1.4.3.jar *
Pop-Location
if ($LASTEXITCODE -ne 0) { Pop-Location; exit 1 }
Write-Host "BUILD_OK"
Pop-Location