Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gradle lint plugin + resolve errors #62

Merged
merged 5 commits into from
Mar 16, 2024
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
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 ->
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change should also address #57

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
Loading