-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Will build your gradle project and archive the output jar files. | ||
name: Build and Archive Gradle Project | ||
|
||
# This action will run every time you push to the "main" branch. | ||
on: | ||
push: | ||
branches: | ||
- "main" | ||
|
||
jobs: | ||
build-and-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
- name: Checkout project sources | ||
uses: actions/checkout@v3 | ||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
- name: Run build with Gradle Wrapper | ||
run: ./gradlew build | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: build-outputs | ||
path: build/libs/*.jar |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Will simply build your gradle project. | ||
name: Build Gradle Project | ||
|
||
# This action will run every time you push to the "dev" branch. | ||
on: | ||
push: | ||
branches: | ||
- "dev" | ||
|
||
jobs: | ||
build-project: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
- name: Checkout project sources | ||
uses: actions/checkout@v3 | ||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
- name: Run build with Gradle Wrapper | ||
run: ./gradlew build |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
.gradle | ||
build/ | ||
!gradle/wrapper/gradle-wrapper.jar | ||
!**/src/main/**/build/ | ||
!**/src/test/**/build/ | ||
|
||
### IntelliJ IDEA ### | ||
.idea/modules.xml | ||
.idea/jarRepositories.xml | ||
.idea/compiler.xml | ||
.idea/libraries/ | ||
*.iws | ||
*.iml | ||
*.ipr | ||
out/ | ||
!**/src/main/**/out/ | ||
!**/src/test/**/out/ | ||
|
||
### Eclipse ### | ||
.apt_generated | ||
.classpath | ||
.factorypath | ||
.project | ||
.settings | ||
.springBeans | ||
.sts4-cache | ||
bin/ | ||
!**/src/main/**/bin/ | ||
!**/src/test/**/bin/ | ||
|
||
### NetBeans ### | ||
/nbproject/private/ | ||
/nbbuild/ | ||
/dist/ | ||
/nbdist/ | ||
/.nb-gradle/ | ||
|
||
### VS Code ### | ||
.vscode/ | ||
|
||
### Mac OS ### | ||
.DS_Store |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
||
plugins { | ||
kotlin("jvm") version "1.7.10" | ||
id("com.github.johnrengelman.shadow") version "7.0.0" | ||
id("org.ajoberstar.grgit") version "4.1.0" | ||
|
||
// Check for new versions at https://plugins.gradle.org/plugin/io.papermc.paperweight.userdev | ||
id("io.papermc.paperweight.userdev") version "1.7.1" | ||
`maven-publish` | ||
} | ||
|
||
group = project.properties["group"].toString() | ||
version = project.properties["version"].toString() | ||
val id: String by project | ||
|
||
val plugin_name: String by project | ||
val plugin_main_class_name: String by project | ||
val plugin_author: String by project | ||
val include_commit_hash: Boolean by project | ||
|
||
val ktgui_version: String by project | ||
val paper_version: String by project | ||
|
||
repositories { | ||
mavenCentral() | ||
maven("https://maven.pvphub.me") | ||
} | ||
|
||
dependencies { | ||
testImplementation(kotlin("test")) | ||
compileOnly(kotlin("stdlib")) | ||
|
||
compileOnly("com.mattmx:ktgui:${ktgui_version}") | ||
paperweight.paperDevBundle(paper_version) | ||
} | ||
|
||
tasks { | ||
withType<ProcessResources> { | ||
val props = mapOf( | ||
"name" to plugin_name, | ||
"main" to "${group}.${id}.${plugin_main_class_name}", | ||
"author" to plugin_author, | ||
"version" to if (include_commit_hash) "${rootProject.version}-commit-${grgit.head().abbreviatedId}" else rootProject.version.toString() | ||
) | ||
inputs.properties(props) | ||
filteringCharset = "UTF-8" | ||
filesMatching("plugin.yml") { | ||
expand(props) | ||
} | ||
} | ||
|
||
shadowJar { | ||
mergeServiceFiles() | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
} | ||
|
||
assemble { | ||
dependsOn("reobfJar") | ||
} | ||
|
||
withType<KotlinCompile> { | ||
kotlinOptions.jvmTarget = "17" | ||
} | ||
} | ||
|
||
java { | ||
withJavadocJar() | ||
withSourcesJar() | ||
} | ||
|
||
sourceSets["main"].resources.srcDir("src/resources/") | ||
|
||
kotlin { | ||
jvmToolchain(17) | ||
} | ||
|
||
publishing { | ||
repositories { | ||
maven { | ||
name = "pvphub-releases" | ||
url = uri("https://maven.pvphub.me/releases") | ||
credentials { | ||
username = System.getenv("PVPHUB_MAVEN_USERNAME") | ||
password = System.getenv("PVPHUB_MAVEN_SECRET") | ||
} | ||
} | ||
} | ||
publications { | ||
create<MavenPublication>(id) { | ||
from(components["java"]) | ||
groupId = group | ||
artifactId = id | ||
version = rootProject.version.toString() | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
kotlin.code.style=official | ||
|
||
# Project configuration | ||
group = "com.mattmx" | ||
id = "template" | ||
version = "1.0" | ||
|
||
plugin_name = "Template" | ||
plugin_main_class_name = "TemplatePlugin" | ||
plugin_author = "MattMX" | ||
|
||
include_commit_hash = true | ||
|
||
# Dependenices | ||
paper_version = "1.20.4-R0.1-SNAPSHOT" | ||
ktgui_version = "2.3.2" |
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-8.2-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |