diff --git a/sample-submodule/src/main/java/com/airbnb/android/submodule/showkasesample/Payments.kt b/sample-submodule/src/main/java/com/airbnb/android/submodule/showkasesample/payments/Payments.kt similarity index 98% rename from sample-submodule/src/main/java/com/airbnb/android/submodule/showkasesample/Payments.kt rename to sample-submodule/src/main/java/com/airbnb/android/submodule/showkasesample/payments/Payments.kt index 88972f3b..80e71121 100644 --- a/sample-submodule/src/main/java/com/airbnb/android/submodule/showkasesample/Payments.kt +++ b/sample-submodule/src/main/java/com/airbnb/android/submodule/showkasesample/payments/Payments.kt @@ -1,4 +1,4 @@ -package com.airbnb.android.submodule.showkasesample +package com.airbnb.android.submodule.showkasesample.payments import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column diff --git a/showkase-processor/src/main/java/com/airbnb/android/showkase/processor/ShowkaseProcessor.kt b/showkase-processor/src/main/java/com/airbnb/android/showkase/processor/ShowkaseProcessor.kt index 677411ad..4f39e0e1 100644 --- a/showkase-processor/src/main/java/com/airbnb/android/showkase/processor/ShowkaseProcessor.kt +++ b/showkase-processor/src/main/java/com/airbnb/android/showkase/processor/ShowkaseProcessor.kt @@ -134,7 +134,6 @@ class ShowkaseProcessor @JvmOverloads constructor( val aggregateMetadataList = componentMetadata + colorMetadata + typographyMetadata if (aggregateMetadataList.isEmpty()) return ShowkaseBrowserProperties() - val packageName = aggregateMetadataList.first().packageName ShowkaseCodegenMetadataWriter(environment).apply { generateShowkaseCodegenFunctions(aggregateMetadataList) } @@ -143,7 +142,6 @@ class ShowkaseProcessor @JvmOverloads constructor( componentMetadata = componentMetadata, colorMetadata = colorMetadata, typographyMetadata = typographyMetadata, - packageName ) } } diff --git a/showkase-processor/src/main/java/com/airbnb/android/showkase/processor/writer/ShowkaseBrowserPropertyWriter.kt b/showkase-processor/src/main/java/com/airbnb/android/showkase/processor/writer/ShowkaseBrowserPropertyWriter.kt index c28310d2..2d652369 100644 --- a/showkase-processor/src/main/java/com/airbnb/android/showkase/processor/writer/ShowkaseBrowserPropertyWriter.kt +++ b/showkase-processor/src/main/java/com/airbnb/android/showkase/processor/writer/ShowkaseBrowserPropertyWriter.kt @@ -20,7 +20,6 @@ class ShowkaseBrowserPropertyWriter(private val environment: XProcessingEnv) { componentMetadata: Set, colorMetadata: Set, typographyMetadata: Set, - packageName: String, ): ShowkaseBrowserProperties { val (showkaseMetadataWithParameterList, showkaseMetadataWithoutParameterList) = componentMetadata @@ -32,7 +31,7 @@ class ShowkaseBrowserPropertyWriter(private val environment: XProcessingEnv) { val withoutParameterPropertyNames = showkaseMetadataWithoutParameterList.mapIndexed { index, showkaseMetadata -> val propertyName = generatePropertyNameFromMetadata(showkaseMetadata) - val fileBuilder = getFileBuilder(packageName, propertyName) + val fileBuilder = getFileBuilder(showkaseMetadata.packageName, propertyName) val property = getPropertyForComponentWithoutParameter(propertyName, showkaseMetadata) @@ -40,7 +39,7 @@ class ShowkaseBrowserPropertyWriter(private val environment: XProcessingEnv) { return@mapIndexed ShowkaseGeneratedMetadata( element = showkaseMetadata.element, propertyName = propertyName, - propertyPackage = packageName, + propertyPackage = showkaseMetadata.packageName, type = ShowkaseGeneratedMetadataType.COMPONENTS_WITHOUT_PARAMETER, group = showkaseMetadata.showkaseGroup, name = showkaseMetadata.showkaseName, @@ -52,7 +51,7 @@ class ShowkaseBrowserPropertyWriter(private val environment: XProcessingEnv) { val withParameterPropertyNames = showkaseMetadataWithParameterList.mapIndexed { index, showkaseMetadata -> val propertyName = generatePropertyNameFromMetadata(showkaseMetadata) - val fileBuilder = getFileBuilder(packageName, propertyName) + val fileBuilder = getFileBuilder(showkaseMetadata.packageName, propertyName) val property = getPropertyForComponentWithParameter(propertyName, showkaseMetadata) fileBuilder.addPropertyAndGenerateFile(property) @@ -60,7 +59,7 @@ class ShowkaseBrowserPropertyWriter(private val environment: XProcessingEnv) { return@mapIndexed ShowkaseGeneratedMetadata( element = showkaseMetadata.element, propertyName = propertyName, - propertyPackage = packageName, + propertyPackage = showkaseMetadata.packageName, type = ShowkaseGeneratedMetadataType.COMPONENTS_WITH_PARAMETER, group = showkaseMetadata.showkaseGroup, name = showkaseMetadata.showkaseName, @@ -71,7 +70,7 @@ class ShowkaseBrowserPropertyWriter(private val environment: XProcessingEnv) { // Generate top level property file for colors val colorPropertyNames = colorMetadata.mapIndexed { index, color -> val propertyName = generatePropertyNameFromMetadata(color) - val fileBuilder = getFileBuilder(packageName, propertyName) + val fileBuilder = getFileBuilder(color.packageName, propertyName) val colorProperty = getPropertyForMetadata( propertyName, color, @@ -82,7 +81,7 @@ class ShowkaseBrowserPropertyWriter(private val environment: XProcessingEnv) { return@mapIndexed ShowkaseGeneratedMetadata( element = color.element, propertyName = propertyName, - propertyPackage = packageName, + propertyPackage = color.packageName, type = ShowkaseGeneratedMetadataType.COLOR, group = color.showkaseGroup, name = color.showkaseName, @@ -93,7 +92,7 @@ class ShowkaseBrowserPropertyWriter(private val environment: XProcessingEnv) { val typographyPropertyNames = typographyMetadata.mapIndexed { index, typography -> val propertyName = generatePropertyNameFromMetadata(typography) - val fileBuilder = getFileBuilder(packageName, propertyName) + val fileBuilder = getFileBuilder(typography.packageName, propertyName) val typographyProperty = getPropertyForMetadata( propertyName, typography, @@ -103,7 +102,7 @@ class ShowkaseBrowserPropertyWriter(private val environment: XProcessingEnv) { return@mapIndexed ShowkaseGeneratedMetadata( element = typography.element, propertyName = propertyName, - propertyPackage = packageName, + propertyPackage = typography.packageName, type = ShowkaseGeneratedMetadataType.COLOR, group = typography.showkaseGroup, name = typography.showkaseName,