Skip to content

Commit

Permalink
move to gremlin :)
Browse files Browse the repository at this point in the history
  • Loading branch information
broccolai committed Oct 29, 2023
1 parent 02f35d4 commit 9896b03
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 222 deletions.
6 changes: 0 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,6 @@ subprojects {
processResources {
expand("version" to rootProject.version)
}

register("inspectDependencies") {
doLast {
inspectDependenciesForProject(project)
}
}
}
}

Expand Down
12 changes: 0 additions & 12 deletions buildSrc/build.gradle.kts

This file was deleted.

55 changes: 0 additions & 55 deletions buildSrc/src/main/kotlin/Configurations.kt

This file was deleted.

61 changes: 0 additions & 61 deletions buildSrc/src/main/kotlin/DependencyInspection.kt

This file was deleted.

59 changes: 24 additions & 35 deletions bukkit/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,33 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
id("xyz.jpenilla.run-paper") version "2.2.0"
id("com.github.johnrengelman.shadow")
id("xyz.jpenilla.gremlin-gradle")
}

repositories {
maven("https://repo.jpenilla.xyz/snapshots/")
}

dependencies {
api(project(":tags-core"))
runtimeDownload(project(":tags-core"))

compileOnly(libs.paper.api)
compileOnly(libs.papi)
compileOnly(libs.vault)

api(libs.cloud.paper)
runtimeDownload(libs.cloud.paper)
api(libs.cloud.extras)
runtimeDownload(libs.cloud.extras)
api(libs.corn.minecraft.paper)
runtimeDownload(libs.corn.minecraft.paper)

api(libs.interfaces.paper)
runtimeDownload(libs.interfaces.paper)

implementation(libs.h2)
api(libs.h2)
runtimeDownload(libs.h2)
}

tasks {
Expand All @@ -29,47 +40,25 @@ tasks {
}
}

fun Project.collectDependencies(): Set<Dependency> {
val api = configurations.api.get()
val implementation = configurations.implementation.get()
return (api.dependencies + implementation.dependencies).toSet()
}

fun Set<Dependency>.formatDependencies(): List<String> = flatMap { dependency ->
when (dependency) {
is ProjectDependency -> {
dependency.dependencyProject.collectDependencies().formatDependencies()
}

else -> {
val formatted = dependency.run { "$group:$name:$version" }
listOf(formatted)
}
}
}

register("writeDependenciesToFile") {
val outputDir = File("${buildDir}/resources/main")
outputDir.mkdirs()
val outputFile = File(outputDir, "libraries.txt")

val dependencies = project
.collectDependencies()
.formatDependencies()

outputFile.writeText(dependencies.joinToString("\n"))
}

withType<ShadowJar> {
dependencies {
include(project(":tags-core"))
include(project(":tags-api"))
include(dependency(libs.gremlin.get().toString()))
}

archiveFileName.set(project.name + "aaaa.jar")
archiveFileName.set(project.name + ".jar")
}

build {
dependsOn(shadowJar)
}

named("build") {
dependsOn("writeDependenciesToFile", withType<ShadowJar>())
writeDependencies {
repos.set(listOf(
"https://repo.papermc.io/repository/maven-public/",
"https://repo.broccol.ai/releases",
"https://repo.jpenilla.xyz/snapshots/",
))
}
}
52 changes: 0 additions & 52 deletions bukkit/src/main/java/broccolai/tags/bukkit/PaperTagsLoader.java

This file was deleted.

2 changes: 1 addition & 1 deletion bukkit/src/main/resources/paper-plugin.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name : Tags
version : $version
main : broccolai.tags.bukkit.BukkitTagsPlatform
loader: broccolai.tags.bukkit.PaperTagsLoader
loader: xyz.jpenilla.gremlin.runtime.platformsupport.DefaultsPaperPluginLoader
api-version : '1.20'
dependencies:
server:
Expand Down
3 changes: 3 additions & 0 deletions gradle/libs.versions.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ plugins = {
"net.ltgt.errorprone" = "3.1.0"
"xyz.jpenilla.run-paper" = "1.0.6"
"com.adarshr.test-logger" = "3.2.0"
"xyz.jpenilla.gremlin-gradle" = "0.0.1-SNAPSHOT"
}

versions = {
# Tooling
checker-qual = "3.22.0"
errorprone = "2.13.1"
gremlin = "0.0.1-SNAPSHOT"

# Testing
truth = "1.1.3"
Expand Down Expand Up @@ -71,6 +73,7 @@ dependencies = {
# Tooling
checker-qual = {group = "org.checkerframework", name = "checker-qual", version.ref = "checker-qual"}
errorprone = {group = "com.google.errorprone", name = "error_prone_core", version.ref = "errorprone"}
gremlin = {group = "xyz.jpenilla", name = "gremlin-runtime", version.ref = "gremlin"}

# Google
guava = {group = "com.google.guava", name = "guava", version.ref = "guava"}
Expand Down
7 changes: 7 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
pluginManagement {
repositories {
gradlePluginPortal()
maven("https://repo.jpenilla.xyz/snapshots/")
}
}

plugins {
id("ca.stellardrift.polyglot-version-catalogs") version "6.0.0"
}
Expand Down

0 comments on commit 9896b03

Please sign in to comment.