Skip to content

Commit

Permalink
Make Studio releases task triggered on demand (#523)
Browse files Browse the repository at this point in the history
* Don't update the releases list automatically
* Add missing splash screens
* Remove Swing counterpart
  • Loading branch information
rock3r authored Aug 7, 2024
1 parent 9a24684 commit 865155d
Show file tree
Hide file tree
Showing 17 changed files with 5,293 additions and 559 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
@file:Suppress("UnstableApiUsage")

import com.squareup.kotlinpoet.ClassName
import io.gitlab.arturbosch.detekt.Detekt
import org.jetbrains.jewel.buildlogic.demodata.AndroidStudioReleasesGeneratorTask
import org.jetbrains.jewel.buildlogic.demodata.STUDIO_RELEASES_OUTPUT_CLASS_NAME
import org.jetbrains.jewel.buildlogic.demodata.StudioVersionsGenerationExtension
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension
import org.jetbrains.kotlin.gradle.tasks.BaseKotlinCompile

val extension: StudioVersionsGenerationExtension =
extensions.findByType<StudioVersionsGenerationExtension>()
Expand All @@ -21,12 +16,3 @@ val task =
dataUrl = extension.dataUrl
resourcesDirs = extension.resourcesDirs
}

tasks {
withType<BaseKotlinCompile> { dependsOn(task) }
withType<Detekt> { dependsOn(task) }
}

pluginManager.withPlugin("org.jetbrains.kotlin.jvm") {
the<KotlinJvmProjectExtension>().sourceSets["main"].kotlin.srcDir(extension.targetDir)
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package org.jetbrains.jewel.buildlogic.demodata

import com.squareup.kotlinpoet.ClassName
import gradle.kotlin.dsl.accessors._34fcf23848cfa0f534eebf6913e08a53.kotlin
import gradle.kotlin.dsl.accessors._34fcf23848cfa0f534eebf6913e08a53.sourceSets
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.decodeFromStream
import org.gradle.api.DefaultTask
Expand All @@ -25,7 +27,11 @@ open class StudioVersionsGenerationExtension(project: Project) {
val targetDir: DirectoryProperty =
project.objects
.directoryProperty()
.convention(project.layout.buildDirectory.dir("generated/studio-releases/"))
.convention(
project.layout.dir(
project.provider { project.sourceSets.named("main").get().kotlin.srcDirs.first() }
)
)

val resourcesDirs: SetProperty<File> =
project.objects
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ internal object AndroidStudioReleasesReader {
.apply {
indent(" ")
addFileComment("Generated by the Jewel Android Studio Releases Generator\n")
addFileComment("Generated from $url on ${ZonedDateTime.now()}\n")
addFileComment("Generated from $url on ${ZonedDateTime.now()}")

addImport("org.jetbrains.jewel.samples.ideplugin.releasessample", "ContentItem.AndroidStudio")
addImport("kotlinx.datetime", "LocalDate")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.cancel
import org.jetbrains.jewel.bridge.addComposeTab
import org.jetbrains.jewel.samples.ideplugin.releasessample.ReleasesSampleCompose
import org.jetbrains.jewel.samples.ideplugin.releasessample.ReleasesSamplePanel
import javax.swing.JComponent

@Suppress("unused")
Expand All @@ -28,12 +27,7 @@ internal class JewelDemoToolWindowFactory : ToolWindowFactory, DumbAware {
ComponentShowcaseTab()
}

toolWindow.addSwingTab(
ReleasesSamplePanel(toolWindow.disposable.createCoroutineScope()),
"Swing Sample",
)

toolWindow.addComposeTab("Compose Sample") {
toolWindow.addComposeTab("Releases Demo") {
ReleasesSampleCompose(project)
}

Expand Down

Large diffs are not rendered by default.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 865155d

Please sign in to comment.