Skip to content

Commit

Permalink
Merge pull request #62 from adityabhaskar/ab/add-gradle-lint-plugin
Browse files Browse the repository at this point in the history
Add gradle lint plugin + resolve errors
  • Loading branch information
adityabhaskar authored Mar 16, 2024
2 parents b38693f + 7e42fc6 commit 0011c29
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 8 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ The plugin is available in the [Gradle plugins repository](https://plugins.gradl
Kotlin:
```kotlin
plugins {
id("io.github.adityabhaskar.dependencygraph") version "0.1.4"
id("io.github.adityabhaskar.dependencygraph") version "<version>"
}
```

Groovy:
```groovy
plugins {
id "io.github.adityabhaskar.dependencygraph" version "0.1.4"
id "io.github.adityabhaskar.dependencygraph" version "<version>"
}
```

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

## License 📄

This template is licensed under the MIT License - see the [License](License) file for details.
This template is licensed under the MIT License - see the [License](License) file for details.
4 changes: 4 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@ kotlin = "1.9.23"
ktlintGradle = "11.6.1"
pluginPublish = "1.2.1"
versionCheck = "0.51.0"
android-lint = "8.3.0"
android-lint-gradle = "1.0.0-alpha01"

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

[libraries]
junit = "junit:junit:4.13.2"
android-lint-gradle = { module = "androidx.lint:lint-gradle", version.ref = "android-lint-gradle" }
2 changes: 1 addition & 1 deletion plugin-build/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ID=io.github.adityabhaskar.dependencygraph
VERSION=0.1.5
VERSION=0.1.6
GROUP=io.github.adityabhaskar
DISPLAY_NAME=Gradle module dependency graphs
DESCRIPTION=A plugin to automatically produce Github/mermaid compatible dependency graphs
Expand Down
4 changes: 3 additions & 1 deletion plugin-build/plugin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

@Suppress("DSL_SCOPE_VIOLATION")
plugins {
kotlin("jvm")
`java-gradle-plugin`
alias(libs.plugins.pluginPublish)
alias(libs.plugins.lint)
}

dependencies {
implementation(kotlin("stdlib"))
implementation(gradleApi())

lintChecks(libs.android.lint.gradle)

testImplementation(libs.junit)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ internal fun parseDependencyGraph(
javaProjects.add(project)
}

project.configurations.all { config ->
project.configurations.configureEach { config ->
config.dependencies
.filterIsInstance(ProjectDependency::class.java)
.filterIsInstance<ProjectDependency>()
.map { it.dependencyProject }
.filter { it.path !in ignoredModules }
.forEach { dependency ->
Expand Down Expand Up @@ -100,7 +100,7 @@ internal fun parseDependencyGraph(
val allDependencies = it.configurations
.map { config ->
config.dependencies
.filterIsInstance(ProjectDependency::class.java)
.filterIsInstance<ProjectDependency>()
.filter { dependency ->
dependency.dependencyProject.path != it.path
}
Expand Down
1 change: 1 addition & 0 deletions plugin-build/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ pluginManagement {
repositories {
gradlePluginPortal()
mavenCentral()
google()
}
}

Expand Down

0 comments on commit 0011c29

Please sign in to comment.