-
Notifications
You must be signed in to change notification settings - Fork 2
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
0 parents
commit 319ed97
Showing
30 changed files
with
1,482 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
tab_width = 4 | ||
max_line_length = 120 | ||
insert_final_newline = true | ||
|
||
[*.gradle] | ||
indent_style = tab | ||
|
||
[*.kt] | ||
indent_style = tab | ||
ij_kotlin_name_count_to_use_star_import = 99999 | ||
ij_kotlin_name_count_to_use_star_import_for_members = 99999 | ||
|
||
[*.properties] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.toml] | ||
indent_style = tab | ||
|
||
[.editorconfig] | ||
indent_style = tab | ||
indent_size = 4 |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
*.bat text eol=CRLF |
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull-request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
check-api: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Check API | ||
run: ./gradlew clean apiCheck | ||
|
||
build: | ||
needs: check-api | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: 17 | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Build Artifacts | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
arguments: build --stacktrace |
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
# gradle | ||
|
||
.gradle/ | ||
build/ | ||
out/ | ||
classes/ | ||
|
||
# eclipse | ||
|
||
*.launch | ||
|
||
# idea | ||
|
||
.idea/ | ||
*.iml | ||
*.ipr | ||
*.iws | ||
|
||
# vscode | ||
|
||
.settings/ | ||
.vscode/ | ||
bin/ | ||
.classpath | ||
.project | ||
|
||
# macos | ||
|
||
*.DS_Store |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Copyright (c) 2022 HyacinthBots <[email protected]> | ||
|
||
This file is part of doc-generator. | ||
|
||
Licensed under the MIT license. For more information, | ||
please see the LICENSE file or https://mit-license.org/ |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2022 HyacinthBots <[email protected]> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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 |
---|---|---|
@@ -0,0 +1,73 @@ | ||
public abstract interface annotation class org/hyacinthbots/docgenerator/annotations/ConfigurationBuilderDSL : java/lang/annotation/Annotation { | ||
} | ||
|
||
public class org/hyacinthbots/docgenerator/builder/ConfigurationBuilder { | ||
public field commandTypes Ljava/util/List; | ||
public field environment Ljava/lang/String; | ||
public field fileFormat Lorg/hyacinthbots/docgenerator/enums/SupportedFileFormat; | ||
public field fileOutputLocation Ljava/nio/file/Path; | ||
public fun <init> ()V | ||
public fun getCommandTypes ()Ljava/util/List; | ||
public fun getEnabled ()Z | ||
public fun getEnvironment ()Ljava/lang/String; | ||
public fun getFileFormat ()Lorg/hyacinthbots/docgenerator/enums/SupportedFileFormat; | ||
public fun getFileOutputLocation ()Ljava/nio/file/Path; | ||
public final fun getTranslationSupport ()Lorg/hyacinthbots/docgenerator/builder/TranslationSupportConfigurationBuilder; | ||
public fun setCommandTypes (Ljava/util/List;)V | ||
public fun setEnabled (Z)V | ||
public fun setEnvironment (Ljava/lang/String;)V | ||
public fun setFileFormat (Lorg/hyacinthbots/docgenerator/enums/SupportedFileFormat;)V | ||
public fun setFileOutputLocation (Ljava/nio/file/Path;)V | ||
public final fun translationSupport (Lkotlin/jvm/functions/Function1;)V | ||
} | ||
|
||
public class org/hyacinthbots/docgenerator/builder/TranslationSupportConfigurationBuilder { | ||
public fun <init> ()V | ||
public fun getBaseLanguage ()Ljava/util/Locale; | ||
public fun getSupportTranslations ()Z | ||
public fun getSupportedLanguages ()Ljava/util/List; | ||
public fun setBaseLanguage (Ljava/util/Locale;)V | ||
public fun setSupportTranslations (Z)V | ||
public fun setSupportedLanguages (Ljava/util/List;)V | ||
} | ||
|
||
public final class org/hyacinthbots/docgenerator/builder/_docGeneratorKt { | ||
public static final fun docsGenerator (Lcom/kotlindiscord/kord/extensions/builders/ExtensibleBotBuilder;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; | ||
} | ||
|
||
public final class org/hyacinthbots/docgenerator/enums/CommandTypes : java/lang/Enum { | ||
public static final field MESSAGE Lorg/hyacinthbots/docgenerator/enums/CommandTypes; | ||
public static final field SLASH Lorg/hyacinthbots/docgenerator/enums/CommandTypes; | ||
public static final field USER Lorg/hyacinthbots/docgenerator/enums/CommandTypes; | ||
public static fun valueOf (Ljava/lang/String;)Lorg/hyacinthbots/docgenerator/enums/CommandTypes; | ||
public static fun values ()[Lorg/hyacinthbots/docgenerator/enums/CommandTypes; | ||
} | ||
|
||
public final class org/hyacinthbots/docgenerator/enums/Environment : java/lang/Enum { | ||
public static final field DEVELOPMENT Lorg/hyacinthbots/docgenerator/enums/Environment; | ||
public static final field PRODUCTION Lorg/hyacinthbots/docgenerator/enums/Environment; | ||
public final fun getValue ()Ljava/lang/String; | ||
public static fun valueOf (Ljava/lang/String;)Lorg/hyacinthbots/docgenerator/enums/Environment; | ||
public static fun values ()[Lorg/hyacinthbots/docgenerator/enums/Environment; | ||
} | ||
|
||
public final class org/hyacinthbots/docgenerator/enums/SupportedFileFormat : java/lang/Enum { | ||
public static final field MARKDOWN Lorg/hyacinthbots/docgenerator/enums/SupportedFileFormat; | ||
public static final field TEXT Lorg/hyacinthbots/docgenerator/enums/SupportedFileFormat; | ||
public final fun getFileExtension ()Ljava/lang/String; | ||
public static fun valueOf (Ljava/lang/String;)Lorg/hyacinthbots/docgenerator/enums/SupportedFileFormat; | ||
public static fun values ()[Lorg/hyacinthbots/docgenerator/enums/SupportedFileFormat; | ||
} | ||
|
||
public final class org/hyacinthbots/docgenerator/excpetions/ConflictingFileFormatException : java/lang/Exception { | ||
public fun <init> (Ljava/lang/String;Ljava/lang/String;)V | ||
} | ||
|
||
public final class org/hyacinthbots/docgenerator/excpetions/InvalidEnvironmentVariableException : java/lang/Exception { | ||
public fun <init> (Ljava/lang/String;Ljava/lang/String;)V | ||
} | ||
|
||
public class org/hyacinthbots/gradle/docgenerator/GeneratorGradlePlugin { | ||
public fun <init> ()V | ||
} | ||
|
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 |
---|---|---|
@@ -0,0 +1,135 @@ | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
||
plugins { | ||
`java-library` | ||
`maven-publish` | ||
`java-gradle-plugin` | ||
|
||
kotlin("jvm") | ||
|
||
id("io.gitlab.arturbosch.detekt") | ||
id("com.github.jakemarsden.git-hooks") | ||
id("org.cadixdev.licenser") | ||
|
||
id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.11.1" | ||
} | ||
|
||
group = "org.hyacinthbots" | ||
version = "0.1.0" | ||
val javaVersion = 17 | ||
|
||
repositories { | ||
mavenCentral() | ||
|
||
maven { | ||
name = "Kotlin Discord" | ||
url = uri("https://maven.kotlindiscord.com/repository/maven-public/") | ||
} | ||
|
||
maven { | ||
name = "Sonatype Snapshots" | ||
url = uri("https://oss.sonatype.org/content/repositories/snapshots") | ||
} | ||
} | ||
|
||
dependencies { | ||
detektPlugins(libs.detekt) | ||
|
||
implementation(libs.kotlin.stdlib) | ||
implementation(libs.kordex) | ||
|
||
implementation(libs.logging) | ||
|
||
api(libs.jetbrains.annotations) | ||
|
||
testImplementation(kotlin("test")) | ||
} | ||
|
||
gitHooks { | ||
setHooks( | ||
mapOf("pre-commit" to "clean apiCheck updateLicense detekt") | ||
) | ||
} | ||
|
||
gradlePlugin { | ||
plugins { | ||
create("doc-generator") { | ||
id = "org.hyacinthbots.gradle.docgenerator" | ||
implementationClass = "org.hyacinthbots.gradle.docgenerator.GeneratorGradlePlugin" | ||
} | ||
} | ||
} | ||
|
||
kotlin { | ||
explicitApi() | ||
jvmToolchain(javaVersion) | ||
} | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.toVersion(javaVersion) | ||
targetCompatibility = JavaVersion.toVersion(javaVersion) | ||
|
||
withSourcesJar() | ||
} | ||
|
||
val sourceJar = task("sourceJar", Jar::class) { | ||
dependsOn(tasks["classes"]) | ||
archiveClassifier.set("source") | ||
from(sourceSets.main.get().allSource) | ||
} | ||
|
||
val javadoc = task("javadocJar", Jar::class) { | ||
archiveClassifier.set("javadoc") | ||
from(tasks.javadoc) | ||
from(tasks.javadoc) | ||
} | ||
|
||
tasks { | ||
test { | ||
useJUnitPlatform() | ||
} | ||
|
||
withType<KotlinCompile> { | ||
kotlinOptions { | ||
jvmTarget = javaVersion.toString() | ||
languageVersion = "1.7" | ||
incremental = true | ||
freeCompilerArgs = freeCompilerArgs + listOf( | ||
"-opt-in=kotlin.RequiresOptIn" | ||
) | ||
} | ||
} | ||
|
||
withType<JavaCompile> { | ||
options.encoding = "UTF-8" | ||
options.isDeprecation = true | ||
options.release.set(javaVersion) | ||
} | ||
|
||
wrapper { | ||
gradleVersion = "7.6" | ||
distributionType = Wrapper.DistributionType.ALL | ||
} | ||
} | ||
|
||
detekt { | ||
buildUponDefaultConfig = true | ||
config = files("$rootDir/detekt.yml") | ||
|
||
autoCorrect = true | ||
} | ||
|
||
license { | ||
setHeader(rootProject.file("HEADER")) | ||
include("**/*.kt", "**/*.java") | ||
} | ||
|
||
publishing { | ||
publications { | ||
create<MavenPublication>("publishToMavenLocal") { | ||
from(components.getByName("java")) | ||
artifact(javadoc) | ||
artifact(sourceJar) | ||
} | ||
} | ||
} |
Oops, something went wrong.