Skip to content

Commit

Permalink
✨ add base plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
jerembdn committed Jan 16, 2024
0 parents commit 7d1844c
Show file tree
Hide file tree
Showing 25 changed files with 720 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="bin/main" path="src/main/java">
<attributes>
<attribute name="gradle_scope" value="main"/>
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="bin/main" path="src/main/resources">
<attributes>
<attribute name="gradle_scope" value="main"/>
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17/"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="output" path="bin/default"/>
</classpath>
9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# Linux start script should use lf
/gradlew text eol=lf

# These are Windows script files and should use crlf
*.bat text eol=crlf

40 changes: 40 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle

name: Java CI with Gradle

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

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

- name: Test & Lint with Gradle
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0
with:
arguments: test

- name: Build with Gradle
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0
with:
arguments: shadowJar --scan
21 changes: 21 additions & 0 deletions .github/workflows/wrapper-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "Validate Gradle Wrapper"

on:
push:
paths:
- 'gradlew'
- 'gradlew.bat'
- 'gradle/wrapper/'
pull_request:
paths:
- 'gradlew'
- 'gradlew.bat'
- 'gradle/wrapper/'

jobs:
validation:
name: "Validation"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: gradle/wrapper-validation-action@v1
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ignore Gradle project-specific cache directory
.gradle

# Ignore Gradle build output directory
build
34 changes: 34 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>folia-survival</name>
<comment>Project folia-survival created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
<filteredResources>
<filter>
<id>0</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
13 changes: 13 additions & 0 deletions .settings/org.eclipse.buildship.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
arguments=--init-script /home/jijon/.vscode-server/data/User/globalStorage/stripe.vscode-stripe/2.0.14/config_linux/org.eclipse.osgi/51/0/.cp/gradle/init/init.gradle --init-script /home/jijon/.vscode-server/data/User/globalStorage/stripe.vscode-stripe/2.0.14/config_linux/org.eclipse.osgi/51/0/.cp/gradle/protobuf/init.gradle
auto.sync=false
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=
java.home=/usr/lib/jvm/java-17-openjdk-amd64
jvm.arguments=
offline.mode=false
override.workspace.settings=true
show.console.view=true
show.executions.view=true
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
7 changes: 7 additions & 0 deletions bin/main/plugin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: ViewingParty
version: "1.0"

main: fr.thegreensuits.viewing_party.Main

api: "1.18.2"
api-version: 1.18
104 changes: 104 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
buildscript {
repositories {
mavenCentral()
mavenLocal()

maven {
url 'https://plugins.gradle.org/m2/'
}
}

dependencies {
classpath 'com.github.johnrengelman:shadow:8.1.1'
}
}

plugins {
//id 'com.github.spotless-java' version '6.22.0'
id 'java'
}

group 'fr.thegreensuits'
version '1.0'

def targetJavaVersion = 17
java {
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
}

apply plugin: 'com.github.johnrengelman.shadow'
apply from: rootProject.file('install-git-hooks.gradle')

compileJava.options.encoding = 'UTF-8'

repositories {
mavenCentral()
mavenLocal()

maven {
url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'

content {
includeGroup 'org.spigotmc'
}
}
}

dependencies {
// - Minecraft
shadow group: 'org.spigotmc', name: 'spigot-api', version: '1.18.2-R0.1-SNAPSHOT'
//shadow group: 'org.spigotmc', name: 'spigot', version: '1.18.2-R0.1-SNAPSHOT'

// - Utilities
implementation group: 'org.projectlombok', name: 'lombok', version: '1.18.22'
annotationProcessor group: 'org.projectlombok', name: 'lombok', version: '1.18.22'

// - Tests
testImplementation group: 'org.projectlombok', name: 'lombok', version: '1.18.22'
testAnnotationProcessor group: 'org.projectlombok', name: 'lombok', version: '1.18.22'
}

tasks.withType(JavaCompile).configureEach {
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
options.release = targetJavaVersion
}
}

processResources {
def props = [version: version]
inputs.properties props
filteringCharset 'UTF-8'
filesMatching('plugin.yml') {
expand props
}
}

/* spotless {
format 'misc', {
target '*.gradle', '*.md', '.gitignore'
trimTrailingWhitespace()
indentWithSpaces(4)
endWithNewline()
setEncoding('utf-8')
}
java {
importOrder()
removeUnusedImports()
googleJavaFormat()
formatAnnotations()
trimTrailingWhitespace()
indentWithSpaces(4)
endWithNewline()
setEncoding('utf-8')
}
} */
7 changes: 7 additions & 0 deletions commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

echo "Starting spotless linter..."

./gradlew spotlessApply

echo "Spotless ran successfully!"
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.4-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 7d1844c

Please sign in to comment.