Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/gabber235/TypeWriter int…
Browse files Browse the repository at this point in the history
…o develop
  • Loading branch information
Marten-Mrfc committed Feb 29, 2024
2 parents 0549165 + 5413850 commit d21009a
Show file tree
Hide file tree
Showing 20 changed files with 517 additions and 1,125 deletions.
8 changes: 4 additions & 4 deletions .github/actions/build-adapter/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ runs:
- name: Test Adapter
uses: gradle/gradle-build-action@v2
with:
arguments: test --scan
build-root-directory: ./adapters/${{ inputs.adapter }}
arguments: :${{ inputs.adapter }}:test --scan
build-root-directory: ./adapters
- name: Build Adapter
uses: gradle/gradle-build-action@v2
with:
arguments: buildRelease --scan
build-root-directory: ./adapters/${{ inputs.adapter }}
arguments: :${{ inputs.adapter }}:buildRelease --scan
build-root-directory: ./adapters

107 changes: 2 additions & 105 deletions adapters/BasicAdapter/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,105 +1,2 @@
import org.jetbrains.kotlin.util.capitalizeDecapitalize.capitalizeAsciiOnly

plugins {
kotlin("jvm") version "1.9.22"
id("com.github.johnrengelman.shadow") version "8.1.1"
}

group = "me.gabber235"
version = file("../../version.txt").readText().trim()

repositories {
// Required
maven("https://jitpack.io")
mavenCentral()
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
maven("https://oss.sonatype.org/content/groups/public/")
maven("https://libraries.minecraft.net/")
maven { url = uri("https://repo.papermc.io/repository/maven-public/") }
// PacketEvents
maven("https://repo.codemc.io/repository/maven-releases/")
// Anvil GUI (Sub dependency of LirandAPI)
maven("https://repo.codemc.io/repository/maven-snapshots/")
maven("https://repo.opencollab.dev/maven-snapshots/")
}

dependencies {
compileOnly(kotlin("stdlib"))
compileOnly("io.papermc.paper:paper-api:1.20.4-R0.1-SNAPSHOT")

compileOnly("com.github.gabber235:typewriter:$version")

// Already included in the TypeWriter plugin
compileOnly("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.0-RC")
compileOnly("com.github.dyam0:LirandAPI:96cc59d4fb")
compileOnly("com.github.Tofaa2.EntityLib:spigot:2.0.8-SNAPSHOT")
compileOnly("net.kyori:adventure-api:4.15.0")
compileOnly("net.kyori:adventure-text-minimessage:4.15.0")

// External dependencies
compileOnly("org.geysermc.floodgate:api:2.2.0-SNAPSHOT")

testImplementation(kotlin("test"))
}

tasks.test {
useJUnitPlatform()
}

val targetJavaVersion = 17
java {
val javaVersion = JavaVersion.toVersion(targetJavaVersion)
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
toolchain.languageVersion.set(JavaLanguageVersion.of(targetJavaVersion))
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = "$targetJavaVersion"
}
}

val copyTemplates by tasks.registering(Copy::class) {
filteringCharset = "UTF-8"
from(projectDir.resolve("src/main/templates")) {
expand("version" to version)
}
into(buildDir.resolve("generated-sources/templates/kotlin/main"))
}

sourceSets {
main {
java.srcDirs(copyTemplates)
}
}


task<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar>("buildAndMove") {
dependsOn("shadowJar")

group = "build"
description = "Builds the jar and moves it to the server folder"
outputs.upToDateWhen { false }

// Move the jar from the build/libs folder to the server/plugins folder
doLast {
val jar = file("build/libs/%s-%s-all.jar".format(project.name, project.version))
val server =
file("../../plugin/server/plugins/Typewriter/adapters/%s.jar".format(project.name.capitalizeAsciiOnly()))
jar.copyTo(server, overwrite = true)
}
}

task<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar>("buildRelease") {
dependsOn("shadowJar")
group = "build"
description = "Builds the jar and renames it"

doLast {
// Rename the jar to remove the version and -all
val jar = file("build/libs/%s-%s-all.jar".format(project.name, project.version))
jar.renameTo(file("build/libs/%s.jar".format(project.name)))
file("build/libs/%s-%s.jar".format(project.name, project.version)).delete()
}
}
repositories { }
dependencies { }
99 changes: 0 additions & 99 deletions adapters/CitizensAdapter/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,109 +1,10 @@
import org.jetbrains.kotlin.util.capitalizeDecapitalize.capitalizeAsciiOnly

plugins {
kotlin("jvm") version "1.9.22"
id("com.github.johnrengelman.shadow") version "8.1.1"
}

group = "me.gabber235"
version = file("../../version.txt").readText().trim()

repositories {
// Required
maven("https://jitpack.io")
mavenCentral()
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
maven("https://oss.sonatype.org/content/groups/public/")
maven("https://libraries.minecraft.net/")
maven { url = uri("https://repo.papermc.io/repository/maven-public/") }
maven("https://repo.codemc.io/repository/maven-snapshots/")
maven("https://repo.opencollab.dev/maven-snapshots/")

// Adapter Specific
maven("https://repo.citizensnpcs.co/")
}

