-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
.
- Loading branch information
Showing
22 changed files
with
719 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text=auto eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
name-template: "$RESOLVED_VERSION" | ||
tag-template: "$RESOLVED_VERSION" | ||
prerelease: true | ||
template: | | ||
# What's Changed | ||
$CHANGES | ||
categories: | ||
- title: "Breaking" | ||
label: "breaking" | ||
- title: "New" | ||
label: "enhancement" | ||
- title: "Bug Fixes" | ||
label: "bug" | ||
- title: "Maintenance" | ||
label: "maintenance" | ||
- title: "Documentation" | ||
label: "documentation" | ||
- title: "Dependency Updates" | ||
label: "dependencies" | ||
version-resolver: | ||
major: | ||
labels: | ||
- "breaking" | ||
minor: | ||
labels: | ||
- "enhancement" | ||
patch: | ||
labels: | ||
- "bug" | ||
- "maintenance" | ||
- "documentation" | ||
- "dependencies" | ||
- "security" | ||
exclude-labels: | ||
- "skip-changelog" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
name: "Build" | ||
"on": | ||
pull_request: | ||
branches: | ||
- "master" | ||
jobs: | ||
build: | ||
name: "Build" | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: "actions/checkout@master" | ||
- uses: "actions/setup-java@master" | ||
with: | ||
distribution: "adopt" | ||
java-version: "11" | ||
- uses: "actions/cache@master" | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- run: | | ||
chmod +x gradlew | ||
./gradlew build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
name: "Update Changelog" | ||
"on": | ||
push: | ||
branches: | ||
- "master" | ||
jobs: | ||
changelog: | ||
name: "Update Changelog" | ||
runs-on: "ubuntu-latest" | ||
if: "${{ !contains(github.event.head_commit.message, 'skip-snapshot') }}" | ||
steps: | ||
- uses: "release-drafter/release-drafter@master" | ||
id: "release" | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
name: "Release" | ||
"on": | ||
release: | ||
types: | ||
- "released" | ||
jobs: | ||
build: | ||
name: "Release" | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: "actions/checkout@master" | ||
- uses: "actions/setup-java@master" | ||
with: | ||
distribution: "adopt" | ||
java-version: "11" | ||
- uses: "actions/cache@master" | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- run: | | ||
[[ "${{ github.event.release.tag_name }}" =~ ^[0-9]+(\.[0-9]+)*$ ]] || exit -1 | ||
chmod +x gradlew | ||
./gradlew -Psign-required=true publish -Pversion="${{ github.event.release.tag_name }}" -PmavenCentralUsername="${{ secrets.MAVEN_CENTRAL_USERNAME }}" -PmavenCentralPassword="${{ secrets.MAVEN_CENTRAL_PASSWORD }}" -PsigningInMemoryKey="${{ secrets.GPG_PRIVATE_KEY_ARMORED }}" -PsigningInMemoryKeyPassword="${{ secrets.GPG_PASSPHRASE }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,11 @@ | ||
# Compiled class file | ||
*.class | ||
|
||
# Log file | ||
*.log | ||
|
||
# BlueJ files | ||
*.ctxt | ||
|
||
# Mobile Tools for Java (J2ME) | ||
.mtj.tmp/ | ||
|
||
# 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* | ||
replay_pid* | ||
.idea/ | ||
target/ | ||
.gradle/ | ||
build/ | ||
*.iml | ||
*.project | ||
*.classpath | ||
.settings/ | ||
**/bin/ | ||
.vscode/ | ||
.kotlin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,19 @@ | ||
# frame | ||
An inventory framework for Minecraft. | ||
[![Maven Central Version](https://img.shields.io/maven-central/v/net.infumia/frame)](https://central.sonatype.com/artifact/net.infumia/frame) | ||
## How to Use (Developers) | ||
### Gradle | ||
```groovy | ||
repositories { | ||
mavenCentral() | ||
} | ||
dependencies { | ||
// Base module | ||
implementation "net.infumia:frame:VERSION" | ||
} | ||
``` | ||
### Code | ||
```kotlin | ||
fun main() { | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import net.infumia.gradle.applySpotless | ||
|
||
plugins { java } | ||
|
||
subprojects { apply<JavaPlugin>() } | ||
|
||
applySpotless() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
plugins { `kotlin-dsl` } | ||
|
||
repositories { | ||
mavenCentral() | ||
gradlePluginPortal() | ||
} | ||
|
||
dependencies { | ||
implementation(libs.nexus.plugin) | ||
implementation(libs.spotless.plugin) | ||
} | ||
|
||
kotlin { | ||
jvmToolchain { | ||
languageVersion = JavaLanguageVersion.of(11) | ||
vendor = JvmVendorSpec.ADOPTIUM | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
plugins { id("org.gradle.toolchains.foojay-resolver-convention") } | ||
|
||
dependencyResolutionManagement { | ||
versionCatalogs { create("libs") { from(files("../gradle/libs.versions.toml")) } } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package net.infumia.gradle | ||
|
||
import org.gradle.api.Project | ||
import org.gradle.api.plugins.JavaPlugin | ||
import org.gradle.api.plugins.JavaPluginExtension | ||
import org.gradle.jvm.toolchain.JavaLanguageVersion | ||
import org.gradle.jvm.toolchain.JvmVendorSpec | ||
import org.gradle.kotlin.dsl.* | ||
|
||
fun Project.applyJava(javaVersion: Int = 8) { | ||
apply<JavaPlugin>() | ||
|
||
repositories.mavenCentral() | ||
|
||
extensions.configure<JavaPluginExtension> { | ||
toolchain { | ||
languageVersion = JavaLanguageVersion.of(javaVersion) | ||
vendor = JvmVendorSpec.ADOPTIUM | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package net.infumia.gradle | ||
|
||
import com.vanniktech.maven.publish.MavenPublishBaseExtension | ||
import com.vanniktech.maven.publish.MavenPublishPlugin | ||
import com.vanniktech.maven.publish.SonatypeHost | ||
import com.vanniktech.maven.publish.tasks.JavadocJar | ||
import org.gradle.api.Project | ||
import org.gradle.api.plugins.JavaPluginExtension | ||
import org.gradle.api.tasks.bundling.Jar | ||
import org.gradle.kotlin.dsl.* | ||
|
||
fun Project.applyPublish(moduleName: String? = null, javaVersion: Int = 8) { | ||
applyJava(javaVersion) | ||
apply<MavenPublishPlugin>() | ||
|
||
val projectName = "${rootProject.name}${if (moduleName == null) "" else "-$moduleName"}" | ||
val signRequired = project.hasProperty("sign-required") | ||
|
||
val sourceSets = extensions.getByType<JavaPluginExtension>().sourceSets | ||
tasks.register("sourcesJar", Jar::class) { | ||
dependsOn("classes") | ||
archiveClassifier = "sources" | ||
from(sourceSets["main"].allSource) | ||
} | ||
|
||
tasks.withType<JavadocJar> { afterEvaluate { archiveBaseName = name } } | ||
|
||
extensions.configure<MavenPublishBaseExtension> { | ||
coordinates(project.group.toString(), projectName, project.version.toString()) | ||
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, true) | ||
if (signRequired) { | ||
signAllPublications() | ||
} | ||
|
||
pom { | ||
name = projectName | ||
description = "An inventory framework for Minecraft." | ||
url = "https://github.com/Infumia/frame" | ||
licenses { | ||
license { | ||
name = "MIT License" | ||
url = "https://mit-license.org/license.txt" | ||
} | ||
} | ||
developers { | ||
developer { | ||
id = "portlek" | ||
name = "Hasan Demirtaş" | ||
email = "[email protected]" | ||
} | ||
} | ||
scm { | ||
connection = "scm:git:git://github.com/infumia/frame.git" | ||
developerConnection = "scm:git:ssh://github.com/infumia/frame.git" | ||
url = "https://github.com/infumia/frame/" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
package net.infumia.gradle | ||
|
||
import com.diffplug.gradle.spotless.SpotlessExtension | ||
import com.diffplug.gradle.spotless.SpotlessPlugin | ||
import com.diffplug.spotless.LineEnding | ||
import org.gradle.api.Project | ||
import org.gradle.kotlin.dsl.* | ||
|
||
fun Project.applySpotless() { | ||
val subProjects = subprojects.map { it.projectDir.toRelativeString(projectDir) } | ||
|
||
repositories.mavenCentral() | ||
|
||
apply<SpotlessPlugin>() | ||
|
||
extensions.configure<SpotlessExtension> { | ||
isEnforceCheck = false | ||
lineEndings = LineEnding.UNIX | ||
|
||
val prettierConfig = | ||
mapOf( | ||
"prettier" to "3.3.2", | ||
"prettier-plugin-java" to "2.6.0", | ||
"prettier-plugin-toml" to "2.0.1", | ||
) | ||
|
||
yaml { | ||
target(".github/**/*.yml") | ||
endWithNewline() | ||
trimTrailingWhitespace() | ||
jackson().yamlFeature("LITERAL_BLOCK_STYLE", true).yamlFeature("SPLIT_LINES", false) | ||
} | ||
|
||
json { | ||
target("renovate.json") | ||
endWithNewline() | ||
trimTrailingWhitespace() | ||
jackson() | ||
} | ||
|
||
format("toml") { | ||
target("gradle/libs.versions.toml") | ||
endWithNewline() | ||
trimTrailingWhitespace() | ||
prettier(prettierConfig) | ||
.config( | ||
mapOf( | ||
"parser" to "toml", | ||
"plugins" to listOf("prettier-plugin-toml"), | ||
), | ||
) | ||
} | ||
|
||
kotlin { | ||
target( | ||
"buildSrc/src/main/kotlin/**/*.kt", | ||
"buildSrc/**/*.gradle.kts", | ||
"*.gradle.kts", | ||
*subProjects.map { "$it/*.gradle.kts" }.toTypedArray(), | ||
*subProjects.map { "$it/src/main/kotlin/**/*.kt" }.toTypedArray(), | ||
) | ||
endWithNewline() | ||
trimTrailingWhitespace() | ||
ktfmt().kotlinlangStyle().configure { | ||
it.setMaxWidth(100) | ||
it.setBlockIndent(4) | ||
it.setContinuationIndent(4) | ||
it.setRemoveUnusedImport(true) | ||
} | ||
} | ||
|
||
java { | ||
target( | ||
*subProjects.map { "$it/src/main/java/**/*.java" }.toTypedArray(), | ||
) | ||
importOrder() | ||
removeUnusedImports() | ||
endWithNewline() | ||
trimTrailingWhitespace() | ||
prettier(prettierConfig) | ||
.config( | ||
mapOf( | ||
"parser" to "java", | ||
"tabWidth" to 4, | ||
"useTabs" to false, | ||
"printWidth" to 100, | ||
"plugins" to listOf("prettier-plugin-java"), | ||
), | ||
) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import net.infumia.gradle.applyPublish | ||
|
||
applyPublish() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
name=frame | ||
group=net.infumia | ||
version=1.0.0-SNAPSHOT | ||
|
||
org.gradle.parallel=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[libraries] | ||
nexus-plugin = { module = "com.vanniktech:gradle-maven-publish-plugin", version = "0.29.0" } | ||
spotless-plugin = { module = "com.diffplug.spotless:spotless-plugin-gradle", version = "6.25.0" } |
Binary file not shown.
Oops, something went wrong.