-
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
20 changed files
with
652 additions
and
0 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 working-tree-encoding=UTF-8 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,31 @@ | ||
--- | ||
name: "Build" | ||
"on": | ||
pull_request: | ||
branches: | ||
- "master" | ||
jobs: | ||
build: | ||
name: "Build" | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: "actions/checkout@v4" | ||
- uses: "actions/setup-java@v4" | ||
with: | ||
distribution: "adopt" | ||
java-version: "11" | ||
- uses: "actions/cache@v4" | ||
with: | ||
path: "~/.gradle/caches" | ||
key: "${{ runner.os }}-gradle-cache-${{ hashFiles('**/*.gradle.kts') }}" | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- uses: "actions/cache@v4" | ||
with: | ||
path: "~/.gradle/wrapper" | ||
key: "${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle-wrapper.properties') }}" | ||
restore-keys: | | ||
${{ runner.os }}-gradlew- | ||
- 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,32 @@ | ||
--- | ||
name: "Release" | ||
"on": | ||
release: | ||
types: | ||
- "released" | ||
jobs: | ||
build: | ||
name: "Release" | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: "actions/checkout@v4" | ||
- uses: "actions/setup-java@v4" | ||
with: | ||
distribution: "adopt" | ||
java-version: "11" | ||
- uses: "actions/cache@v4" | ||
with: | ||
path: "~/.gradle/caches" | ||
key: "${{ runner.os }}-gradle-cache-${{ hashFiles('**/*.gradle.kts') }}" | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- uses: "actions/cache@v4" | ||
with: | ||
path: "~/.gradle/wrapper" | ||
key: "${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle-wrapper.properties') }}" | ||
restore-keys: | | ||
${{ runner.os }}-gradlew- | ||
- run: | | ||
[[ "${{ github.event.release.tag_name }}" =~ ^[0-9]+(\.[0-9]+)*$ ]] || exit -1 | ||
chmod +x gradlew | ||
./gradlew |
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 @@ | ||
.gradle/ | ||
build/ | ||
.idea/ |
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.spotless | ||
|
||
plugins { kotlin("jvm") } | ||
|
||
repositories { mavenCentral() } | ||
|
||
spotless() |
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,14 @@ | ||
plugins { `kotlin-dsl` } | ||
|
||
repositories { | ||
mavenCentral() | ||
gradlePluginPortal() | ||
} | ||
|
||
dependencies { | ||
implementation(libs.kotlin.plugin) | ||
implementation(libs.dokka.plugin) | ||
implementation(libs.spotless.plugin) | ||
} | ||
|
||
kotlin { jvmToolchain(11) } |
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,43 @@ | ||
package net.infumia.gradle | ||
|
||
import org.gradle.api.Project | ||
import org.gradle.api.plugins.JavaPlugin | ||
import org.gradle.api.plugins.JavaPluginExtension | ||
import org.gradle.api.tasks.bundling.Jar | ||
import org.gradle.jvm.toolchain.JavaLanguageVersion | ||
import org.gradle.kotlin.dsl.* | ||
import org.jetbrains.dokka.gradle.DokkaPlugin | ||
|
||
fun Project.applyCommon(javaVersion: Int = 8, sources: Boolean = true, javadoc: Boolean = true) { | ||
apply<JavaPlugin>() | ||
|
||
if (name.contains("kotlin")) { | ||
apply<DokkaPlugin>() | ||
apply(plugin = "org.jetbrains.kotlin.jvm") | ||
} | ||
|
||
repositories.mavenCentral() | ||
|
||
extensions.configure<JavaPluginExtension> { | ||
toolchain { languageVersion = JavaLanguageVersion.of(javaVersion) } | ||
} | ||
|
||
if (javadoc) { | ||
val javadocJar by | ||
tasks.creating(Jar::class) { | ||
dependsOn("javadoc") | ||
archiveClassifier.set("javadoc") | ||
from(javadoc) | ||
} | ||
} | ||
|
||
if (sources) { | ||
val sourceSets = extensions.getByType<JavaPluginExtension>().sourceSets | ||
val sourcesJar by | ||
tasks.creating(Jar::class) { | ||
dependsOn("classes") | ||
archiveClassifier.set("sources") | ||
from(sourceSets["main"].allSource) | ||
} | ||
} | ||
} |
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 @@ | ||
package net.infumia.gradle | ||
|
||
import org.gradle.api.Project | ||
|
||
// TODO: portlek, Implement the publishing to gradle portal. | ||
fun Project.publish( | ||
// moduleName: String? = null, | ||
javaVersion: Int = 8, | ||
sources: Boolean = true, | ||
javadoc: Boolean = true | ||
) { | ||
applyCommon(javaVersion, sources, javadoc) | ||
|
||
// val projectName = "templator${if (moduleName == null) "" else "-$moduleName"}" | ||
// val signRequired = project.hasProperty("sign-required") | ||
} |
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,71 @@ | ||
package net.infumia.gradle | ||
|
||
import com.diffplug.gradle.spotless.SpotlessExtension | ||
import com.diffplug.gradle.spotless.SpotlessPlugin | ||
import org.gradle.api.Project | ||
import org.gradle.kotlin.dsl.* | ||
|
||
fun Project.spotless() { | ||
val subProjects = subprojects.map { it.projectDir.toRelativeString(projectDir) } | ||
|
||
repositories.mavenCentral() | ||
|
||
apply<SpotlessPlugin>() | ||
|
||
extensions.configure<SpotlessExtension> { | ||
isEnforceCheck = false | ||
lineEndings = com.diffplug.spotless.LineEnding.UNIX | ||
|
||
val prettierConfig = | ||
mapOf( | ||
"prettier" to "3.3.3", | ||
"prettier-plugin-java" to "2.6.4", | ||
"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) | ||
} | ||
} | ||
} | ||
} |
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 @@ | ||
group="net.infumia" | ||
version="1.0.0-SNAPSHOT" | ||
kotlin.code.style=official |
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 @@ | ||
[versions] | ||
kotlin = "2.0.0" | ||
|
||
[libraries] | ||
kotlin-plugin = { module = "org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin", version.ref = "kotlin" } | ||
dokka-plugin = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version = "1.9.20" } | ||
spotless-plugin = { module = "com.diffplug.spotless:spotless-plugin-gradle", version = "6.25.0" } |
Binary file not shown.
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 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-all.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.