Skip to content

Commit 0011c29

Browse files
Merge pull request #62 from adityabhaskar/ab/add-gradle-lint-plugin
Add gradle lint plugin + resolve errors
2 parents b38693f + 7e42fc6 commit 0011c29

File tree

6 files changed

+15
-8
lines changed

6 files changed

+15
-8
lines changed

Diff for: README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ The plugin is available in the [Gradle plugins repository](https://plugins.gradl
2424
Kotlin:
2525
```kotlin
2626
plugins {
27-
id("io.github.adityabhaskar.dependencygraph") version "0.1.4"
27+
id("io.github.adityabhaskar.dependencygraph") version "<version>"
2828
}
2929
```
3030

3131
Groovy:
3232
```groovy
3333
plugins {
34-
id "io.github.adityabhaskar.dependencygraph" version "0.1.4"
34+
id "io.github.adityabhaskar.dependencygraph" version "<version>"
3535
}
3636
```
3737

@@ -173,4 +173,4 @@ Feel free to open a issue or submit a pull request for any bugs/improvements.
173173

174174
## License 📄
175175

176-
This template is licensed under the MIT License - see the [License](License) file for details.
176+
This template is licensed under the MIT License - see the [License](License) file for details.

Diff for: gradle/libs.versions.toml

+4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@ kotlin = "1.9.23"
44
ktlintGradle = "11.6.1"
55
pluginPublish = "1.2.1"
66
versionCheck = "0.51.0"
7+
android-lint = "8.3.0"
8+
android-lint-gradle = "1.0.0-alpha01"
79

810
[plugins]
911
detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt"}
1012
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin"}
1113
ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlintGradle"}
1214
pluginPublish = { id = "com.gradle.plugin-publish", version.ref = "pluginPublish"}
1315
versionCheck = { id = "com.github.ben-manes.versions", version.ref = "versionCheck"}
16+
lint = { id = "com.android.lint", version.ref = "android-lint"}
1417

1518
[libraries]
1619
junit = "junit:junit:4.13.2"
20+
android-lint-gradle = { module = "androidx.lint:lint-gradle", version.ref = "android-lint-gradle" }

Diff for: plugin-build/gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ID=io.github.adityabhaskar.dependencygraph
2-
VERSION=0.1.5
2+
VERSION=0.1.6
33
GROUP=io.github.adityabhaskar
44
DISPLAY_NAME=Gradle module dependency graphs
55
DESCRIPTION=A plugin to automatically produce Github/mermaid compatible dependency graphs

Diff for: plugin-build/plugin/build.gradle.kts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
22

3-
@Suppress("DSL_SCOPE_VIOLATION")
43
plugins {
54
kotlin("jvm")
65
`java-gradle-plugin`
76
alias(libs.plugins.pluginPublish)
7+
alias(libs.plugins.lint)
88
}
99

1010
dependencies {
1111
implementation(kotlin("stdlib"))
1212
implementation(gradleApi())
1313

14+
lintChecks(libs.android.lint.gradle)
15+
1416
testImplementation(libs.junit)
1517
}
1618

Diff for: plugin-build/plugin/src/main/kotlin/io/github/adityabhaskar/dependencygraph/plugin/core/ParseGraph.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ internal fun parseDependencyGraph(
6565
javaProjects.add(project)
6666
}
6767

68-
project.configurations.all { config ->
68+
project.configurations.configureEach { config ->
6969
config.dependencies
70-
.filterIsInstance(ProjectDependency::class.java)
70+
.filterIsInstance<ProjectDependency>()
7171
.map { it.dependencyProject }
7272
.filter { it.path !in ignoredModules }
7373
.forEach { dependency ->
@@ -100,7 +100,7 @@ internal fun parseDependencyGraph(
100100
val allDependencies = it.configurations
101101
.map { config ->
102102
config.dependencies
103-
.filterIsInstance(ProjectDependency::class.java)
103+
.filterIsInstance<ProjectDependency>()
104104
.filter { dependency ->
105105
dependency.dependencyProject.path != it.path
106106
}

Diff for: plugin-build/settings.gradle.kts

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ pluginManagement {
22
repositories {
33
gradlePluginPortal()
44
mavenCentral()
5+
google()
56
}
67
}
78

0 commit comments

Comments
 (0)