Skip to content

Commit 0483e5d

Browse files
committed
add dependency-guard and baselines
There's quite a lot in the plugin runtime which needs to be cleaned up.
1 parent 8de583e commit 0483e5d

File tree

46 files changed

+2117
-24
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+2117
-24
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
- name: build website
5252
run: ./gradlew buildSite --no-daemon
5353

54-
artifacts-check:
54+
static-analysis:
5555

5656
runs-on: ubuntu-latest
5757
if: github.actor != 'renovate[bot]'
@@ -78,29 +78,8 @@ jobs:
7878
- name: artifacts check
7979
run: ./gradlew artifactsCheck --no-daemon
8080

81-
detekt:
82-
83-
runs-on: ubuntu-latest
84-
if: github.actor != 'renovate[bot]'
85-
steps:
86-
- name: check out with token (used by forks)
87-
uses: actions/checkout@v3
88-
if: github.event.pull_request.head.repo.full_name != github.repository
89-
90-
- name: check out with PAT (used by main repo)
91-
uses: actions/checkout@v3
92-
if: github.event.pull_request.head.repo.full_name == github.repository
93-
with:
94-
ref: ${{ github.event.pull_request.head.ref }}
95-
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
96-
fetch-depth: 0
97-
98-
- name: Set up JDK
99-
uses: actions/setup-java@v3
100-
with:
101-
distribution: 'adopt'
102-
java-version: '11'
103-
cache: 'gradle'
81+
- name: dependency-guard
82+
run: ./gradlew dependencyGuard --no-daemon
10483

10584
- name: detekt
10685
run: ./gradlew detekt --no-daemon

