Add gradle build

This commit is contained in:
Markus Fleschutz 2021-05-10 16:21:38 +02:00
parent be62a1ef5a
commit 38a2093731

View File

@ -14,16 +14,14 @@ function MakeDir { param($Path)
if (-not(test-path "$Path/BuildFiles/" -pathType container)) {
& mkdir "$Path/BuildFiles/"
}
set-location "$Path/BuildFiles/"
& cmake ..
if ($lastExitCode -ne "0") { throw "Executing 'cmake ..' has failed" }
& make -j4
if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" }
set-location ..
} elseif (test-path "$Path/configure") {
"⏳ Building 📂$DirName using 'configure' ..."
set-location "$Path/"
@ -44,6 +42,16 @@ function MakeDir { param($Path)
& make -j4
if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" }
} elseif (test-path "$Path/build.gradle") {
"⏳ Building 📂$DirName using build.gradle ..."
set-location "$Path"
& gradle build
if ($lastExitCode -ne "0") { throw "'gradle build' has failed" }
& gradle test
if ($lastExitCode -ne "0") { throw "'gradle test' has failed" }
} elseif (test-path "$Path/Imakefile") {
"⏳ Building 📂$DirName using Imakefile ..."
set-location "$RepoDir/"
@ -72,7 +80,7 @@ function MakeDir { param($Path)
"⏳ No make rule found, but trying the subdirectory 📂$DirName ..."
MakeDir "$Path/$DirName"
} else {
write-warning "Sorry, no make rule found in 📂$DirName"
write-warning "Sorry, no make rule applies to: 📂$DirName"
exit 0
}
}
@ -83,7 +91,9 @@ try {
if (-not(test-path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" }
$RepoDirName = (get-item "$RepoDir").Name
$PreviousPath = get-location
MakeDir "$RepoDir"
set-location "$PreviousPath"
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
"✔️ built Git repository 📂$RepoDirName in $Elapsed sec."