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

chore: bump DAGP to 1.28.0. #1086

Merged
merged 1 commit into from
Dec 27, 2023
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
27 changes: 23 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
`kotlin-dsl`
id("groovy")
id("convention")
id("com.autonomousapps.dependency-analysis")
alias(libs.plugins.dependencyAnalysis)
id("com.autonomousapps.testkit")
}

Expand Down Expand Up @@ -317,16 +317,35 @@ dependencyAnalysis {
}
}

abi {
exclusions {
excludeSourceSets(
// These source sets have an "...Api" configuration, but have no ABI, semantically. Exclude them.
"functionalTest", "smokeTest"
)
}
}

issues {
all {
onAny {
severity("fail")
}
onIncorrectConfiguration {
exclude(
// technically this should be on functionalTestApi, but also there _is_ no api for that source set. KGP adds
// one erroneously. This is fixed in an upcoming version of KGP.
"com.autonomousapps:gradle-testkit-support"
// TODO(tsr):
// 1. version catalog ref (libs.relocated.asm) is not working for some reason
// 2. This fatjar is bundling Kotlin stdlib classes, which is what the analysis is detecting
"com.autonomousapps:asm-relocated",
)
}
onUsedTransitiveDependencies {
exclude(
// TODO(tsr):
// 1. version catalog ref (libs.relocated.asm) is not working for some reason
// 2. This fatjar is bundling Kotlin stdlib classes, which is what the analysis is detecting
// 3. The exclusion only works when I use the project reference, not the Maven coordinates
":asm-relocated",
Comment on lines +342 to +348
Copy link
Owner Author

@autonomousapps autonomousapps Dec 27, 2023

Choose a reason for hiding this comment

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

@jjohannes see point 3. This bug only appeared after I accepted your changes regarding how DAGP references internal projects (and I'm not blaming that change). Any idea why the exclude would work with :asm-relocated but not the full Maven coordinates?

nb, points 1 and 2 are things I will investigate.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I am not 100% sure without diving deep into the code again... but I think it is like this:

We have the bevior that a component can have two represenations if it is a local project. In this case:

  1. project(":asm-relocated")
  2. com.autonomousapps:asm-relocated

Both are tracked throughout the analysis. But at the end, a decisions is made which is the "primary" representation.
We decide that based on what was used when the dependency was declared if possible, that's why it should be right to use (2) here. We declare it like that in the Version Catalog.

Maybe here, we do not have the declaration tracked? (either on purpose, or it's a bug). In that case, I think we decide as follows: If we are inside the multi-project to which the corresponding project belongs, we decide for (1), otherwise for (2). In a single build, this is the case for every project. In a composite build, this is the case for any project in the root build.

Now if the "exclusion" runs late on the analysis results (which I think is the case) it only looks at this "primary" representation because that decision has been made.

)
}
}
Expand Down
4 changes: 4 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ android-tools-common = { module = "com.android.tools:common", version.ref = "agp

caffeine = "com.github.ben-manes.caffeine:caffeine:3.1.0"
commons-io = "commons-io:commons-io:2.11.0"
errorProne = "com.google.errorprone:error_prone_annotations:2.11.0"
gradle-publish-plugin = "com.gradle.plugin-publish:com.gradle.plugin-publish.gradle.plugin:1.1.0"
grammar = { module = "com.autonomousapps:gradle-script-grammar", version.ref = "grammar" }
guava = "com.google.guava:guava:31.1-jre"
Expand Down Expand Up @@ -57,3 +58,6 @@ junit-params = { module = "org.junit.jupiter:junit-jupiter-params", version.ref
mockito-kotlin = "com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0"
spock = "org.spockframework:spock-core:2.1-groovy-3.0"
truth = "com.google.truth:truth:1.1.3"

[plugins]
dependencyAnalysis = { id = "com.autonomousapps.dependency-analysis", version = "1.28.0" }
1 change: 0 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ pluginManagement {
}
}
plugins {
id("com.autonomousapps.dependency-analysis") version "1.25.0"//latestSnapshot
id("com.github.johnrengelman.shadow") version "8.1.1"
id("com.gradle.enterprise") version "3.15.1"
id("com.gradle.plugin-publish") version "1.1.0"
Expand Down
12 changes: 11 additions & 1 deletion testkit/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
plugins {
id("com.autonomousapps.dependency-analysis")
alias(libs.plugins.dependencyAnalysis)
id("org.jetbrains.kotlin.jvm") apply false
}

dependencyAnalysis {
issues {
all {
onAny {
severity("fail")
}
}
}
}
4 changes: 2 additions & 2 deletions testkit/gradle-testkit-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
id("com.gradle.plugin-publish")
id("convention")
id("org.jetbrains.dokka")
id("com.autonomousapps.dependency-analysis")
alias(libs.plugins.dependencyAnalysis)
id("com.autonomousapps.testkit")
}

Expand Down Expand Up @@ -69,7 +69,7 @@ dependencies {
functionalTestImplementation(platform(libs.junit.bom))
functionalTestImplementation(project(":gradle-testkit-support"))
functionalTestImplementation(project(":gradle-testkit-truth"))
functionalTestImplementation(libs.junit.api)
// functionalTestImplementation(libs.junit.api)
functionalTestImplementation(libs.junit.params)
functionalTestImplementation(libs.truth)
functionalTestRuntimeOnly(libs.junit.engine)
Expand Down
2 changes: 1 addition & 1 deletion testkit/gradle-testkit-support/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id("convention")
id("org.jetbrains.dokka")
id("com.autonomousapps.dependency-analysis")
alias(libs.plugins.dependencyAnalysis)
id("com.autonomousapps.testkit")
}

Expand Down
9 changes: 7 additions & 2 deletions testkit/gradle-testkit-truth/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id("convention")
id("org.jetbrains.dokka")
alias(libs.plugins.dependencyAnalysis)
id("com.autonomousapps.testkit")
}

Expand Down Expand Up @@ -36,11 +37,15 @@ tasks.named("javadoc") {
}

dependencies {
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))

api(kotlin("stdlib"))
api(gradleTestKit())
api(libs.truth)

implementation(platform(libs.kotlin.bom))
implementation(libs.errorProne) {
because("Uses @CanIgnoreReturnValue")
}
implementation(libs.guava)

dokkaHtmlPlugin(libs.kotlin.dokka)
}
1 change: 0 additions & 1 deletion testkit/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ pluginManagement {
}
}
plugins {
id("com.autonomousapps.dependency-analysis") version "1.25.0"
id("com.autonomousapps.testkit") version "0.4"

id("com.github.johnrengelman.shadow") version "8.1.1"
Expand Down