Skip to content

Commit

Permalink
chore(spotless): fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
powercasgamer committed Nov 28, 2023
1 parent 3ead2fa commit 6fdc4c3
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 18 deletions.
2 changes: 1 addition & 1 deletion build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ spotless {
endWithNewline()
encoding("UTF-8")
toggleOffOn()
target("*.gradle.kts")
target("**/*.gradle.kts")
}
kotlinGradle {
applyCommon()
Expand Down
2 changes: 1 addition & 1 deletion build-logic/src/main/kotlin/base-conventions.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ tasks {
register("cleanAll", Delete::class) {
dependsOn("clean", "cleanIdea", "cleanVisualStudio", "cleanEclipse")
}
}
}
27 changes: 14 additions & 13 deletions build-logic/src/main/kotlin/common-conventions.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ plugins {
id("java-library")
}

//val libs = extensions.getByType(org.gradle.accessors.dm.LibrariesForLibs::class)
// val libs = extensions.getByType(org.gradle.accessors.dm.LibrariesForLibs::class)

extensions.getByType(BasePluginExtension::class.java).archivesName.set(project.nameString(true))

Expand Down Expand Up @@ -62,17 +62,17 @@ indraSpotlessLicenser {
headerFormat(HeaderFormat.starSlash())
licenseHeaderFile(rootProject.projectDir.resolve("HEADER"))

val currentYear = Calendar.getInstance().apply {
time = Date()
}.get(Calendar.YEAR)
val currentYear =
Calendar.getInstance().apply {
time = Date()
}.get(Calendar.YEAR)
val createdYear = providers.gradleProperty("createdYear").map { it.toInt() }.getOrElse(currentYear)
val year = if (createdYear == currentYear) createdYear.toString() else "$createdYear-$currentYear"

property("name", providers.gradleProperty("projectName").getOrElse("template"))
property("year", year)
property("description", project.description ?: "A template project")
property("author", providers.gradleProperty("projectAuthor").getOrElse("template"))

}

tasks {
Expand All @@ -92,8 +92,8 @@ tasks {
mergeServiceFiles()
transform(Log4j2PluginsCacheFileTransformer::class.java)

relocate("xyz.jpenilla.gremlin", "dev.mizule.timetriggeredperms.lib.xyz.jpenilla.gremlin")
relocate("org.bstats", "dev.mizule.timetriggeredperms.lib.org.bstats")
relocate("xyz.jpenilla.gremlin", "dev.mizule.timetriggeredperms.lib.xyz.jpenilla.gremlin")
relocate("org.bstats", "dev.mizule.timetriggeredperms.lib.org.bstats")
}

withType<JavaCompile>().configureEach {
Expand All @@ -108,12 +108,13 @@ tasks {
filteringCharset = "UTF-8"
duplicatesStrategy = DuplicatesStrategy.INCLUDE

val praps = mapOf(
"pluginVersion" to project.versionString(),
"pluginAuthor" to providers.gradleProperty("projectAuthor").getOrElse("template"),
"pluginName" to providers.gradleProperty("projectName").getOrElse("template"),
"pluginDescription" to (project.description ?: "A template project")
)
val praps =
mapOf(
"pluginVersion" to project.versionString(),
"pluginAuthor" to providers.gradleProperty("projectAuthor").getOrElse("template"),
"pluginName" to providers.gradleProperty("projectName").getOrElse("template"),
"pluginDescription" to (project.description ?: "A template project"),
)

filesMatching(setOf("paper-plugin.yml", "plugin.yml", "velocity-plugin.json")) {
expand(praps)
Expand Down
2 changes: 1 addition & 1 deletion build-logic/src/main/kotlin/kotlin-conventions.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ tasks {

extensions.configure(KotlinProjectExtension::class) {
jvmToolchain(17)
}
}
2 changes: 1 addition & 1 deletion build-logic/src/main/kotlin/paper-conventions.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ hangarPublish {
resourcePage(provider { rootProject.file("README.md").readText() })
}
}
}
}
2 changes: 1 addition & 1 deletion build-logic/src/main/kotlin/parent-conventions.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
plugins {
base
}
}

0 comments on commit 6fdc4c3

Please sign in to comment.