Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Gradle. #5

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Java CI

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
# Un-comment this part of the configuration if you want the artifacts to be uploaded automatically (delete this line as well)
#
# - name: Upload result
# uses: actions/upload-artifact@v2
# with:
# name: Addon-Template # Change the name to your plugin name or anything you want
# path: build/libs
23 changes: 0 additions & 23 deletions .github/workflows/maven.yml

This file was deleted.

123 changes: 116 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,118 @@
/bin/
/.settings/
/target/
/.idea/
# User-specific stuff
.idea/

*.iml
.project
.classpath
dependency-reduced-pom.xml
*.ipr
*.iws

# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

.gradle
build/

# Ignore Gradle GUI config
gradle-app.setting

# Cache of project
.gradletasknamecache

**/build/

# Common working directory
run/

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Slimefun4 Addon
This is an example Repository for a generic Slimefun4 Addon.
This is an example Repository for a generic Slimefun4 Addon using Gradle.
In the top left is a button "Use this template", click this to create your own Addon for Slimefun4 using this basic template.

## How to create your own addon.
Expand All @@ -15,6 +15,8 @@ Example: "me.thebusybiscuit.cooladdon" and "CoolAddon.java"
Navigate to `src/main/resources/plugin.yml` and change the "author" and "main" attributes.
You may also want to change the description to something meaningful.

Navigate to `pom.xml` and change the group id to "me.%Your name%" and change the artifact id to the name of your Project.
Navigate to `build.gradle` and change the group id to "me.%Your name%".

Navigate to `settings.gradle` and change the value in `rootProject.name` to your GitHub repository name

After that you are good to go, you can now start developing your own Addon for Slimefun4.
42 changes: 42 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import org.apache.tools.ant.filters.ReplaceTokens

plugins {
id 'java'
}

group = 'me.CHANGEME'

sourceCompatibility = '1.8'
targetCompatibility = '1.8'

compileJava.options.encoding = "UTF-8"
compileTestJava.options.encoding = "UTF-8"

repositories {
mavenCentral()
maven {
name = 'papermc-repo'
url = 'https://papermc.io/repo/repository/maven-public/'
}
maven {
name = 'spigot-repo'
url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
}
maven {
name = 'jitpack.io'
url = 'https://jitpack.io'
}
}

dependencies {
implementation 'org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT' // Comment this line of code if you would like the plugin to be based on Paper's API
// implementation 'com.destroystokyo.paper:paper-api:1.16.5-R0.1-SNAPSHOT' // Uncomment this line of code if you would like the plugin to be based on Paper's API
implementation 'com.github.Slimefun:Slimefun4:master-SNAPSHOT' // This downloads the latest version from github & compiles it, if you want to use a more stable version, please modify the last part of it where it says master-SNAPSHOT to a tag like RC-21
}

processResources {
from(sourceSets.main.resources.srcDirs) {
filter ReplaceTokens, tokens: [version: version]
}
}

2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
systemProp.file.encoding=utf-8
version = '1.0.0'
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading