Skip to content

Commit

Permalink
De-dupe with the fully qualified function name (#315)
Browse files Browse the repository at this point in the history
* De-dupe with the fully qualified function name

* Fix indentation

* Fix detekt

* Renames in tests

* Remove temp code

* Revert "Renames in tests"

This reverts commit f8c4359.

* Only use the element name for file prefix

* Updating test code

---------

Co-authored-by: Vinay Gaba <vinaygaba@gmail.com>
  • Loading branch information
pmecho and vinaygaba committed May 8, 2023
1 parent 063b9de commit 4a09e3f
Show file tree
Hide file tree
Showing 256 changed files with 666 additions and 642 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ public class ShowkaseMetadata_ {
insideObject = false,
insideWrapperClass = false,
showkaseKDoc = "",
generatedPropertyName = "group1name1",
generatedPropertyName = "TestComposable1group1name1",
showkaseMetadataType = "COMPONENT",
isDefaultStyle = false,
)
public fun group1name1(): Unit {
public fun TestComposable1group1name1(): Unit {
}

@ShowkaseCodegenMetadata(
Expand All @@ -30,11 +30,11 @@ public class ShowkaseMetadata_ {
insideObject = false,
insideWrapperClass = false,
showkaseKDoc = "",
generatedPropertyName = "group2name2",
generatedPropertyName = "TestComposable2group2name2",
showkaseMetadataType = "COMPONENT",
isDefaultStyle = false,
)
public fun group2name2(): Unit {
public fun TestComposable2group2name2(): Unit {
}

@ShowkaseCodegenMetadata(
Expand All @@ -46,10 +46,10 @@ public class ShowkaseMetadata_ {
insideObject = false,
insideWrapperClass = false,
showkaseKDoc = "",
generatedPropertyName = "colorname",
generatedPropertyName = "redcolorname",
showkaseMetadataType = "COLOR",
)
public fun colorname(): Unit {
public fun redcolorname(): Unit {
}

@ShowkaseCodegenMetadata(
Expand All @@ -61,9 +61,9 @@ public class ShowkaseMetadata_ {
insideObject = false,
insideWrapperClass = false,
showkaseKDoc = "",
generatedPropertyName = "typographyname",
generatedPropertyName = "titletypographyname",
showkaseMetadataType = "TYPOGRAPHY",
)
public fun typographyname(): Unit {
public fun titletypographyname(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
import androidx.compose.runtime.Composable
import com.airbnb.android.showkase.models.ShowkaseBrowserComponent

public val group1name1: ShowkaseBrowserComponent = ShowkaseBrowserComponent(
public val TestComposable1group1name1: ShowkaseBrowserComponent = ShowkaseBrowserComponent(
group = "group1",
componentName = "name1",
componentKDoc = "",
componentKey = """_null_group1_name1_0_null""",
componentKey = """_TestComposable1_null_group1_name1_0_null""",
isDefaultStyle = false,
component = @Composable { TestComposable1() }
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
import androidx.compose.runtime.Composable
import com.airbnb.android.showkase.models.ShowkaseBrowserComponent

public val group2name2: ShowkaseBrowserComponent = ShowkaseBrowserComponent(
public val TestComposable2group2name2: ShowkaseBrowserComponent = ShowkaseBrowserComponent(
group = "group2",
componentName = "name2",
componentKDoc = "",
componentKey = """_null_group2_name2_0_null""",
componentKey = """_TestComposable2_null_group2_name2_0_null""",
isDefaultStyle = false,
component = @Composable { TestComposable2() }
)
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@ public class TestShowkaseRootCodegen : ShowkaseProvider {
public override fun getShowkaseComponents(): List<ShowkaseBrowserComponent> {

return listOf<ShowkaseBrowserComponent>(
group1name1,
group2name2,
TestComposable1group1name1,
TestComposable2group2name2,
)
}

public override fun getShowkaseColors(): List<ShowkaseBrowserColor> {

return listOf<ShowkaseBrowserColor>(
colorname,
redcolorname,
)
}

public override fun getShowkaseTypography(): List<ShowkaseBrowserTypography> {

return listOf<ShowkaseBrowserTypography>(
typographyname,
titletypographyname,
)
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// This is an auto-generated file. Please do not edit/modify this file.
import com.airbnb.android.showkase.models.ShowkaseBrowserColor

public val colorname: ShowkaseBrowserColor =
public val redcolorname: ShowkaseBrowserColor =
ShowkaseBrowserColor(
colorGroup = "color",
colorName = "name",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// This is an auto-generated file. Please do not edit/modify this file.
import com.airbnb.android.showkase.models.ShowkaseBrowserTypography

public val typographyname: ShowkaseBrowserTypography =
public val titletypographyname: ShowkaseBrowserTypography =
ShowkaseBrowserTypography(
typographyGroup = "typography",
typographyName = "name",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
insideObject = false,
insideWrapperClass = false,
showkaseKDoc = "",
generatedPropertyName = "comairbnbandroidshowkaseprocessortestinggroup1name1",
generatedPropertyName = "TestComposable1group1name1",
showkaseMetadataType = "COMPONENT",
isDefaultStyle = false,
)
public fun group1name1(): Unit {
public fun comairbnbandroidshowkaseprocessortestingTestComposable1group1name1(): Unit {
}

@ShowkaseCodegenMetadata(
Expand All @@ -30,11 +30,11 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
insideObject = false,
insideWrapperClass = false,
showkaseKDoc = "",
generatedPropertyName = "comairbnbandroidshowkaseprocessortestinggroup2name2",
generatedPropertyName = "TestComposable2group2name2",
showkaseMetadataType = "COMPONENT",
isDefaultStyle = false,
)
public fun group2name2(): Unit {
public fun comairbnbandroidshowkaseprocessortestingTestComposable2group2name2(): Unit {
}

@ShowkaseCodegenMetadata(
Expand All @@ -46,10 +46,10 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
insideObject = false,
insideWrapperClass = false,
showkaseKDoc = "",
generatedPropertyName = "comairbnbandroidshowkaseprocessortestingcolorname",
generatedPropertyName = "redcolorname",
showkaseMetadataType = "COLOR",
)
public fun colorname(): Unit {
public fun comairbnbandroidshowkaseprocessortestingredcolorname(): Unit {
}

@ShowkaseCodegenMetadata(
Expand All @@ -61,9 +61,9 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
insideObject = false,
insideWrapperClass = false,
showkaseKDoc = "",
generatedPropertyName = "comairbnbandroidshowkaseprocessortestingtypographyname",
generatedPropertyName = "titletypographyname",
showkaseMetadataType = "TYPOGRAPHY",
)
public fun typographyname(): Unit {
public fun comairbnbandroidshowkaseprocessortestingtitletypographyname(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ package com.airbnb.android.showkase_processor_testing
import androidx.compose.runtime.Composable
import com.airbnb.android.showkase.models.ShowkaseBrowserComponent

public val comairbnbandroidshowkaseprocessortestinggroup1name1: ShowkaseBrowserComponent =
ShowkaseBrowserComponent(
public val TestComposable1group1name1: ShowkaseBrowserComponent = ShowkaseBrowserComponent(
group = "group1",
componentName = "name1",
componentKDoc = "",
componentKey = """com.airbnb.android.showkase_processor_testing_null_group1_name1_0_null""",
componentKey =
"""com.airbnb.android.showkase_processor_testing_TestComposable1_null_group1_name1_0_null""",
isDefaultStyle = false,
component = @Composable { TestComposable1() }
)
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ package com.airbnb.android.showkase_processor_testing
import androidx.compose.runtime.Composable
import com.airbnb.android.showkase.models.ShowkaseBrowserComponent

public val comairbnbandroidshowkaseprocessortestinggroup2name2: ShowkaseBrowserComponent =
ShowkaseBrowserComponent(
public val TestComposable2group2name2: ShowkaseBrowserComponent = ShowkaseBrowserComponent(
group = "group2",
componentName = "name2",
componentKDoc = "",
componentKey = """com.airbnb.android.showkase_processor_testing_null_group2_name2_0_null""",
componentKey =
"""com.airbnb.android.showkase_processor_testing_TestComposable2_null_group2_name2_0_null""",
isDefaultStyle = false,
component = @Composable { TestComposable2() }
)
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ public class TestShowkaseRootCodegen : ShowkaseProvider {
public override fun getShowkaseComponents(): List<ShowkaseBrowserComponent> {

return listOf<ShowkaseBrowserComponent>(
comairbnbandroidshowkaseprocessortestinggroup1name1,
comairbnbandroidshowkaseprocessortestinggroup2name2,
TestComposable1group1name1,
TestComposable2group2name2,
)
}

public override fun getShowkaseColors(): List<ShowkaseBrowserColor> {

return listOf<ShowkaseBrowserColor>(
comairbnbandroidshowkaseprocessortestingcolorname,
redcolorname,
)
}

public override fun getShowkaseTypography(): List<ShowkaseBrowserTypography> {

return listOf<ShowkaseBrowserTypography>(
comairbnbandroidshowkaseprocessortestingtypographyname,
titletypographyname,
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.airbnb.android.showkase_processor_testing

import com.airbnb.android.showkase.models.ShowkaseBrowserColor

public val comairbnbandroidshowkaseprocessortestingcolorname: ShowkaseBrowserColor =
public val redcolorname: ShowkaseBrowserColor =
ShowkaseBrowserColor(
colorGroup = "color",
colorName = "name",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.airbnb.android.showkase_processor_testing

import com.airbnb.android.showkase.models.ShowkaseBrowserTypography

public val comairbnbandroidshowkaseprocessortestingtypographyname: ShowkaseBrowserTypography =
public val titletypographyname: ShowkaseBrowserTypography =
ShowkaseBrowserTypography(
typographyGroup = "typography",
typographyName = "name",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
insideObject = false,
insideWrapperClass = true,
showkaseKDoc = "",
generatedPropertyName = "comairbnbandroidshowkaseprocessortestingWrapperClassTestComposable1",
generatedPropertyName = "TestComposable1WrapperClassTestComposable1",
enclosingClass = [WrapperClass::class],
showkaseMetadataType = "COMPONENT",
isDefaultStyle = false,
)
public fun WrapperClassTestComposable1(): Unit {
public
fun comairbnbandroidshowkaseprocessortestingWrapperClassTestComposable1WrapperClassTestComposable1():
Unit {
}

@ShowkaseCodegenMetadata(
Expand All @@ -33,12 +35,13 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
insideObject = false,
insideWrapperClass = false,
showkaseKDoc = "",
generatedPropertyName = "comairbnbandroidshowkaseprocessortestingDefaultGroupTestComposable2",
generatedPropertyName = "TestComposable2DefaultGroupTestComposable2",
showkaseMetadataType = "COMPONENT",
isDefaultStyle = false,
previewParameterClass = [ParameterProvider::class],
previewParameterName = "text",
)
public fun DefaultGroupTestComposable2(): Unit {
public fun comairbnbandroidshowkaseprocessortestingTestComposable2DefaultGroupTestComposable2():
Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ package com.airbnb.android.showkase_processor_testing
import androidx.compose.runtime.Composable
import com.airbnb.android.showkase.models.ShowkaseBrowserComponent

public val comairbnbandroidshowkaseprocessortestingWrapperClassTestComposable1:
ShowkaseBrowserComponent = ShowkaseBrowserComponent(
public val TestComposable1WrapperClassTestComposable1: ShowkaseBrowserComponent =
ShowkaseBrowserComponent(
group = "WrapperClass",
componentName = "TestComposable1",
componentKDoc = "",
componentKey =
"""com.airbnb.android.showkase_processor_testing_com.airbnb.android.showkase_processor_testing.WrapperClass_WrapperClass_TestComposable1_0_null""",
"""com.airbnb.android.showkase_processor_testing.WrapperClass_TestComposable1_com.airbnb.android.showkase_processor_testing.WrapperClass_WrapperClass_TestComposable1_0_null""",
isDefaultStyle = false,
component = @Composable {
WrapperClass().TestComposable1()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import androidx.compose.runtime.Composable
import com.airbnb.android.showkase.models.ShowkaseBrowserComponent
import kotlin.collections.List

public val comairbnbandroidshowkaseprocessortestingDefaultGroupTestComposable2:
List<ShowkaseBrowserComponent> =
public val TestComposable2DefaultGroupTestComposable2: List<ShowkaseBrowserComponent> =
ParameterProvider()
.values
.iterator()
Expand All @@ -17,7 +16,7 @@ public val comairbnbandroidshowkaseprocessortestingDefaultGroupTestComposable2:
componentName = "TestComposable2",
componentKDoc = "",
componentKey =
"""com.airbnb.android.showkase_processor_testing_null_DefaultGroup_TestComposable2_0_null_$index""",
"""com.airbnb.android.showkase_processor_testing_TestComposable2_null_DefaultGroup_TestComposable2_0_null_$index""",
isDefaultStyle = false,
component = @Composable { TestComposable2(text = previewParam) }
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ public class TestShowkaseRootCodegen : ShowkaseProvider {
public override fun getShowkaseComponents(): List<ShowkaseBrowserComponent> {

return mutableListOf<ShowkaseBrowserComponent>(
comairbnbandroidshowkaseprocessortestingWrapperClassTestComposable1,
TestComposable1WrapperClassTestComposable1,
).apply {
addAll(comairbnbandroidshowkaseprocessortestingDefaultGroupTestComposable2)
addAll(TestComposable2DefaultGroupTestComposable2)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
insideObject = false,
insideWrapperClass = true,
showkaseKDoc = "",
generatedPropertyName = "comairbnbandroidshowkaseprocessortestinggroupname",
generatedPropertyName = "colorgroupname",
enclosingClass = [WrapperClass::class],
showkaseMetadataType = "COLOR",
)
public fun groupname(): Unit {
public fun comairbnbandroidshowkaseprocessortestingWrapperClasscolorgroupname(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class TestShowkaseRootCodegen : ShowkaseProvider {
public override fun getShowkaseColors(): List<ShowkaseBrowserColor> {

return listOf<ShowkaseBrowserColor>(
comairbnbandroidshowkaseprocessortestinggroupname,
colorgroupname,
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.airbnb.android.showkase_processor_testing

import com.airbnb.android.showkase.models.ShowkaseBrowserColor

public val comairbnbandroidshowkaseprocessortestinggroupname: ShowkaseBrowserColor =
public val colorgroupname: ShowkaseBrowserColor =
ShowkaseBrowserColor(
colorGroup = "group",
colorName = "name",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing {
insideObject = false,
insideWrapperClass = true,
showkaseKDoc = "",
generatedPropertyName = "comairbnbandroidshowkaseprocessortestingWrapperClassname",
generatedPropertyName = "colorWrapperClassname",
enclosingClass = [WrapperClass::class],
showkaseMetadataType = "COLOR",
)
public fun WrapperClassname(): Unit {
public fun comairbnbandroidshowkaseprocessortestingWrapperClasscolorWrapperClassname(): Unit {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class TestShowkaseRootCodegen : ShowkaseProvider {
public override fun getShowkaseColors(): List<ShowkaseBrowserColor> {

return listOf<ShowkaseBrowserColor>(
comairbnbandroidshowkaseprocessortestingWrapperClassname,
colorWrapperClassname,
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.airbnb.android.showkase_processor_testing

import com.airbnb.android.showkase.models.ShowkaseBrowserColor

public val comairbnbandroidshowkaseprocessortestingWrapperClassname: ShowkaseBrowserColor =
public val colorWrapperClassname: ShowkaseBrowserColor =
ShowkaseBrowserColor(
colorGroup = "WrapperClass",
colorName = "name",
Expand Down
Loading

0 comments on commit 4a09e3f

Please sign in to comment.