generated from xpdustry/template-plugin
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
58 changed files
with
152 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,37 @@ | ||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar | ||
import net.kyori.mammoth.Extensions | ||
import org.gradle.accessors.dm.LibrariesForLibs | ||
import org.gradle.api.Project | ||
import org.gradle.api.artifacts.ProjectDependency | ||
import org.gradle.api.plugins.ExtensionContainer | ||
import org.gradle.api.provider.Property | ||
import org.gradle.api.provider.SetProperty | ||
import org.gradle.api.tasks.TaskProvider | ||
import org.gradle.kotlin.dsl.named | ||
import org.gradle.kotlin.dsl.property | ||
import org.gradle.kotlin.dsl.setProperty | ||
import org.gradle.kotlin.dsl.the | ||
|
||
internal val Project.libs: LibrariesForLibs get() = the() | ||
|
||
inline fun <reified T : Any> ExtensionContainer.findOrCreateExtension(name: String): T = Extensions.findOrCreate(this, name, T::class.java) | ||
|
||
open class DistributorModuleExtension(project: Project) { | ||
val identifier: Property<String> = project.objects.property(String::class.java) | ||
val display: Property<String> = project.objects.property(String::class.java) | ||
val main: Property<String> = project.objects.property(String::class.java) | ||
val description: Property<String> = project.objects.property(String::class.java) | ||
val identifier = project.objects.property<String>() | ||
val display = project.objects.property<String>() | ||
val main = project.objects.property<String>() | ||
val description = project.objects.property<String>() | ||
val dependencies = project.objects.setProperty<ProjectDependency>() | ||
|
||
// TODO Does not handle transitive dependencies, FIX IT | ||
val dependencies: SetProperty<Project> = project.objects.setProperty(Project::class.java) | ||
companion object { | ||
const val EXTENSION_NAME = "distributorModule" | ||
} | ||
} | ||
|
||
fun Project.collectAllPluginDependencies(): Set<TaskProvider<out ShadowJar>> { | ||
val dependencies = mutableSetOf<TaskProvider<out ShadowJar>>() | ||
val extension = extensions.findOrCreateExtension<DistributorModuleExtension>(DistributorModuleExtension.EXTENSION_NAME) | ||
for (dependency in extension.dependencies.get()) { | ||
dependencies += dependency.dependencyProject.tasks.named<ShadowJar>("shadowJar") | ||
dependencies += dependency.dependencyProject.collectAllPluginDependencies() | ||
} | ||
return dependencies | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,10 @@ | ||
plugins { | ||
id("distributor.base-conventions") | ||
id("distributor.mindustry-conventions") | ||
id("distributor.publish-conventions") | ||
} | ||
|
||
repositories { | ||
maven("https://oss.sonatype.org/content/repositories/snapshots/") { | ||
name = "sonatype-oss-snapshots" | ||
mavenContent { snapshotsOnly() } | ||
} | ||
} | ||
|
||
module { | ||
identifier = "distributor-command-cloud" | ||
display = "DistributorLoggerSimple" | ||
main = "com.xpdustry.distributor.logger.simple.DistributorLoggerPlugin" | ||
description = "Simple slf4j logger implementation for plugins." | ||
} | ||
|
||
dependencies { | ||
compileOnly(projects.distributorCore) | ||
api(libs.cloud.core) | ||
compileOnly(project(":distributor-common")) | ||
compileOnly(libs.bundles.mindustry) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 0 additions & 4 deletions
4
...ributor-common/src/main/java/com/xpdustry/distributor/common/permission/package-info.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...butor/common/collection/package-info.java → ...ributor/core/collection/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
@NullMarked | ||
package com.xpdustry.distributor.common.collection; | ||
package com.xpdustry.distributor.core.collection; | ||
|
||
import org.jspecify.annotations.NullMarked; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.