mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 09:27:43 +01:00
Build using Toothpick scripts (#122)
Co-authored-by: BillyGalbreath <blake.galbreath@gmail.com>
This commit is contained in:
20
buildSrc/src/main/kotlin/ToothpickSubproject.kt
Normal file
20
buildSrc/src/main/kotlin/ToothpickSubproject.kt
Normal file
@@ -0,0 +1,20 @@
|
||||
import org.gradle.api.Project
|
||||
import java.io.File
|
||||
|
||||
class ToothpickSubproject {
|
||||
lateinit var project: Project
|
||||
|
||||
val baseDir: File by lazy {
|
||||
val name = project.name
|
||||
val upstream = project.toothpick.upstream
|
||||
val suffix = if (name.endsWith("server")) "Server" else "API"
|
||||
project.upstreamDir.resolve("$upstream-$suffix")
|
||||
}
|
||||
val projectDir: File
|
||||
get() = project.projectDir
|
||||
lateinit var patchesDir: File
|
||||
|
||||
operator fun component1(): File = baseDir
|
||||
operator fun component2(): File = projectDir
|
||||
operator fun component3(): File = patchesDir
|
||||
}
|
||||
Reference in New Issue
Block a user