Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
darksaid98 committed Jul 4, 2023
0 parents commit 02574d5
Show file tree
Hide file tree
Showing 14 changed files with 1,125 additions and 0 deletions.
435 changes: 435 additions & 0 deletions .editorconfig

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build & Upload Release jar with Gradle

on:
release:
types: [ published ]

jobs:
upload_asset:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1

- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'

- name: Build with Gradle
run: ./gradlew clean build --no-daemon

- name: Upload Release Assets
uses: AButler/[email protected]
with:
files: 'build/libs/ExamplePlugin-*.jar'
repo-token: ${{ secrets.GITHUB_TOKEN }}
release-tag: ${{ github.event.release.tag_name }}
86 changes: 86 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
##############################
## Java
##############################
.mtj.tmp/
*.class
*.jar
*.oldWar
*.ear
*.nar
hs_err_pid*
replay_pid*

##############################
## Maven
##############################
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
pom.xml.bak
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar

##############################
## Gradle
##############################
bin/
build/
.gradle
.gradletasknamecache
gradle-app.setting
!gradle-wrapper.jar

##############################
## IntelliJ
##############################
out/
.idea/
.idea_modules/
*.iml
*.ipr
*.iws

##############################
## Eclipse
##############################
.settings/
bin/
tmp/
.metadata
.classpath
.project
*.tmp
*.bak
*.swp
*~.nib
local.properties
.loadpath
.factorypath

##############################
## NetBeans
##############################
nbproject/private/
build/
nbbuild/
dist/
nbdist/
nbactions.xml
nb-configuration.xml

##############################
## Visual Studio Code
##############################
.vscode/
.code-workspace

##############################
## OS X
##############################
.DS_Store
/run/
100 changes: 100 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
plugins {
`java-library`

id("com.github.johnrengelman.shadow") version "8.1.1" // Shades and relocates dependencies, See https://imperceptiblethoughts.com/shadow/introduction/
id("xyz.jpenilla.run-paper") version "2.1.0" // Adds runServer and runMojangMappedServer tasks for testing
id("net.minecrell.plugin-yml.bukkit") version "0.6.0" // Automatic plugin.yml generation
}

group = "com.github.ExampleUser.ExamplePlugin"
version = "1.0.0"
description = ""

java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17)) // Configure the java toolchain. This allows gradle to auto-provision JDK 17 on systems that only have JDK 8 installed for example.
}

repositories {
mavenCentral()

maven("https://papermc.io/repo/repository/maven-public/")

maven("https://jitpack.io/") {
content {
includeGroup("com.github.milkdrinkers")
}
}

maven("https://repo.codemc.org/repository/maven-public/") {
content { includeGroup("dev.jorel") }
}
}

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

compileOnly("org.jetbrains:annotations:24.0.1")

implementation("com.github.milkdrinkers:simplixstorage:3.2.7")
implementation("com.github.milkdrinkers:colorparser:1.0.7")

implementation("dev.jorel:commandapi-bukkit-shade:9.0.3")
compileOnly("dev.jorel:commandapi-annotations:9.0.3")
annotationProcessor("dev.jorel:commandapi-annotations:9.0.3")
}

tasks {
build {
dependsOn(shadowJar)
}

compileJava {
options.encoding = Charsets.UTF_8.name() // We want UTF-8 for everything

// Set the release flag. This configures what version bytecode the compiler will emit, as well as what JDK APIs are usable.
// See https://openjdk.java.net/jeps/247 for more information.
options.release.set(17)
options.compilerArgs.add("-Xlint:-deprecation")
}

processResources {
filteringCharset = Charsets.UTF_8.name() // We want UTF-8 for everything
}

shadowJar {
archiveBaseName.set(project.name)
archiveClassifier.set("")

// Shadow classes
// helper function to relocate a package into our package
fun reloc(originPkg: String, targetPkg: String) = relocate(originPkg, "${project.group}.${targetPkg}")

reloc("de.leonhard.storage", "storageapi")
reloc("com.github.milkdrinkers.colorparser", "colorparser")
reloc("dev.jorel.commandapi", "commandapi")
}

runServer {
// Configure the Minecraft version for our task.
minecraftVersion("1.20.1")
}
}

bukkit {
// Plugin main class (required)
main = "${project.group}.Main"

// Plugin Information
name = "${project.name}"
prefix = "${project.name}"
version = "${project.version}"
description = "${project.description}"
authors = listOf("AuthorName")
contributors = listOf("ContributorName")
apiVersion = "1.19"

// Misc properties
load = net.minecrell.pluginyml.bukkit.BukkitPluginDescription.PluginLoadOrder.POSTWORLD // STARTUP or POSTWORLD
depend = listOf()
softDepend = listOf()
}
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.2-rc-2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 02574d5

Please sign in to comment.