forked from StarOpenSource/Engine
Add git and gradle build information
This commit is contained in:
parent
574c9586a1
commit
2629e940e7
5 changed files with 63 additions and 11 deletions
2
base/src/main/resources/.gitignore
vendored
Normal file
2
base/src/main/resources/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
sosengine-*-git.properties
|
||||
sosengine-*-gradle.properties
|
|
@ -2,6 +2,8 @@ import org.jetbrains.dokka.DokkaConfiguration
|
|||
import org.jetbrains.dokka.gradle.DokkaTask
|
||||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||
import java.net.URI
|
||||
import java.nio.file.Files
|
||||
import java.nio.file.LinkOption
|
||||
|
||||
/*
|
||||
* STAROPENSOURCE ENGINE SOURCE FILE
|
||||
|
@ -115,6 +117,21 @@ allprojects {
|
|||
jvmTarget = JvmTarget.valueOf("JVM_${property("java") as String}")
|
||||
}
|
||||
|
||||
// Unit testing
|
||||
// -> Configure Gradle to use JUnit
|
||||
tasks.test {
|
||||
useJUnitPlatform()
|
||||
|
||||
testLogging {
|
||||
events(
|
||||
"passed",
|
||||
"skipped",
|
||||
"failed"
|
||||
)
|
||||
}
|
||||
maxParallelForks = 1
|
||||
}
|
||||
|
||||
// Dokka
|
||||
// -> Register jar generation tasks
|
||||
// See https://kotlinlang.org/docs/dokka-gradle.html#build-javadoc-jar
|
||||
|
@ -173,18 +190,45 @@ allprojects {
|
|||
}
|
||||
}
|
||||
|
||||
// Unit testing
|
||||
// -> Configure Gradle to use JUnit
|
||||
tasks.test {
|
||||
useJUnitPlatform()
|
||||
// Git properties
|
||||
// -> Configure
|
||||
gitProperties {
|
||||
dotGitDirectory = file("${rootProject.rootDir}/.git")
|
||||
failOnNoGitDirectory = false // Allow continuing if .git directory is missing (tarball)
|
||||
extProperty = "git"
|
||||
dateFormat = "yyyy-MM-dd'T'HH:mmZ"
|
||||
dateFormatTimeZone = "UTC"
|
||||
}
|
||||
// -> Copy task
|
||||
tasks.register("copyGitProperties") {
|
||||
dependsOn(tasks.generateGitProperties)
|
||||
|
||||
testLogging {
|
||||
events(
|
||||
"passed",
|
||||
"skipped",
|
||||
"failed"
|
||||
)
|
||||
doLast {
|
||||
val target: File = file("${project.projectDir}/src/main/resources/sosengine-${project.name.replace(":", "-")}-git.properties")
|
||||
val source: File = file("${project.projectDir}/build/resources/main/git.properties")
|
||||
|
||||
if (Files.exists(target.toPath(), LinkOption.NOFOLLOW_LINKS))
|
||||
Files.delete(target.toPath())
|
||||
Files.move(source.toPath(), target.toPath())
|
||||
}
|
||||
maxParallelForks = 1
|
||||
}
|
||||
tasks.processResources {
|
||||
dependsOn(tasks["copyGitProperties"])
|
||||
}
|
||||
|
||||
// Gradle properties
|
||||
// -> Copy task
|
||||
tasks.register("copyGradleProperties") {
|
||||
doLast {
|
||||
val target: File = file("${project.projectDir}/src/main/resources/sosengine-${project.name.replace(":", "-")}-gradle.properties")
|
||||
val source: File = file("${project(":").projectDir.path}/gradle.properties")
|
||||
|
||||
if (Files.exists(target.toPath(), LinkOption.NOFOLLOW_LINKS))
|
||||
Files.delete(target.toPath())
|
||||
Files.copy(source.toPath(), target.toPath())
|
||||
}
|
||||
}
|
||||
tasks.processResources {
|
||||
dependsOn(tasks["copyGradleProperties"])
|
||||
}
|
||||
}
|
||||
|
|
2
dist/template-subproject/src/main/resources/.gitignore
vendored
Normal file
2
dist/template-subproject/src/main/resources/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
sosengine-*-git.properties
|
||||
sosengine-*-gradle.properties
|
2
testapp/src/main/resources/.gitignore
vendored
Normal file
2
testapp/src/main/resources/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
sosengine-*-git.properties
|
||||
sosengine-*-gradle.properties
|
2
testing/src/main/resources/.gitignore
vendored
Normal file
2
testing/src/main/resources/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
sosengine-*-git.properties
|
||||
sosengine-*-gradle.properties
|
Loading…
Reference in a new issue