diff --git a/build.gradle.kts b/build.gradle.kts index 1d50625..4c0cff8 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -39,21 +39,15 @@ repositories { maven { url = uri("https://jitpack.io") } maven { url = uri("https://maven.duti.dev/releases") } } -configurations { - // configuration that holds jars to include in the jar - create("extraLibs") -} +val extraLibs: Configuration by configurations.creating configurations { - named("implementation") { - extendsFrom(getByName("extraLibs")) + // configuration that holds jars to include in the jar + implementation { + extendsFrom(extraLibs) } } -fun DependencyHandlerScope.extraLibs(dependencyNotation: String, configure: ModuleDependency.() -> Unit = {}) { - add("extraLibs", dependencyNotation, configure) -} - dependencies { // This will make it work on most platforms. It automatically chooses the right dependencies at runtime. val cubiomesVersion = "dev.duti.acheong:cubiomes:1.22.3" @@ -78,7 +72,7 @@ dependencies { "com.seedfinding:mc_noise:7e3ba65e181796c4a2a1c8881d840b2254b92962", "com.seedfinding:mc_biome:41a42cb9019a552598f12089059538853e18ec78", "com.seedfinding:mc_terrain:b4246cbd5880c4f8745ccb90e1b102bde3448126", - "com.seedfinding:mc_feature:919b7e513cc1e87e029a9cd703fc4e2dc8686229" + "com.seedfinding:mc_feature:919b7e513cc1e87e029a9cd703fc4e2dc8686229", ) seedFindingDependencies.forEach { dependency -> extraLibs(dependency) { isTransitive = false } @@ -114,7 +108,7 @@ tasks.jar { from("LICENSE") { rename { "${it}_${project.base.archivesName}" } } - from(configurations["extraLibs"].map { if (it.isDirectory) it else zipTree(it) }) + from(extraLibs.map { if (it.isDirectory) it else zipTree(it) }) } tasks.withType() { diff --git a/src/main/kotlin/anticope/rejects/utils/MeteorManager.kt b/src/main/kotlin/anticope/rejects/utils/MeteorManager.kt index 0cc80df..0962635 100644 --- a/src/main/kotlin/anticope/rejects/utils/MeteorManager.kt +++ b/src/main/kotlin/anticope/rejects/utils/MeteorManager.kt @@ -27,12 +27,12 @@ private inline fun registerClasses(packageName: String, addInstance: } /** - * Registers all modules in the specified package that are annotated with @AutoRegister. + * Registers all modules in the specified package that are annotated with `@AutoRegister`. * - * This function scans the given package for classes that extend [Module] and have the @AutoRegister annotation, + * This function scans the given package for classes that extend [Module] and have the `@AutoRegister` annotation, * creating instances of those classes and adding them to the [Modules] system. * - * @param packageName The name of the package to search for modules, formatted as "com.example.module". + * @param packageName The name of the package to search for modules, formatted as `com.example.module`. * * @throws ClassNotFoundException If the classes in the specified package cannot be found. * @@ -40,19 +40,19 @@ private inline fun registerClasses(packageName: String, addInstance: * ``` * moduleRegister("com.github.shu.module") * ``` - * This will register all auto-registered modules from the "com.github.shu.module" package. + * This will register all auto-registered modules from the `com.github.shu.module` package. */ fun moduleRegister(packageName: String) { registerClasses(packageName, Modules.get()::add) } /** - * Registers all commands in the specified package that are annotated with @AutoRegister. + * Registers all commands in the specified package that are annotated with `@AutoRegister`. * - * This function scans the given package for classes that extend [Command] and have the @AutoRegister annotation, + * This function scans the given package for classes that extend [Command] and have the `@AutoRegister` annotation, * creating instances of those classes and adding them to the [Commands] system. * - * @param packageName The name of the package to search for commands, formatted as "com.example.command". + * @param packageName The name of the package to search for commands, formatted as `com.example.command`. * * @throws ClassNotFoundException If the classes in the specified package cannot be found. * @@ -60,7 +60,7 @@ fun moduleRegister(packageName: String) { * ``` * commandRegister("com.github.shu.command") * ``` - * This will register all auto-registered commands from the "com.github.shu.command" package. + * This will register all auto-registered commands from the `com.github.shu.command` package. */ fun commandRegister(packageName: String) { registerClasses(packageName, Commands::add) diff --git a/src/main/kotlin/anticope/rejects/utils/PackageScanner.kt b/src/main/kotlin/anticope/rejects/utils/PackageScanner.kt index a4dadd7..56b2708 100644 --- a/src/main/kotlin/anticope/rejects/utils/PackageScanner.kt +++ b/src/main/kotlin/anticope/rejects/utils/PackageScanner.kt @@ -14,7 +14,7 @@ class PackageScanner { /** * Finds all Kotlin classes in the specified package and filters them based on the provided criteria. * - * @param packageName The name of the package to search, formatted as "com.example.package". + * @param packageName The name of the package to search, formatted as `com.example.package`. * @param filter An optional filtering function that takes a [KClass] parameter and returns a boolean value. * Only classes for which this function returns `true` will be included in the results. * Defaults to a filter that accepts all classes (returns `true`). @@ -26,7 +26,7 @@ class PackageScanner { * ``` * val classes = findKClasses("com.example") { it.annotations.any { annotation -> annotation is MyAnnotation } } * ``` - * This will return all classes in the "com.example" package that are annotated with `@MyAnnotation`. + * This will return all classes in the `com.example` package that are annotated with `@MyAnnotation`. */ @JvmStatic fun findKClasses(packageName: String, filter: (KClass<*>) -> Boolean = { true }): List> {