dependencies {
compileOnly(kotlin("stdlib"))
compileOnly("io.papermc.paper:paper-api:1.20.4-R0.1-SNAPSHOT")

compileOnly("com.github.gabber235:typewriter:$version")

// Already included in the TypeWriter plugin
compileOnly("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.0-RC")
compileOnly("com.github.dyam0:LirandAPI:96cc59d4fb")
compileOnly("net.kyori:adventure-api:4.15.0")
compileOnly("net.kyori:adventure-text-minimessage:4.15.0")
compileOnly("io.insert-koin:koin-core:3.4.0")

// External dependencies
compileOnly("net.citizensnpcs:citizens-main:2.0.33-SNAPSHOT") {
exclude(group = "*", module = "*")
}

testImplementation(kotlin("test"))
}

tasks.test {
useJUnitPlatform()
}

val targetJavaVersion = 17
java {
val javaVersion = JavaVersion.toVersion(targetJavaVersion)
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
toolchain.languageVersion.set(JavaLanguageVersion.of(targetJavaVersion))
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = "$targetJavaVersion"
}
}

val copyTemplates by tasks.registering(Copy::class) {
filteringCharset = "UTF-8"
from(projectDir.resolve("src/main/templates")) {
expand("version" to version)
}
into(buildDir.resolve("generated-sources/templates/kotlin/main"))
}

sourceSets {
main {
java.srcDirs(copyTemplates)
}
}

task<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar>("buildAndMove") {
dependsOn("shadowJar")

group = "build"
description = "Builds the jar and moves it to the server folder"
outputs.upToDateWhen { false }

// Move the jar from the build/libs folder to the server/plugins folder
doLast {
val jar = file("build/libs/%s-%s-all.jar".format(project.name, project.version))
val server =
file("../../plugin/server/plugins/Typewriter/adapters/%s.jar".format(project.name.capitalizeAsciiOnly()))
jar.copyTo(server, overwrite = true)
}
}

task<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar>("buildRelease") {
dependsOn("shadowJar")
group = "build"
description = "Builds the jar and renames it"

doLast {
// Rename the jar to remove the version and -all
val jar = file("build/libs/%s-%s-all.jar".format(project.name, project.version))
if (!jar.exists()) {
throw IllegalStateException("Jar does not exist: ${jar.absolutePath}")
}
jar.renameTo(file("build/libs/%s.jar".format(project.name)))
file("build/libs/%s-%s.jar".format(project.name, project.version)).delete()
}
}
97 changes: 0 additions & 97 deletions adapters/CombatLogXAdapter/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,105 +1,8 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar

plugins {
kotlin("jvm") version "1.9.22"
id("com.github.johnrengelman.shadow") version "8.1.1"
}

group = "me.caleb"
version = file("../../version.txt").readText().trim()

repositories {
// Required
maven("https://jitpack.io")
mavenCentral()
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
maven("https://oss.sonatype.org/content/groups/public/")
maven("https://libraries.minecraft.net/")
maven { url = uri("https://repo.papermc.io/repository/maven-public/") }
maven("https://repo.codemc.io/repository/maven-snapshots/")
maven("https://repo.opencollab.dev/maven-snapshots/")

// Adapter Specific
maven("https://nexus.sirblobman.xyz/public/")
}

dependencies {
compileOnly(kotlin("stdlib"))
compileOnly("io.papermc.paper:paper-api:1.20.4-R0.1-SNAPSHOT")

compileOnly("com.github.gabber235:typewriter:$version")

// Already included in the TypeWriter plugin
compileOnly("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.0-RC")
compileOnly("com.github.dyam0:LirandAPI:96cc59d4fb")
compileOnly("net.kyori:adventure-api:4.15.0")
compileOnly("net.kyori:adventure-text-minimessage:4.15.0")

// External dependencies
compileOnly("com.github.sirblobman.api:core:2.9-SNAPSHOT")
compileOnly("com.github.sirblobman.combatlogx:api:11.4-SNAPSHOT")
}

tasks.test {
useJUnitPlatform()
}

val targetJavaVersion = 17
java {
val javaVersion = JavaVersion.toVersion(targetJavaVersion)
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
toolchain.languageVersion.set(JavaLanguageVersion.of(targetJavaVersion))
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = "$targetJavaVersion"
}
}

val copyTemplates by tasks.registering(Copy::class) {
filteringCharset = "UTF-8"
from(projectDir.resolve("src/main/templates")) {
expand("version" to version)
}
into(buildDir.resolve("generated-sources/templates/kotlin/main"))
}

sourceSets {
main {
java.srcDirs(copyTemplates)
}
}

task<ShadowJar>("buildAndMove") {
dependsOn("shadowJar")

group = "build"
description = "Builds the jar and moves it to the server folder"
outputs.upToDateWhen { false }

// Move the jar from the build/libs folder to the server/plugins folder
doLast {
val jar = file("build/libs/%s-%s-all.jar".format(project.name, project.version))
val server =
file("../../plugin/server/plugins/Typewriter/adapters/%s.jar".format(project.name))
jar.copyTo(server, overwrite = true)
}
}

task<ShadowJar>("buildRelease") {
dependsOn("shadowJar")
group = "build"
description = "Builds the jar and renames it"

doLast {
// Rename the jar to remove the version and -all
val jar = file("build/libs/%s-%s-all.jar".format(project.name, project.version))
if (!jar.exists()) {
throw IllegalStateException("Jar does not exist: ${jar.absolutePath}")
}
jar.renameTo(file("build/libs/%s.jar".format(project.name)))
file("build/libs/%s-%s.jar".format(project.name, project.version)).delete()
}
}
Loading

0 comments on commit d21009a

Please sign in to comment.