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

Create a new pull request by comparing changes across two branches #204

Merged
merged 5 commits into from
Oct 17, 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
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@ import com.squareup.kotlinpoet.FileSpec
* `AppGlideModule` is found, we then generate Glide's configuration so that it calls the
* `AppGlideModule` and any included `LibraryGlideModules`. Using indexes allows us to process
* `LibraryGlideModules` in multiple rounds and/or libraries.
*
* TODO(b/239086146): Finish implementing the behavior described here.
*/
class GlideSymbolProcessor(private val environment: SymbolProcessorEnvironment) : SymbolProcessor {
var isAppGlideModuleGenerated = false
private var isAppGlideModuleGenerated = false

override fun process(resolver: Resolver): List<KSAnnotated> {
val symbols = resolver.getSymbolsWithAnnotation("com.bumptech.glide.annotation.GlideModule")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ internal class LibraryGlideModulesParser(
}
.toList()
val uniqueLibraryGlideModules = allLibraryGlideModules.associateBy { it.name }.values.toList()
if (uniqueLibraryGlideModules != libraryGlideModules) {
if (uniqueLibraryGlideModules.size != libraryGlideModules.size) {
// Find the set of modules that have been included more than once by mapping the qualified
// name of the module to a count of the number of times it's been seen. Duplicates are then
// any keys that have a value > 1.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class LibraryGlideModuleTests(override val sourceType: SourceType) : PerSourceTy
)

compileCurrentSourceType(kotlinModule, javaModule) {
assertThat(it.messages).doesNotContainMatch("[we]: \\[ksp] .*")
assertThat(it.exitCode).isEqualTo(ExitCode.OK)
assertFailsWith<FileNotFoundException> { it.generatedAppGlideModuleContents() }
}
Expand Down Expand Up @@ -100,6 +101,7 @@ class LibraryGlideModuleTests(override val sourceType: SourceType) : PerSourceTy
javaAppModule,
javaLibraryModule
) {
assertThat(it.messages).doesNotContainMatch("[we]: \\[ksp] .*")
assertThat(it.exitCode).isEqualTo(ExitCode.OK)
assertThat(it.generatedAppGlideModuleContents())
.hasSourceEqualTo(appGlideModuleWithLibraryModule)
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ TEST_JVM_MEMORY_SIZE=4096M
VERSION_MAJOR=5
VERSION_MINOR=0
VERSION_PATCH=0
VERSION_NAME=5.0.0-SNAPSHOT
VERSION_NAME=5.0.0-SNAPSHOT
2 changes: 1 addition & 1 deletion integration/compose/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ POM_DESCRIPTION=An integration library to integrate with Jetpack Compose
VERSION_MAJOR=1
VERSION_MINOR=0
VERSION_PATCH=0
VERSION_NAME=1.0.0-beta1-SNAPSHOT
VERSION_NAME=1.0.0-beta02-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,15 @@ internal class GlideNode : DrawModifierNode, LayoutModifierNode, SemanticsModifi
override fun ContentDrawScope.draw() {
if (draw) {
val drawPlaceholder = transition.drawPlaceholder ?: DoNotTransition.drawPlaceholder
placeholder?.let { painter ->
drawContext.canvas.withSave {
placeholderPositionAndSize = drawOne(painter, placeholderPositionAndSize) { size ->
drawPlaceholder.invoke(this, painter, size, alpha, colorFilter)
// If we're only showing the placeholder, it should just be drawn as the primary image.
// If we've loaded a full image and we have a placeholder, then we should try to draw both so
// that the transition can decide what to do.
if (placeholder != primary && transition != DoNotTransition) {
placeholder?.let { painter ->
drawContext.canvas.withSave {
placeholderPositionAndSize = drawOne(painter, placeholderPositionAndSize) { size ->
drawPlaceholder.invoke(this, painter, size, alpha, colorFilter)
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion integration/ktx/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ POM_DESCRIPTION=An integration library to improve Kotlin interop with Glide
VERSION_MAJOR=1
VERSION_MINOR=0
VERSION_PATCH=0
VERSION_NAME=1.0.0-beta1-SNAPSHOT
VERSION_NAME=1.0.0-beta02-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

/**
* An {@link com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool BitmapPool} implementation
* that rejects all {@link android.graphics.Bitmap Bitmap}s added to it and always returns {@code
* null} from get.
* that rejects all {@link android.graphics.Bitmap Bitmap}s added to it and always returns a new
* {@link android.graphics.Bitmap Bitmap} from {@link #get}.
*/
public class BitmapPoolAdapter implements BitmapPool {
@Override
Expand Down
Loading