forked from mirrors/cobblemon
96 lines
2.6 KiB
Kotlin
96 lines
2.6 KiB
Kotlin
import utilities.isSnapshot
|
|
import utilities.version
|
|
import java.time.OffsetDateTime
|
|
import java.time.ZoneOffset
|
|
import java.time.format.DateTimeFormatter
|
|
|
|
/*
|
|
*
|
|
* * Copyright (C) 2023 Cobblemon Contributors
|
|
* *
|
|
* * This Source Code Form is subject to the terms of the Mozilla Public
|
|
* * License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* * file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
*
|
|
*/
|
|
|
|
plugins {
|
|
id("cobblemon.base-conventions")
|
|
id("cobblemon.publish-conventions")
|
|
|
|
id("net.kyori.blossom")
|
|
id("org.jetbrains.gradle.plugin.idea-ext")
|
|
id("net.nemerosa.versioning") version "2.8.2"
|
|
}
|
|
|
|
architectury {
|
|
common("forge", "fabric")
|
|
}
|
|
|
|
repositories {
|
|
maven(url = "${rootProject.projectDir}/deps")
|
|
maven(url = "https://api.modrinth.com/maven")
|
|
mavenLocal()
|
|
}
|
|
|
|
dependencies {
|
|
implementation(libs.bundles.kotlin)
|
|
modImplementation(libs.fabric.loader)
|
|
modApi(libs.molang)
|
|
|
|
// Integrations
|
|
compileOnlyApi(libs.jei.api)
|
|
modCompileOnly(libs.bundles.fabric.integrations.compileOnly) {
|
|
isTransitive = false
|
|
}
|
|
// Flywheel has no common dep so just pick one and don't use any platform specific code in common
|
|
// modCompileOnly(libs.flywheelFabric)
|
|
|
|
// Showdown
|
|
modCompileOnly(libs.graal)
|
|
|
|
// Data Storage
|
|
modCompileOnly(libs.bundles.mongo)
|
|
|
|
// Unit Testing
|
|
testImplementation(libs.bundles.unitTesting)
|
|
}
|
|
|
|
tasks.withType<Test> {
|
|
useJUnitPlatform()
|
|
testLogging {
|
|
setEvents(listOf("failed"))
|
|
setExceptionFormat("full")
|
|
}
|
|
}
|
|
|
|
sourceSets {
|
|
main {
|
|
blossom {
|
|
kotlinSources {
|
|
fun generateLicenseHeader() : String {
|
|
val builder = StringBuilder()
|
|
builder.append("/*\n")
|
|
rootProject.file("HEADER").forEachLine {
|
|
if(it.isEmpty()) {
|
|
builder.append(" *").append("\n")
|
|
} else {
|
|
builder.append(" * ").append(it).append("\n")
|
|
}
|
|
}
|
|
|
|
return builder.append(" */").append("\n").toString()
|
|
}
|
|
|
|
property("license", generateLicenseHeader())
|
|
property("modid", "cobblemon")
|
|
property("version", project.version())
|
|
property("isSnapshot", if(rootProject.isSnapshot()) "true" else "false")
|
|
property("gitCommit", versioning.info.commit)
|
|
property("branch", versioning.info.branch)
|
|
System.getProperty("buildNumber")?.let { property("buildNumber", it) }
|
|
}
|
|
}
|
|
}
|
|
}
|