Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,47 @@ jobs:
if: github.event.pull_request.head.repo.full_name != github.repository
run: ./gradlew ktlintCheck -q --no-daemon

modulecheck:

runs-on: ubuntu-latest
if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'

steps:
- name: check out with token (used by forks)
uses: actions/checkout@v2
if: github.event.pull_request.head.repo.full_name != github.repository

- name: check out with PAT (used by main repo)
uses: actions/checkout@v2
if: github.event.pull_request.head.repo.full_name == github.repository
with:
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
fetch-depth: 0

- name: Set up JDK
uses : actions/setup-java@v2
with :
distribution : 'adopt'
java-version : '11'
cache: 'gradle'

- name: ModuleCheck with auto-correct (used by main repo)
if: github.event.pull_request.head.repo.full_name == github.repository
run: ./gradlew moduleCheckAuto

# If KtLint generated changes, commit and push those changes.
- name: commit changes (used by main repo)
if: github.event.pull_request.head.repo.full_name == github.repository
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Apply ModuleCheck fixes
commit_options: '--no-verify --signoff'

- name: ModuleCheck check (used by forks)
if: github.event.pull_request.head.repo.full_name != github.repository
run: ./gradlew moduleCheck

versioning:

runs-on: ubuntu-latest
Expand Down
8 changes: 8 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ plugins {
id("mcbuild.ktlint")
id("mcbuild.test")
id("mcbuild.website")
id("com.rickbusarow.module-check") version "0.12.0"
}

moduleCheck {
deleteUnused = true
checks {
sortDependencies = true
}
}

tasks.named("ktlintFormat") {
Expand Down
5 changes: 3 additions & 2 deletions modulecheck-config/fake/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,16 @@ mcbuild {
artifactId = "modulecheck-config-fake"
anvil = true
}
dependencies {
api(project(path = ":modulecheck-config:api"))

dependencies {
api(libs.kotlin.compiler)
api(libs.kotlinx.coroutines.core)
api(libs.kotlinx.coroutines.jvm)
api(libs.rickBusarow.dispatch.core)
api(libs.semVer)

api(project(path = ":modulecheck-config:api"))

compileOnly(gradleApi())

implementation(libs.agp)
Expand Down
2 changes: 1 addition & 1 deletion modulecheck-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ dependencies {
implementation(libs.square.anvil.gradle)

implementation(project(path = ":modulecheck-project:impl"))
implementation(project(path = ":modulecheck-utils"))
implementation(project(path = ":modulecheck-rule:impl"))
implementation(project(path = ":modulecheck-utils"))

testImplementation(libs.bundles.hermit)
testImplementation(libs.bundles.jUnit)
Expand Down
2 changes: 1 addition & 1 deletion modulecheck-reporting/console/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ mcbuild {

dependencies {

api(project(path = ":modulecheck-rule:api"))
api(project(path = ":modulecheck-api"))
api(project(path = ":modulecheck-reporting:logging"))
api(project(path = ":modulecheck-rule:api"))

implementation(project(path = ":modulecheck-parsing:gradle"))

Expand Down
4 changes: 2 additions & 2 deletions modulecheck-rule/impl/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ dependencies {
api(project(path = ":modulecheck-rule:api"))
api(project(path = ":modulecheck-utils"))

implementation(project(path = ":modulecheck-dagger"))

compileOnly(gradleApi())

implementation(libs.agp)
implementation(libs.groovy)
implementation(libs.kotlin.reflect)

implementation(project(path = ":modulecheck-dagger"))

testImplementation(libs.bundles.hermit)
testImplementation(libs.bundles.jUnit)
testImplementation(libs.bundles.kotest)
Expand Down
7 changes: 7 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ pluginManagement {
mavenCentral()
google()
mavenLocal()
maven {
url = uri("https://oss.sonatype.org/content/repositories/snapshots/")
content {
includeGroup("com.rickbusarow.module-check")
includeGroup("com.rickbusarow.modulecheck")
}
}
}
@Suppress("UnstableApiUsage")
includeBuild("build-logic")
Expand Down