build-logic/mcbuild/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ dependencies {
3333

3434
implementation(libs.benManes.gradle)
3535
implementation(libs.detekt.gradle)
36+
implementation(libs.dropbox.dependencyGuard)
3637
implementation(libs.dokka.gradle)
3738
implementation(libs.google.dagger.api)
3839
implementation(libs.google.ksp)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Copyright (C) 2021-2022 Rick Busarow
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*/
15+
16+
plugins {
17+
kotlin("jvm")
18+
id("com.dropbox.dependency-guard")
19+
}
20+
21+
dependencyGuard {
22+
if (project.rootProject == project) {
23+
configuration("classpath")
24+
} else {
25+
configuration("runtimeClasspath")
26+
}
27+
}
28+
29+
// Delete any existing dependency files/directories before recreating with a new baseline task.
30+
val dependencyGuardDeleteBaselines by tasks.registering(Delete::class) {
31+
delete("dependencies")
32+
}
33+
tasks.matching { it.name == "dependencyGuardBaseline" }
34+
.configureEach { dependsOn(dependencyGuardDeleteBaselines) }

build-logic/mcbuild/src/main/kotlin/mcbuild.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import modulecheck.builds.libsCatalog
2828
plugins {
2929
id("mcbuild.clean")
3030
id("mcbuild.detekt")
31+
id("mcbuild.dependency-guard")
3132
id("mcbuild.java-library")
3233
id("mcbuild.kotlin")
3334
id("mcbuild.ktlint")

gradle/libs.versions.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ compileSdk = "30"
2222
dependencyAnalysis = "1.2.1"
2323
detekt = "1.20.0"
2424
dokka = "1.6.21"
25+
dropbox-dependencyGuard = "0.1.0"
2526
exhaustive = "0.2.0"
2627

2728
google-accompanist = "0.18.0"
@@ -69,6 +70,7 @@ autoManifest = { id = "com.gradleup.auto.manifest", version.ref = "autoManifest"
6970
benManes = { id = "com.github.ben-manes.versions", version.ref = "benManes" }
7071
dependencyAnalysis = { id = "com.autonomousapps.dependency-analysis", version.ref = "dependencyAnalysis" }
7172
detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
73+
dropbox-dependencyGuard = { id = "com.dropbox.dependency-guard", version.ref = "dropbox-dependencyGuard" }
7274
exhaustive = { id = "app.cash.exhaustive:exhaustive-gradle", version.ref = "exhaustive" }
7375
gradleDoctor = { id = "com.osacky.doctor", version.ref = "gradleDoctor" }
7476
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
@@ -98,6 +100,8 @@ detekt-gradle = { module = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin", v
98100

99101
dokka-gradle = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokka" }
100102

103+
dropbox-dependencyGuard = { module = "com.dropbox.dependency-guard:dependency-guard", version.ref = "dropbox-dependencyGuard" }
104+
101105
google-dagger-api = { module = "com.google.dagger:dagger", version.ref = "google-dagger" }
102106
google-dagger-compiler = { module = "com.google.dagger:dagger-compiler", version.ref = "google-dagger" }
103107

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
:modulecheck-dagger
2+
:modulecheck-finding:api
3+
:modulecheck-finding:name
4+
:modulecheck-parsing:android
5+
:modulecheck-parsing:gradle:dsl:api
6+
:modulecheck-parsing:gradle:dsl:precompiled
7+
:modulecheck-parsing:gradle:model:api
8+
:modulecheck-parsing:source:api
9+
:modulecheck-project:api
10+
:modulecheck-reporting:logging:api
11+
:modulecheck-utils
12+
com.google.dagger:dagger:2.42
13+
com.rickbusarow.dispatch:dispatch-core:1.0.0-beta10
14+
com.squareup.anvil:annotations:2.4.0
15+
javax.inject:javax.inject:1
16+
net.java.dev.jna:jna:5.6.0
17+
net.swiftzer.semver:semver:1.2.0
18+
org.codehaus.groovy:groovy-xml:3.0.10
19+
org.codehaus.groovy:groovy:3.0.10
20+
org.jetbrains.intellij.deps:trove4j:1.0.20200330
21+
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.6.21
22+
org.jetbrains.kotlin:kotlin-daemon-embeddable:1.6.21
23+
org.jetbrains.kotlin:kotlin-reflect:1.6.21
24+
org.jetbrains.kotlin:kotlin-script-runtime:1.6.21
25+
org.jetbrains.kotlin:kotlin-stdlib-common:1.6.21
26+
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21
27+
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21
28+
org.jetbrains.kotlin:kotlin-stdlib:1.6.21
29+
org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.6.1
30+
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.1
31+
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1
32+
org.jetbrains:annotations:13.0
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
:modulecheck-parsing:gradle:model:api
2+
:modulecheck-parsing:source:api
3+
:modulecheck-utils
4+
com.google.dagger:dagger:2.42
5+
com.rickbusarow.dispatch:dispatch-core:1.0.0-beta10
6+
com.squareup.anvil:annotations:2.4.0
7+
javax.inject:javax.inject:1
8+
net.java.dev.jna:jna:5.6.0
9+
net.swiftzer.semver:semver:1.2.0
10+
org.codehaus.groovy:groovy:3.0.10
11+
org.jetbrains.intellij.deps:trove4j:1.0.20200330
12+
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.6.21
13+
org.jetbrains.kotlin:kotlin-daemon-embeddable:1.6.21
14+
org.jetbrains.kotlin:kotlin-reflect:1.6.21
15+
org.jetbrains.kotlin:kotlin-script-runtime:1.6.21
16+
org.jetbrains.kotlin:kotlin-stdlib-common:1.6.21
17+
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21
18+
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21
19+
org.jetbrains.kotlin:kotlin-stdlib:1.6.21
20+
org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.6.1
21+
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.1
22+
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1
23+
org.jetbrains:annotations:13.0
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
:modulecheck-config:api
2+
:modulecheck-parsing:gradle:model:api
3+
:modulecheck-parsing:source:api
4+
:modulecheck-utils
5+
com.google.dagger:dagger:2.42
6+
com.rickbusarow.dispatch:dispatch-core:1.0.0-beta10
7+
com.squareup.anvil:annotations:2.4.0
8+
javax.inject:javax.inject:1
9+
net.java.dev.jna:jna:5.6.0
10+
net.swiftzer.semver:semver:1.2.0
11+
org.codehaus.groovy:groovy:3.0.10
12+
org.jetbrains.intellij.deps:trove4j:1.0.20200330
13+
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.6.21
14+
org.jetbrains.kotlin:kotlin-daemon-embeddable:1.6.21
15+
org.jetbrains.kotlin:kotlin-reflect:1.6.21
16+
org.jetbrains.kotlin:kotlin-script-runtime:1.6.21
17+
org.jetbrains.kotlin:kotlin-stdlib-common:1.6.21
18+
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21
19+
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21
20+
org.jetbrains.kotlin:kotlin-stdlib:1.6.21
21+
org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.6.1
22+
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.1
23+
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1
24+
org.jetbrains:annotations:13.0
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
:modulecheck-api
2+
:modulecheck-config:api
3+
:modulecheck-dagger
4+
:modulecheck-finding:api
5+
:modulecheck-finding:name
6+
:modulecheck-parsing:android
7+
:modulecheck-parsing:gradle:dsl:api
8+
:modulecheck-parsing:gradle:dsl:precompiled
9+
:modulecheck-parsing:gradle:model:api
10+
:modulecheck-parsing:source:api
11+
:modulecheck-project:api
12+
:modulecheck-reporting:logging:api
13+
:modulecheck-rule:api
14+
:modulecheck-utils
15+
com.google.dagger:dagger:2.42
16+
com.rickbusarow.dispatch:dispatch-core:1.0.0-beta10
17+
com.squareup.anvil:annotations:2.4.0
18+
javax.inject:javax.inject:1
19+
net.java.dev.jna:jna:5.6.0
20+
net.swiftzer.semver:semver:1.2.0
21+
org.codehaus.groovy:groovy-xml:3.0.10
22+
org.codehaus.groovy:groovy:3.0.10
23+
org.jetbrains.intellij.deps:trove4j:1.0.20200330
24+
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.6.21
25+
org.jetbrains.kotlin:kotlin-daemon-embeddable:1.6.21
26+
org.jetbrains.kotlin:kotlin-reflect:1.6.21
27+
org.jetbrains.kotlin:kotlin-script-runtime:1.6.21
28+
org.jetbrains.kotlin:kotlin-stdlib-common:1.6.21
29+
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21
30+
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21
31+
org.jetbrains.kotlin:kotlin-stdlib:1.6.21
32+
org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.6.1
33+
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.1
34+
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1
35+
org.jetbrains:annotations:13.0
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
com.google.dagger:dagger:2.42
2+
com.rickbusarow.dispatch:dispatch-core:1.0.0-beta10
3+
com.squareup.anvil:annotations:2.4.0
4+
javax.inject:javax.inject:1
5+
org.jetbrains.kotlin:kotlin-stdlib-common:1.6.21
6+
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21
7+
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21
8+
org.jetbrains.kotlin:kotlin-stdlib:1.6.21
9+
org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.6.1
10+
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.1
11+
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1
12+
org.jetbrains:annotations:13.0
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
:modulecheck-dagger
2+
:modulecheck-finding:name
3+
:modulecheck-parsing:gradle:dsl:api
4+
:modulecheck-parsing:gradle:dsl:precompiled
5+
:modulecheck-parsing:gradle:model:api
6+
:modulecheck-parsing:source:api
7+
:modulecheck-project:api
8+
:modulecheck-reporting:logging:api
9+
:modulecheck-utils
10+
com.google.dagger:dagger:2.42
11+
com.rickbusarow.dispatch:dispatch-core:1.0.0-beta10
12+
com.squareup.anvil:annotations:2.4.0
13+
javax.inject:javax.inject:1
14+
net.java.dev.jna:jna:5.6.0
15+
net.swiftzer.semver:semver:1.2.0
16+
org.codehaus.groovy:groovy:3.0.10
17+
org.jetbrains.intellij.deps:trove4j:1.0.20200330
18+
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.6.21
19+
org.jetbrains.kotlin:kotlin-daemon-embeddable:1.6.21
20+
org.jetbrains.kotlin:kotlin-reflect:1.6.21
21+
org.jetbrains.kotlin:kotlin-script-runtime:1.6.21
22+
org.jetbrains.kotlin:kotlin-stdlib-common:1.6.21
23+
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21
24+
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21
25+
org.jetbrains.kotlin:kotlin-stdlib:1.6.21
26+
org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.6.1
27+
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.1
28+
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1
29+
org.jetbrains:annotations:13.0
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
:modulecheck-reporting:logging:api
2+
:modulecheck-utils
3+
com.google.dagger:dagger:2.42
4+
com.rickbusarow.dispatch:dispatch-core:1.0.0-beta10
5+
com.squareup.anvil:annotations:2.4.0
6+
javax.inject:javax.inject:1
7+
net.java.dev.jna:jna:5.6.0
8+
net.swiftzer.semver:semver:1.2.0
9+
org.codehaus.groovy:groovy:3.0.10
10+
org.jetbrains.intellij.deps:trove4j:1.0.20200330
11+
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.6.21
12+
org.jetbrains.kotlin:kotlin-daemon-embeddable:1.6.21
13+
org.jetbrains.kotlin:kotlin-reflect:1.6.21
14+
org.jetbrains.kotlin:kotlin-script-runtime:1.6.21
15+
org.jetbrains.kotlin:kotlin-stdlib-common:1.6.21
16+
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21
17+
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21
18+
org.jetbrains.kotlin:kotlin-stdlib:1.6.21
19+
org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.6.1
20+
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.1
21+
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1
22+
org.jetbrains:annotations:13.0

0 commit comments

Comments
 (0)