Skip to content

Commit

Permalink
Merge pull request #32 from sarhatabaot/gradle
Browse files Browse the repository at this point in the history
Port to gradle & update action
  • Loading branch information
sarhatabaot authored May 25, 2024
2 parents 670f2cd + cc044df commit 5e89c2f
Show file tree
Hide file tree
Showing 12 changed files with 486 additions and 221 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Java CI with Gradle (kotlin)

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'
- name: Build with Gradle
uses: gradle/gradle-build-action@585b565652cefbba63202a7f927df0ff99f34001
with:
arguments: build

dependency-submission:

runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v4
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'

# Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies.
# See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md
- name: Generate and submit dependency graph
uses: gradle/actions/dependency-submission@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0
26 changes: 0 additions & 26 deletions .github/workflows/maven.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ target
*.iml
sonar.txt
dependency-reduced-pom.xml

.gradle
build
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019-2022 Cyprias, sarhatabaot
Copyright (c) 2019-2024 Cyprias, sarhatabaot

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
69 changes: 69 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import net.minecrell.pluginyml.bukkit.BukkitPluginDescription

plugins {
java
alias(libs.plugins.shadow)
alias(libs.plugins.plugin.yml)
}
version = "4.3.5"
description = "Limit entities in chunks."


repositories {
mavenCentral()
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
maven("https://repo.codemc.org/repository/maven-public")
maven("https://repo.aikar.co/content/groups/aikar/")
}

dependencies {
compileOnly(libs.spigot.api)

implementation(libs.bstats)
implementation(libs.acf)
implementation(libs.annotations)
}

bukkit {
name = "ChunkSpawnerLimiter"
main = "com.cyprias.chunkspawnerlimiter.ChunkSpawnerLimiter"
version = project.version.toString()
apiVersion = "1.14"
authors = listOf("Cyprias", "sarhatabaot")
website = "https://github.com/Cyprias/ChunkSpawnerLimiter"
description = "Limit entities in chunks."
load = BukkitPluginDescription.PluginLoadOrder.POSTWORLD
prefix = "CSL"
}

tasks {
build {
dependsOn(shadowJar)
}

shadowJar {
minimize()

exclude("META-INF/**")

archiveFileName.set("chunkspawnerlimiter-${project.version}.jar")
archiveClassifier.set("shadow")

relocate("de.tr7zw.changeme.nbtapi", "com.cyprias.chunkspawnerlimiter.libs.nbt")
relocate("co.aikar.commands", "com.cyprias.chunkspawnerlimiter.libs.acf")
relocate("co.aikar.locales", "com.cyprias.chunkspawnerlimiter.libs.locales")
}

compileJava {
options.compilerArgs.add("-parameters")
options.isFork = true
options.encoding = "UTF-8"
}
}

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
vendor.set(JvmVendorSpec.ADOPTIUM)
}
}
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 5e89c2f

Please sign in to comment.