-
Notifications
You must be signed in to change notification settings - Fork 27
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
Update deps and make task output dirs unique per task #77
Conversation
Too annoying to maintain and it isn't supported in AGP 7 anymore
Honestly I have no idea how android testing is considered a production-ready tool |
} | ||
|
||
tasks.withType<KotlinCompile>().configureEach { | ||
kotlinOptions { | ||
jvmTarget = "1.8" | ||
@Suppress("SuspiciousCollectionReassignment") | ||
freeCompilerArgs += listOf("-progressive") | ||
// Because Gradle's Kotlin handling is stupid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:D
listOf( | ||
"--keeprules", | ||
androidJar.get().asFile.absolutePath, | ||
appTargetJar.get().asFile.absolutePath, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
honestly surprised you haven't created a getAsFile()
extension function yet 😏
.flatMap { it.walkTopDown() } | ||
.filterNot { it.isDirectory } | ||
.joinToString("\n") { | ||
"# Source: ${it.absolutePath}\n${it.readText()}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know enough about what his is doing to know whether it's correct, but my inner linter is complaining about absolutePath
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this is just a diagnostic and never used as a task input or anything
val diagnosticOutputDir = layout.buildDirectory.dir( | ||
"$INTERMEDIATES_DIR/l8-diagnostics/$taskName") | ||
.forUseAtConfigurationTime() | ||
.get() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you use .get().asFile
on this? Seems like it's more useful as a DirectoryProperty
. On line 160 below, you could use that API to create a new file.
(My inner linter flags all usages of java.io.File
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if you try to resolve it as a directory property, gradle complains about it not existing :|. I can try again in a follow up but this was seemingly necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:stare:
k, sounds good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if something is eagerly triggering the configuration of the L8DexDesugarLibTask
, at which point this file won't exist? 🤷
throw new IllegalStateException("L8 diagnostic rules include the main variant's R8-generated rules, see ${diagnosticFilePath}") | ||
if (verifyL8) { | ||
tasks.withType(L8DexDesugarLibTask) | ||
.matching { it.name == "l8DexDesugarLibExternalStagingAndroidTest" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that matching {}
will realize these tasks (because name
isn't available on the TaskProvider
... I think) -- ah, but this is in a sample.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Name exists on taskprovider!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.30") | ||
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.5.0") | ||
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0") | ||
implementation("com.android:zipflinger:4.2.1") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No longer shading this? 🆒
val diagnosticOutputDir = layout.buildDirectory.dir( | ||
"$INTERMEDIATES_DIR/l8-diagnostics/$taskName") | ||
.forUseAtConfigurationTime() | ||
.get() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if something is eagerly triggering the configuration of the L8DexDesugarLibTask
, at which point this file won't exist? 🤷
Resolves #76 and also starts testing against gradle/agp 7. This entails: