mirror of
https://github.com/GeyserMC/Floodgate.git
synced 2025-12-19 14:59:20 +00:00
Re-added some git properties and updated Gradle to 7.3.3
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
`kotlin-dsl`
|
||||
java
|
||||
}
|
||||
|
||||
repositories {
|
||||
@@ -8,6 +9,13 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("gradle.plugin.com.github.jengelman.gradle.plugins", "shadow", "7.0.0")
|
||||
implementation("org.jfrog.buildinfo", "build-info-extractor-gradle", "4.25.2")
|
||||
implementation("net.kyori", "indra-common", "2.0.6")
|
||||
implementation("org.jfrog.buildinfo", "build-info-extractor-gradle", "4.26.1")
|
||||
implementation("gradle.plugin.com.github.johnrengelman", "shadow", "7.1.1")
|
||||
}
|
||||
|
||||
tasks.withType<KotlinCompile> {
|
||||
kotlinOptions {
|
||||
jvmTarget = "1.8"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,9 +24,21 @@
|
||||
*/
|
||||
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
import net.kyori.indra.git.IndraGitExtension
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.artifacts.ProjectDependency
|
||||
import org.gradle.kotlin.dsl.named
|
||||
import org.gradle.kotlin.dsl.the
|
||||
|
||||
fun Project.lastCommitHash(): String? =
|
||||
the<IndraGitExtension>().commit()?.name?.substring(0, 7)
|
||||
|
||||
// retrieved from https://wiki.jenkins-ci.org/display/JENKINS/Building+a+software+project
|
||||
// some properties might be specific to Jenkins
|
||||
fun Project.branchName(): String =
|
||||
System.getProperty("GIT_BRANCH", "local/dev")
|
||||
fun Project.buildNumber(): Int =
|
||||
Integer.parseInt(System.getProperty("BUILD_NUMBER", "-1"))
|
||||
|
||||
fun Project.relocate(pattern: String) {
|
||||
tasks.named<ShadowJar>("shadowJar") {
|
||||
@@ -44,10 +56,8 @@ fun Project.provided(pattern: String, name: String, version: String, excludedOn:
|
||||
dependencies.add("compileOnlyApi", "$pattern:$name:$version")
|
||||
}
|
||||
|
||||
fun Project.provided(dependency: ProjectDependency) {
|
||||
fun Project.provided(dependency: ProjectDependency) =
|
||||
provided(dependency.group!!, dependency.name, dependency.version!!)
|
||||
}
|
||||
|
||||
private fun calcExclusion(section: String, bit: Int, excludedOn: Int): String {
|
||||
return if (excludedOn and bit > 0) section else ""
|
||||
}
|
||||
private fun calcExclusion(section: String, bit: Int, excludedOn: Int): String =
|
||||
if (excludedOn and bit > 0) section else ""
|
||||
Reference in New Issue
Block a user