Skip to content

Commit

Permalink
Merge pull request #55 from google/yaraki/fix-processor
Browse files Browse the repository at this point in the history
Further attept at fixing the processor
  • Loading branch information
yaraki authored Feb 12, 2024
2 parents 992476f + 986c354 commit 6874cb5
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 21 deletions.
2 changes: 1 addition & 1 deletion framework/base/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ android {
defaultConfig {
minSdk 21
targetSdk 34
resConfigs 'en'
resourceConfigurations += ['en']

testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ class SampleProcessor(

private val visitor = SampleVisitor(logger, codeGenerator)

private val visited = mutableListOf<KSAnnotated>()

override fun process(resolver: Resolver): List<KSAnnotated> {
resolver.getSymbolsWithAnnotation(Sample::class.java.name)
val symbols = resolver.getSymbolsWithAnnotation(Sample::class.java.name)
.filter {
val isValid = it.validate { first, second ->
// Skip checking fields of a class since its causing issues with viewBinding
Expand All @@ -58,10 +60,14 @@ class SampleProcessor(
}
(it is KSFunctionDeclaration || it is KSClassDeclaration) &&
isValid &&
it !in visited &&
!it.isAnnotationPresent(Deprecated::class)
}
.forEach { it.accept(visitor, Unit) }
for (symbol in symbols) {
symbol.accept(visitor, Unit)
}
visited.addAll(symbols)

return emptyList()
return symbols.toList()
}
}
2 changes: 1 addition & 1 deletion framework/ui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ android {
defaultConfig {
minSdk 21
targetSdk 34
resConfigs 'en'
resourceConfigurations += ['en']

testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import androidx.compose.foundation.lazy.LazyRow
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.selection.selectable
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.rounded.KeyboardArrowRight
import androidx.compose.material.icons.rounded.KeyboardArrowRight
import androidx.compose.material.ripple.rememberRipple
import androidx.compose.material3.CardDefaults
Expand Down Expand Up @@ -97,7 +98,7 @@ internal fun CardItem(
verticalAlignment = Alignment.CenterVertically
) {
Text(text = label, style = MaterialTheme.typography.labelLarge)
Icon(Icons.Rounded.KeyboardArrowRight, "Forward")
Icon(Icons.AutoMirrored.Rounded.KeyboardArrowRight, "Forward")
}
if (appearance.description > 0) {
Text(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import androidx.compose.animation.animateContentSize
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Row
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material.icons.automirrored.filled.ArrowBack
import androidx.compose.material.icons.filled.MoreVert
import androidx.compose.material.icons.rounded.Fullscreen
import androidx.compose.material.icons.rounded.Search
Expand Down Expand Up @@ -180,7 +180,7 @@ fun CatalogTopAppBar(
if (selectedSample != null && !isExpandedScreen) {
IconButton(onClick = onBackClick) {
Icon(
imageVector = Icons.Default.ArrowBack, contentDescription = "Back"
imageVector = Icons.AutoMirrored.Filled.ArrowBack, contentDescription = "Back"
)
}
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ systemProp.org.gradle.internal.publish.checksums.insecure=true
systemProp.org.gradle.internal.http.socketTimeout=120000

GROUP=com.google.android.catalog.framework
VERSION_NAME=0.5.0
VERSION_NAME=0.6.0-SNAPSHOT

POM_DESCRIPTION=A framework to build catalog samples

Expand Down
22 changes: 11 additions & 11 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
#

[versions]
compose-bom = "2023.10.01"
composeCompiler = "1.5.3"
compose-bom = "2024.02.00"
composeCompiler = "1.5.9"
composesnapshot = "-" # a single character = no snapshot
gradlePlugin = "8.1.4"
gradlePlugin = "8.2.2"
mavenPublish = "0.25.2"
ktlint = "0.42.1"
kotlin = "1.9.10"
ksp = "1.9.10-1.0.13" # Should be updated when kotlin version is updated
kotlin = "1.9.22"
ksp = "1.9.22-1.0.17" # Should be updated when kotlin version is updated
coroutines = "1.7.3"
hilt = "2.48.1"
androidxtest = "1.4.0"
Expand All @@ -37,20 +37,20 @@ google-ksp-plugin = { module = "com.google.devtools.ksp:com.google.devtools.ksp.
google-ksp-api = { module = "com.google.devtools.ksp:symbol-processing-api", version.ref = "ksp" }

androidx-core = "androidx.core:core-ktx:1.12.0"
androidx-annotation = "androidx.annotation:annotation:1.7.0"
androidx-annotation = "androidx.annotation:annotation:1.7.1"
androidx-fragment = "androidx.fragment:fragment-ktx:1.6.2"
androidx-activity = "androidx.activity:activity:1.8.1"
androidx-activity-compose = "androidx.activity:activity-compose:1.8.1"
androidx-activity = "androidx.activity:activity:1.8.2"
androidx-activity-compose = "androidx.activity:activity-compose:1.8.2"
androidx-startup = "androidx.startup:startup-runtime:1.1.1"
androidx-navigation-fragment = "androidx.navigation:navigation-fragment:2.7.5"
androidx-navigation-compose = "androidx.navigation:navigation-compose:2.7.5"
androidx-navigation-fragment = "androidx.navigation:navigation-fragment:2.7.7"
androidx-navigation-compose = "androidx.navigation:navigation-compose:2.7.7"

androidx-test-runner = "androidx.test:runner:1.5.2"
androidx-test-core-ktx = "androidx.test:core-ktx:1.5.0"
androidx-test-junit = { group = "androidx.test.ext", name = "junit", version.ref = "androidxJunit" }
androidx-test-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espresso" }

mdc = "com.google.android.material:material:1.10.0"
mdc = "com.google.android.material:material:1.11.0"

compose-bom = { module = "androidx.compose:compose-bom", version.ref = "compose-bom" }
compose-ui-ui = { module = "androidx.compose.ui:ui" }
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#Thu Aug 25 11:00:02 CEST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME

0 comments on commit 6874cb5

Please sign in to comment.