Skip to content

Commit

Permalink
feat: upgrade dependencies, improved build system
Browse files Browse the repository at this point in the history
  • Loading branch information
Cubxity committed Jun 13, 2021
1 parent 51554b0 commit efe13db
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 22 deletions.
15 changes: 15 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
*/

dependencies {
api(kotlin("stdlib-jdk8"))
api("com.uchuhimo", "konf-toml", "1.0.0")
api(kotlin("stdlib"))
api("com.uchuhimo", "konf-toml", "1.1.2")
}
15 changes: 5 additions & 10 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm") version "1.4.31"
kotlin("kapt") version "1.4.31"
id("com.github.johnrengelman.shadow") version "6.1.0" apply false
kotlin("jvm") version "1.5.10" apply false
kotlin("kapt") version "1.5.10" apply false
id("com.github.johnrengelman.shadow") version "7.0.0" apply false
id("net.kyori.blossom") version "1.3.0" apply false
}

allprojects {
group = "dev.cubxity.plugins"
description = "Fully featured metrics collector agent for Minecraft servers."
version = "0.2.1"
version = "0.3.0-SNAPSHOT"

repositories {
mavenCentral()
Expand All @@ -38,15 +38,10 @@ allprojects {
subprojects {
apply(plugin = "java")
apply(plugin = "kotlin")
apply(plugin = "kotlin-kapt")
apply(plugin = "com.github.johnrengelman.shadow")

tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "1.8"
}
}
tasks.withType<ShadowJar> {
archiveClassifier.set("")
}
}
14 changes: 11 additions & 3 deletions bukkit/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

import org.apache.tools.ant.filters.ReplaceTokens
plugins {
id("com.github.johnrengelman.shadow")
}

repositories {
maven("https://papermc.io/repo/repository/maven-public")
Expand All @@ -28,9 +30,15 @@ dependencies {
}

tasks {
shadowJar {
archiveClassifier.set("")
}
processResources {
duplicatesStrategy = DuplicatesStrategy.INCLUDE

from("src/main/resources") {
filter(ReplaceTokens::class, "tokens" to mapOf("version" to version))
expand("version" to version)
include("plugin.yml")
}
}
}
}
2 changes: 1 addition & 1 deletion bukkit/src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ main: dev.cubxity.plugins.metrics.bukkit.bootstrap.UnifiedMetricsBukkitBootstrap
description: "Fully-featured metrics plugin for Minecraft servers"
api-version: 1.16
author: Cubxity
version: @version@
version: ${version}
load: STARTUP
1 change: 0 additions & 1 deletion common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,4 @@

dependencies {
api(project(":unifiedmetrics-api"))
api("com.uchuhimo:konf-toml:1.0.0")
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
14 changes: 13 additions & 1 deletion velocity/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

plugins {
kotlin("kapt")
id("com.github.johnrengelman.shadow")
id("net.kyori.blossom")
}

repositories {
maven("https://nexus.velocitypowered.com/repository/maven-public/")
}
Expand All @@ -29,6 +35,12 @@ dependencies {

tasks {
shadowJar {
archiveClassifier.set("")
relocate("com.moandjiezana.toml", "dev.cubxity.plugins.metrics.lib.toml")
}
}
}

blossom {
replaceTokenIn("src/main/kotlin/dev/cubxity/plugins/metrics/velocity/bootstrap/UnifiedMetricsVelocityBootstrap.kt")
replaceToken("@version@", version)
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ import dev.cubxity.plugins.metrics.velocity.VelocitySchedulerAdapter
import dev.cubxity.plugins.metrics.velocity.logger.Slf4jLogger
import java.nio.file.Path

// TODO: Automatically replace this at build
private const val pluginVersion = "0.2.1"
private const val pluginVersion = "@version@"

@Plugin(
id = "unifiedmetrics",
Expand Down

0 comments on commit efe13db

Please sign in to comment.