Skip to content

Commit

Permalink
feat: allow plugin authors to disable hyperlinking profile
Browse files Browse the repository at this point in the history
  • Loading branch information
rushiiMachine committed Aug 24, 2024
1 parent bbcd8a8 commit 5abb762
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/main/kotlin/com/aliucord/gradle/AliucordExtension.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,28 @@ abstract class AliucordExtension @Inject constructor(val project: Project) {

val authors: ListProperty<Author> = project.objects.listProperty(Author::class.java)

fun author(name: String, id: Long) {
authors.add(Author(name, id))
}
/**
* Specify an author of this plugin.
*
* @param name The user-facing name to display
* @param id The Discord ID of the author, optional.
* This also will allow Aliucord to show a badge on your profile if the plugin is installed.
* @param hyperlink Whether to hyperlink the Discord profile specified by [id].
* Set this to false if you don't want to be spammed for support.
*/
fun author(name: String, id: Long = 0L, hyperlink: Boolean = true) =
authors.add(Author(name, id, hyperlink))

val links: Links = Links()

/**
* Set the source repository of this plugin.
* If you are not posting the source on Github, then [updateUrl] and [buildUrl] will need
* to be set manually to a compatible Github repository of builds.
* Otherwise, if [updateUrl] and [buildUrl] have not set yet, then they will be generated based on the supplied url.
*
* @param url A repository url like `https://github.com/Aliucord/plugins-template`
*/
fun github(url: String) {
links.github = url

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package com.aliucord.gradle.entities
data class Author(
val name: String,
val id: Long,
val hyperlink: Boolean,
)

class Links : HashMap<String?, String?>() {
Expand Down

0 comments on commit 5abb762

Please sign in to comment.