This repository has been archived by the owner on Apr 11, 2024. It is now read-only.
generated from OmicoDev/gradle-project-initializer-template
-
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
0 parents
commit f6aa93e
Showing
30 changed files
with
666 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,3 @@ | ||
* text eol=lf | ||
*.bat text eol=crlf | ||
*.jar binary |
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,42 @@ | ||
name: Gradle Build | ||
|
||
on: | ||
pull_request: | ||
push: | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: '${{ github.workflow }}-${{ github.ref }}' | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
gradle-wrapper-validation: | ||
name: Gradle Wrapper validation | ||
uses: OmicoDev/gradle-project-initializer-template/.github/workflows/gradle-wrapper-validation.yml@main | ||
|
||
gradle-build: | ||
name: Gradle Build | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
needs: | ||
- gradle-wrapper-validation | ||
env: | ||
DEPENDENCY_GRAPH_EXCLUDE_PROJECTS: ':(gradm|initialization|project)' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 2 | ||
|
||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
with: | ||
gradle-home-cache-cleanup: true | ||
dependency-graph: generate-and-submit | ||
|
||
- run: ./gradlew build --no-daemon --stacktrace |
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,12 @@ | ||
name: Gradle Wrapper validation | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
gradle-wrapper-validation: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: gradle/wrapper-validation-action@v2 |
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 @@ | ||
.DS_Store | ||
/.gradle | ||
/.idea | ||
/build | ||
/local.properties | ||
|
||
!/.idea/detekt.xml |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,6 @@ | ||
# Gradle Project Initializer template | ||
|
||
A generated project template which suitable for my own purposes. | ||
|
||
> **Note** | ||
> This project is generated by GPI (Gradle Project Initializer) CLI. Issues only, don't create any pull requests. |
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,2 @@ | ||
/.gradle | ||
/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,13 @@ | ||
plugins { | ||
`kotlin-dsl` | ||
id("me.omico.gradm") version "4.0.0-beta03" | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
gradm { | ||
pluginId = "gpi.gradm" | ||
debug = 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,33 @@ | ||
versions: | ||
consensus: "0.9.0" | ||
gradle: "8.7" | ||
kotlin: "1.9.23" | ||
plugins: | ||
gradle.enterprise: "3.16.2" | ||
spotless: "6.25.0" | ||
|
||
repositories: | ||
omico: | ||
mavenCentral: | ||
gradlePluginPortal: | ||
|
||
plugins: | ||
gradlePluginPortal: | ||
com.diffplug.spotless: ${versions.plugins.spotless} | ||
com.gradle.enterprise: ${versions.plugins.gradle.enterprise} | ||
omico: | ||
me.omico.consensus.api: ${versions.consensus} | ||
me.omico.consensus.git: ${versions.consensus} | ||
me.omico.consensus.spotless: ${versions.consensus} | ||
|
||
dependencies: | ||
mavenCentral: | ||
org.jetbrains.kotlin: | ||
kotlin-gradle-plugin: | ||
alias: kotlinGradlePlugin | ||
version: ${versions.kotlin} | ||
omico: | ||
me.omico.consensus: | ||
consensus-dsl: | ||
alias: me.omico.consensus.dsl | ||
version: ${versions.consensus} |
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,8 @@ | ||
rootProject.name = "gpi-gradm" | ||
|
||
pluginManagement { | ||
repositories { | ||
maven(url = "https://maven.omico.me") | ||
gradlePluginPortal() | ||
} | ||
} |
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,2 @@ | ||
/.gradle | ||
/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,8 @@ | ||
plugins { | ||
`kotlin-dsl` | ||
} | ||
|
||
dependencies { | ||
implementation(com.gradle.enterprise) | ||
implementation(gradmGeneratedJar) | ||
} |
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,9 @@ | ||
rootProject.name = "gpi-initialization" | ||
|
||
pluginManagement { | ||
includeBuild("../gradm") | ||
} | ||
|
||
plugins { | ||
id("gpi.gradm") | ||
} |
11 changes: 11 additions & 0 deletions
11
build-logic/initialization/src/main/kotlin/gpi.gradle-enterprise.settings.gradle.kts
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,11 @@ | ||
plugins { | ||
id("com.gradle.enterprise") | ||
} | ||
|
||
gradleEnterprise { | ||
buildScan { | ||
termsOfServiceUrl = "https://gradle.com/terms-of-service" | ||
termsOfServiceAgree = "yes" | ||
publishAlwaysIf(!gradle.startParameter.isOffline) | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
build-logic/initialization/src/main/kotlin/gpi.settings.gradle.kts
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,13 @@ | ||
import me.omico.gradle.initialization.includeAllSubprojectModules | ||
import me.omico.gradm.addDeclaredRepositories | ||
|
||
addDeclaredRepositories() | ||
|
||
plugins { | ||
id("gpi.gradm") | ||
id("gpi.gradle-enterprise") | ||
} | ||
|
||
includeBuild("build-logic/project") | ||
|
||
includeAllSubprojectModules("gpi") |
14 changes: 14 additions & 0 deletions
14
build-logic/initialization/src/main/kotlin/me/omico/gradle/initialization/Settings.kt
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 @@ | ||
package me.omico.gradle.initialization | ||
|
||
import org.gradle.api.initialization.Settings | ||
import java.io.File | ||
|
||
internal fun Settings.includeAllSubprojectModules(projectName: String): Unit = | ||
rootDir.resolve(projectName).walk() | ||
.filter(File::isDirectory) | ||
.filter { it.resolve("build.gradle.kts").exists() } | ||
.forEach { moduleDirectory -> | ||
val moduleName = moduleDirectory.relativeTo(rootDir).path.replace(File.separator, "-") | ||
include(":$moduleName") | ||
project(":$moduleName").projectDir = moduleDirectory | ||
} |
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,2 @@ | ||
/.gradle | ||
/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,13 @@ | ||
plugins { | ||
`kotlin-dsl` | ||
} | ||
|
||
dependencies { | ||
implementation(com.diffplug.spotless) | ||
implementation(gradmGeneratedJar) | ||
implementation(kotlinGradlePlugin) | ||
implementation(me.omico.consensus.api) | ||
implementation(me.omico.consensus.dsl) | ||
implementation(me.omico.consensus.git) | ||
implementation(me.omico.consensus.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,9 @@ | ||
rootProject.name = "gpi-project" | ||
|
||
pluginManagement { | ||
includeBuild("../gradm") | ||
} | ||
|
||
plugins { | ||
id("gpi.gradm") | ||
} |
23 changes: 23 additions & 0 deletions
23
build-logic/project/src/main/kotlin/gpi.root.git.gradle.kts
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,23 @@ | ||
import me.omico.consensus.dsl.requireRootProject | ||
|
||
plugins { | ||
id("me.omico.consensus.git") | ||
} | ||
|
||
requireRootProject() | ||
|
||
consensus { | ||
git { | ||
hooks { | ||
preCommit { | ||
appendLine("#!/bin/sh") | ||
appendLine() | ||
if (file("gradlew").exists()) { | ||
appendLine("# Give gradlew execute permission") | ||
appendLine("git ls-files \"*gradlew\" | xargs git update-index --add --chmod=+x") | ||
appendLine() | ||
} | ||
} | ||
} | ||
} | ||
} |
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 @@ | ||
import me.omico.consensus.dsl.requireRootProject | ||
|
||
plugins { | ||
id("gpi.gradm") | ||
id("gpi.root.git") | ||
id("gpi.root.spotless") | ||
} | ||
|
||
requireRootProject() | ||
|
||
consensus { | ||
allprojects { | ||
group = gradleProperty("project.group") | ||
version = gradleProperty("project.version") | ||
} | ||
} | ||
|
||
val wrapper: Wrapper by tasks.named<Wrapper>("wrapper") { | ||
gradleVersion = versions.gradle | ||
distributionType = Wrapper.DistributionType.BIN | ||
} |
25 changes: 25 additions & 0 deletions
25
build-logic/project/src/main/kotlin/gpi.root.spotless.gradle.kts
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,25 @@ | ||
import me.omico.consensus.dsl.requireRootProject | ||
import me.omico.consensus.spotless.ConsensusSpotlessTokens | ||
|
||
plugins { | ||
id("me.omico.consensus.spotless") | ||
} | ||
|
||
requireRootProject() | ||
|
||
consensus { | ||
spotless { | ||
rootProject { | ||
freshmark() | ||
gradleProperties() | ||
} | ||
allprojects { | ||
kotlin( | ||
targets = ConsensusSpotlessTokens.Kotlin.targets + setOf( | ||
"build-logic/**/src/main/kotlin/**/*.kt", | ||
), | ||
) | ||
kotlinGradle() | ||
} | ||
} | ||
} |
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 @@ | ||
plugins { | ||
id("gpi.root") | ||
} |
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,11 @@ | ||
complexity: | ||
LongParameterList: | ||
active: false | ||
TooManyFunctions: | ||
active: false | ||
|
||
style: | ||
MagicNumber: | ||
ignoreLocalVariableDeclaration: true | ||
ReturnCount: | ||
active: false |
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 @@ | ||
org.gradle.caching=true | ||
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 -XX:+UseParallelGC | ||
org.gradle.kotlin.dsl.allWarningsAsErrors=true | ||
org.gradle.parallel=true | ||
|
||
project.group=me.omico.gpi | ||
project.version=0.1.0-SNAPSHOT |
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.7-bin.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.