Skip to content

Commit

Permalink
Adding support from BumbleBee
Browse files Browse the repository at this point in the history
  • Loading branch information
thsaravana committed Nov 10, 2022
1 parent 3211a1c commit 615d605
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ intellij {

tasks {
runIde {
// Absolute path to installed target 3.5 Android Studio to use as
// Absolute path to installed target Android Studio to use as
// IDE Development Instance (the "Contents" directory is macOS specific):
ideDir.set(file("/Applications/Android Studio.app/Contents"))
}
Expand All @@ -39,7 +39,7 @@ tasks {
}

patchPluginXml {
sinceBuild.set("210")
sinceBuild.set("210") // Support from Android Studio BumbleBee
// untilBuild.set("223.*")
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/com/getyourguide/paparazzi/PaparazziWindow.kt
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ class MyPanel(toolWindow: ToolWindow, project: Project) : PaparazziWindowPanel()
toolWindow.contentManager.addContent(content)
list.cellRenderer = Renderer(project)

setContent(getContentPanel(project))
setContent(getContentPanel())
project.service.panel = this
}

private fun getContentPanel(project: Project): JPanel {
private fun getContentPanel(): JPanel {

val panel = JBPanel<SimpleToolWindowPanel>(
GridLayoutManager(
Expand Down
7 changes: 5 additions & 2 deletions src/main/kotlin/com/getyourguide/paparazzi/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,11 @@ private fun VirtualFile.snapshotName(qualifiedTestName: String): String {
}

private fun Project.recordedSnapshots(file: VirtualFile): List<VirtualFile> {
return file.getModule(this)?.rootManager?.contentRoots?.find {
it.name == "test"
val modulePath = modulePath(file)
return if (modulePath != null) {
LocalFileSystem.getInstance().findFileByPath(modulePath)?.findChild("src")?.findChild("test")
} else {
file.getModule(this)?.rootManager?.contentRoots?.find { it.name == "test" }
}?.findChild("snapshots")?.findChild("images")?.children?.toList() ?: emptyList()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class VerifyTaskCallback(
private val psiClass: PsiClass,
private val psiMethod: PsiMethod?
) : TaskCallback {

override fun onSuccess() {
project.service.loadAfterSnapshotsRecorded(psiClass, psiMethod)
deleteFailureSnapshots(psiClass, psiMethod)
Expand Down

0 comments on commit 615d605

Please sign in to comment.