-
Notifications
You must be signed in to change notification settings - Fork 214
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
Pull out SDK into its own module #1462
base: master
Are you sure you want to change the base?
Conversation
@@ -1,3 +1,5 @@ | |||
@file:Suppress("invisible_reference", "invisible_member") |
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.
allows "friend references", i.e., extending internal access across cross project-modules. By default, kotlin only allows code within the same module to access internal
members.
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.
Not K2 friendly: https://youtrack.jetbrains.com/issue/KT-67920
Maybe it is possible to befriend another module's sourceSet with this?
https://github.com/TWiStErRob/repros/blob/main/kotlin/test-fixtures-and-suites-friends/build.gradle.kts
@@ -42,7 +42,6 @@ dependencies { | |||
api libs.tools.ninepatch | |||
api libs.tools.sdkCommon | |||
api libs.kxml2 | |||
api libs.junit |
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.
🎉
"paparazzi.layoutlib.resources.root", | ||
configurations.layoutlibResources.singleFile.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.
a bit unfortunate that both the sdk and junit rule needs this; but it makes sense, the actual config in practice would come from the (gradle) plugin. might make sense to evolve the sdk into a builder pattern; i'll mess around with this in a follow-up.
@@ -329,7 +329,7 @@ public class PaparazziPlugin : Plugin<Project> { | |||
|
|||
private fun Project.addTestDependency() { | |||
val dependency = if (isInternal()) { | |||
dependencies.project(mapOf("path" to ":paparazzi")) | |||
dependencies.project(mapOf("path" to ":paparazzi-junit4")) |
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.
deliberate for now. can query gradle extension config for junit4 vs junit5, but not sure how to keep it generic for other 3rd party wrappers.
dependencies { | ||
testImplementationAarAsJar libs.androidx.compose.ui.android | ||
compileOnlyAarAsJar libs.androidx.compose.ui.android | ||
compileOnlyAarAsJar libs.androidx.compose.runtime |
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.
calling out this switcheroo; replacing compileOnlyAarAsJar libs.androidx.activity
with this: https://github.com/cashapp/paparazzi/pull/1462/files#diff-697f70cdd88ba88fe77eebda60c7e143f6ad1286bca75017421e93ad84fb87df
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.
nice, much better dependency
59ea47e
to
98db626
Compare
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.
Looks good! Looking forward to the sdk builder pattern
@@ -1,3 +1,5 @@ | |||
@file:Suppress("invisible_reference", "invisible_member") |
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.
Consider using all uppercase to highlight that you're suppressing compiler errors
@file:Suppress("invisible_reference", "invisible_member") | |
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") |
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.
Did you intentionally keep the ...:paparazzi
Maven coordinate here?
Consider publishing the -junit4 from the -junit4 module and reintroduce a :paparazzi
module that api
s both the sdk and the junit4.
} | ||
|
||
tasks.named("dokkaGfm").configure { | ||
outputDirectory = rootProject.file("docs/1.x") |
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.
Amazing that you did all this while keeping 1.x 👏🏻
@@ -28,7 +28,7 @@ import java.util.logging.Logger.getLogger | |||
* This logger delegates to java.util.Logging. | |||
*/ | |||
internal class PaparazziLogger : ILayoutLog, ILogger { |
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.
rename class to match module/logger?
Note that this does not rename the artifacts as that would be a breaking change; this should remain binary compatible until 2.0
Also, many of the files in this changeset are simply file renames/moves, so hopefully not as intimidating to review :)