diff --git a/.github/workflows/smokebuild.yaml b/.github/workflows/smokebuild.yaml new file mode 100644 index 0000000..25f390b --- /dev/null +++ b/.github/workflows/smokebuild.yaml @@ -0,0 +1,35 @@ +name: Smoke build + +on: + workflow_dispatch: + pull_request: + push: + branches: + - "main" + +jobs: + build: + name: Publish to MavenLocal and Build Examples + runs-on: ubuntu-latest + steps: + - name: Set up JDK + uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: '17' + + - name: Checkout code + uses: actions/checkout@v3 + + - name: Publish to Maven Local + run: ./gradlew publishToMavenLocal + + - name: Build Stories for Wasm target + run: | + cd examples + ../gradlew wasmJsBrowserStoriesProductionExecutableDistribution + + - name: Build Stories for Desktop target + run: | + cd examples + ../gradlew desktopStorytaleGenerate diff --git a/build.gradle.kts b/build.gradle.kts index 232fbb4..cc6327d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,4 +6,28 @@ plugins { alias(libs.plugins.jetbrainsCompose) apply false alias(libs.plugins.kotlinMultiplatform) apply false alias(libs.plugins.compose.compiler) apply false +} + +subprojects { + version = findProperty("storytale.deploy.version") + ?: error("'storytale.deploy.version' was not set") + + plugins.withId("maven-publish") { + configureIfExists { + repositories { + maven { + name = "ComposeRepo" + setUrl(System.getenv("COMPOSE_REPO_URL")) + credentials { + username = System.getenv("COMPOSE_REPO_USERNAME") + password = System.getenv("COMPOSE_REPO_KEY") + } + } + } + } + } +} + +inline fun Project.configureIfExists(fn: T.() -> Unit) { + extensions.findByType(T::class.java)?.fn() } \ No newline at end of file diff --git a/examples/build.gradle.kts b/examples/build.gradle.kts index f434548..5c15511 100644 --- a/examples/build.gradle.kts +++ b/examples/build.gradle.kts @@ -73,7 +73,7 @@ kotlin { } android { - namespace = "org.jetbrains.storytale.example" + namespace = "org.jetbrains.compose.storytale.example" compileSdk = libs.versions.android.compileSdk.get().toInt() sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml") @@ -81,7 +81,7 @@ android { sourceSets["main"].resources.srcDirs("src/commonMain/resources") defaultConfig { - applicationId = "org.jetbrains.storytale.example" + applicationId = "org.jetbrains.compose.storytale.example" minSdk = libs.versions.android.minSdk.get().toInt() targetSdk = libs.versions.android.targetSdk.get().toInt() versionCode = 1 @@ -111,7 +111,7 @@ android { compose.resources { publicResClass = true - packageOfResClass = "org.jetbrains.storytale.example" + packageOfResClass = "org.jetbrains.compose.storytale.example" } compose.desktop { @@ -120,7 +120,7 @@ compose.desktop { nativeDistributions { targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb) - packageName = "org.jetbrains.storytale" + packageName = "org.jetbrains.compose.storytale" packageVersion = "1.0.0" } } diff --git a/examples/settings.gradle.kts b/examples/settings.gradle.kts index 16bff74..44998ba 100644 --- a/examples/settings.gradle.kts +++ b/examples/settings.gradle.kts @@ -1,9 +1,11 @@ rootProject.name = "StorytaleUsageExamples" enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") +val storytaleVersion = + providers.gradleProperty("storytale.deploy.version").orNull?.takeIf(String::isNotBlank) + pluginManagement { repositories { - maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev") google { mavenContent { includeGroupAndSubgroups("androidx") @@ -26,8 +28,13 @@ dependencyResolutionManagement { includeGroupAndSubgroups("com.google") } } - maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev") mavenCentral() mavenLocal() } + + if (storytaleVersion != null) { + versionCatalogs.register("libs") { + version("storytale", storytaleVersion) + } + } } \ No newline at end of file diff --git a/examples/src/androidMain/AndroidManifest.xml b/examples/src/androidMain/AndroidManifest.xml index c5db0b1..21cc518 100644 --- a/examples/src/androidMain/AndroidManifest.xml +++ b/examples/src/androidMain/AndroidManifest.xml @@ -11,7 +11,7 @@ + android:name="org.jetbrains.storytale.example.MainActivity"> diff --git a/examples/src/commonMain/kotlin/ComposeLogo.kt b/examples/src/commonMain/kotlin/ComposeLogo.kt index 0a32196..0f8067d 100644 --- a/examples/src/commonMain/kotlin/ComposeLogo.kt +++ b/examples/src/commonMain/kotlin/ComposeLogo.kt @@ -4,8 +4,8 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import org.jetbrains.compose.resources.painterResource -import org.jetbrains.storytale.example.Res -import org.jetbrains.storytale.example.compose_multiplatform +import org.jetbrains.compose.storytale.example.Res +import org.jetbrains.compose.storytale.example.compose_multiplatform @Composable fun ComposeLogo(size: LogoSize = LogoSize.MEDIUM) { diff --git a/gradle.properties b/gradle.properties index af750b9..58c88f3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,7 +8,6 @@ android.nonTransitiveRClass=true android.useAndroidX=true #Compose -org.jetbrains.compose.experimental.wasm.enabled=true org.jetbrains.compose.experimental.jscanvas.enabled=true #MPP @@ -16,3 +15,6 @@ kotlin.mpp.androidSourceSetLayoutVersion=2 kotlin.mpp.enableCInteropCommonization=true kotlin.jvm.target.validation.mode=ignore + +#Publication +storytale.deploy.version=0.0.1-SNAPSHOT diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index fb2f93a..dbabb6d 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,7 +3,7 @@ agp = "8.7.1" android-compileSdk = "35" android-minSdk = "26" android-targetSdk = "35" -storytale = "1.1" +storytale = "0.0.1" androidx-activityCompose = "1.9.3" androidx-appcompat = "1.7.0" diff --git a/modules/compiler-plugin/build.gradle.kts b/modules/compiler-plugin/build.gradle.kts index d564b21..871ee85 100644 --- a/modules/compiler-plugin/build.gradle.kts +++ b/modules/compiler-plugin/build.gradle.kts @@ -7,7 +7,7 @@ plugins { } dependencies { - implementation("org.jetbrains.kotlin:kotlin-compiler-embeddable:2.0.0") + implementation(kotlin("compiler-embeddable")) } sourceSets { @@ -17,8 +17,7 @@ sourceSets { } } -group = "org.jetbrains.compose" -version = libs.versions.storytale.get() +group = "org.jetbrains.compose.storytale" val emptyJavadocJar by tasks.registering(Jar::class) { archiveClassifier.set("javadoc") @@ -27,7 +26,7 @@ val emptyJavadocJar by tasks.registering(Jar::class) { publishing { publications { create("maven") { - artifactId = "storytale-compiler-plugin" + artifactId = "compiler-plugin" from(components["kotlin"]) } withType { diff --git a/modules/gallery/build.gradle.kts b/modules/gallery/build.gradle.kts index e4ed300..7762ecb 100644 --- a/modules/gallery/build.gradle.kts +++ b/modules/gallery/build.gradle.kts @@ -92,12 +92,11 @@ kotlin { } group = "org.jetbrains.compose.storytale" -version = libs.versions.storytale.get() publishing {} android { - namespace = "org.jetbrains.storytale.gallery" + namespace = "org.jetbrains.compose.storytale.gallery" compileSdk = libs.versions.android.compileSdk.get().toInt() sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml") defaultConfig { diff --git a/modules/gallery/src/commonMain/kotlin/Gallery.kt b/modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/Gallery.kt similarity index 100% rename from modules/gallery/src/commonMain/kotlin/Gallery.kt rename to modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/Gallery.kt diff --git a/modules/gallery/src/commonMain/kotlin/compose/AnnotatedString.kt b/modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/compose/AnnotatedString.kt similarity index 100% rename from modules/gallery/src/commonMain/kotlin/compose/AnnotatedString.kt rename to modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/compose/AnnotatedString.kt diff --git a/modules/gallery/src/commonMain/kotlin/compose/CompositionLocal.kt b/modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/compose/CompositionLocal.kt similarity index 100% rename from modules/gallery/src/commonMain/kotlin/compose/CompositionLocal.kt rename to modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/compose/CompositionLocal.kt diff --git a/modules/gallery/src/commonMain/kotlin/compose/Effect.kt b/modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/compose/Effect.kt similarity index 100% rename from modules/gallery/src/commonMain/kotlin/compose/Effect.kt rename to modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/compose/Effect.kt diff --git a/modules/gallery/src/commonMain/kotlin/compose/Modifier.kt b/modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/compose/Modifier.kt similarity index 100% rename from modules/gallery/src/commonMain/kotlin/compose/Modifier.kt rename to modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/compose/Modifier.kt diff --git a/modules/gallery/src/commonMain/kotlin/compose/Remember.kt b/modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/compose/Remember.kt similarity index 100% rename from modules/gallery/src/commonMain/kotlin/compose/Remember.kt rename to modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/compose/Remember.kt diff --git a/modules/gallery/src/commonMain/kotlin/event/EventCenter.kt b/modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/event/EventCenter.kt similarity index 100% rename from modules/gallery/src/commonMain/kotlin/event/EventCenter.kt rename to modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/event/EventCenter.kt diff --git a/modules/gallery/src/commonMain/kotlin/navigation/Route.kt b/modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/navigation/Route.kt similarity index 100% rename from modules/gallery/src/commonMain/kotlin/navigation/Route.kt rename to modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/navigation/Route.kt diff --git a/modules/gallery/src/commonMain/kotlin/platform/StoryGallery.kt b/modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/platform/StoryGallery.kt similarity index 100% rename from modules/gallery/src/commonMain/kotlin/platform/StoryGallery.kt rename to modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/platform/StoryGallery.kt diff --git a/modules/gallery/src/commonMain/kotlin/story/StoryEmptyStatus.kt b/modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/story/StoryEmptyStatus.kt similarity index 100% rename from modules/gallery/src/commonMain/kotlin/story/StoryEmptyStatus.kt rename to modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/story/StoryEmptyStatus.kt diff --git a/modules/gallery/src/commonMain/kotlin/story/StoryList.kt b/modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/story/StoryList.kt similarity index 100% rename from modules/gallery/src/commonMain/kotlin/story/StoryList.kt rename to modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/story/StoryList.kt diff --git a/modules/gallery/src/commonMain/kotlin/story/StoryListItem.kt b/modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/story/StoryListItem.kt similarity index 100% rename from modules/gallery/src/commonMain/kotlin/story/StoryListItem.kt rename to modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/story/StoryListItem.kt diff --git a/modules/gallery/src/commonMain/kotlin/story/StoryNavigationBar.kt b/modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/story/StoryNavigationBar.kt similarity index 100% rename from modules/gallery/src/commonMain/kotlin/story/StoryNavigationBar.kt rename to modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/story/StoryNavigationBar.kt diff --git a/modules/gallery/src/commonMain/kotlin/story/StoryParameter.kt b/modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/story/StoryParameter.kt similarity index 97% rename from modules/gallery/src/commonMain/kotlin/story/StoryParameter.kt rename to modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/story/StoryParameter.kt index 77a9a61..b974cf2 100644 --- a/modules/gallery/src/commonMain/kotlin/story/StoryParameter.kt +++ b/modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/story/StoryParameter.kt @@ -37,7 +37,7 @@ import org.jetbrains.compose.storytale.gallery.story.parameters.StringParameterF import org.jetbrains.compose.storytale.gallery.ui.component.CenterRow import org.jetbrains.compose.storytale.gallery.ui.component.Gap import org.jetbrains.compose.storytale.gallery.ui.theme.currentColorScheme -import utils.cast +import org.jetbrains.compose.storytale.gallery.utils.cast @Composable fun StoryParameter( @@ -90,8 +90,8 @@ fun StoryParameter( @Composable private fun StoryParameterContent( - parameters: List>, - modifier: Modifier = Modifier + parameters: List>, + modifier: Modifier = Modifier ) = when (parameters.isEmpty()) { true -> Box( modifier = modifier.fillMaxSize(), diff --git a/modules/gallery/src/commonMain/kotlin/story/StorySearchBar.kt b/modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/story/StorySearchBar.kt similarity index 100% rename from modules/gallery/src/commonMain/kotlin/story/StorySearchBar.kt rename to modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/story/StorySearchBar.kt diff --git a/modules/gallery/src/commonMain/kotlin/story/StorySearchList.kt b/modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/story/StorySearchList.kt similarity index 100% rename from modules/gallery/src/commonMain/kotlin/story/StorySearchList.kt rename to modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/story/StorySearchList.kt diff --git a/modules/gallery/src/commonMain/kotlin/story/code/CodeBlock.kt b/modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/story/code/CodeBlock.kt similarity index 100% rename from modules/gallery/src/commonMain/kotlin/story/code/CodeBlock.kt rename to modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/story/code/CodeBlock.kt diff --git a/modules/gallery/src/commonMain/kotlin/story/parameters/BooleanParameterField.kt b/modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/story/parameters/BooleanParameterField.kt similarity index 100% rename from modules/gallery/src/commonMain/kotlin/story/parameters/BooleanParameterField.kt rename to modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/story/parameters/BooleanParameterField.kt diff --git a/modules/gallery/src/commonMain/kotlin/story/parameters/ParameterLabel.kt b/modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/story/parameters/ParameterLabel.kt similarity index 100% rename from modules/gallery/src/commonMain/kotlin/story/parameters/ParameterLabel.kt rename to modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/story/parameters/ParameterLabel.kt diff --git a/modules/gallery/src/commonMain/kotlin/story/parameters/StringParameterField.kt b/modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/story/parameters/StringParameterField.kt similarity index 100% rename from modules/gallery/src/commonMain/kotlin/story/parameters/StringParameterField.kt rename to modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/story/parameters/StringParameterField.kt diff --git a/modules/gallery/src/commonMain/kotlin/ui/component/CenterRow.kt b/modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/ui/component/CenterRow.kt similarity index 100% rename from modules/gallery/src/commonMain/kotlin/ui/component/CenterRow.kt rename to modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/ui/component/CenterRow.kt diff --git a/modules/gallery/src/commonMain/kotlin/ui/component/Gap.kt b/modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/ui/component/Gap.kt similarity index 100% rename from modules/gallery/src/commonMain/kotlin/ui/component/Gap.kt rename to modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/ui/component/Gap.kt diff --git a/modules/gallery/src/commonMain/kotlin/ui/component/HorizontalSplitPane.kt b/modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/ui/component/HorizontalSplitPane.kt similarity index 100% rename from modules/gallery/src/commonMain/kotlin/ui/component/HorizontalSplitPane.kt rename to modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/ui/component/HorizontalSplitPane.kt diff --git a/modules/gallery/src/commonMain/kotlin/ui/component/IconButton.kt b/modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/ui/component/IconButton.kt similarity index 100% rename from modules/gallery/src/commonMain/kotlin/ui/component/IconButton.kt rename to modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/ui/component/IconButton.kt diff --git a/modules/gallery/src/commonMain/kotlin/ui/component/NumberChip.kt b/modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/ui/component/NumberChip.kt similarity index 100% rename from modules/gallery/src/commonMain/kotlin/ui/component/NumberChip.kt rename to modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/ui/component/NumberChip.kt diff --git a/modules/gallery/src/commonMain/kotlin/ui/component/StoryToast.kt b/modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/ui/component/StoryToast.kt similarity index 100% rename from modules/gallery/src/commonMain/kotlin/ui/component/StoryToast.kt rename to modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/ui/component/StoryToast.kt diff --git a/modules/gallery/src/commonMain/kotlin/ui/component/SwitchButton.kt b/modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/ui/component/SwitchButton.kt similarity index 100% rename from modules/gallery/src/commonMain/kotlin/ui/component/SwitchButton.kt rename to modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/ui/component/SwitchButton.kt diff --git a/modules/gallery/src/commonMain/kotlin/ui/component/sheet/StoryBottomSheet.kt b/modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/ui/component/sheet/StoryBottomSheet.kt similarity index 100% rename from modules/gallery/src/commonMain/kotlin/ui/component/sheet/StoryBottomSheet.kt rename to modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/ui/component/sheet/StoryBottomSheet.kt diff --git a/modules/gallery/src/commonMain/kotlin/ui/component/sheet/StoryBottomSheetState.kt b/modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/ui/component/sheet/StoryBottomSheetState.kt similarity index 100% rename from modules/gallery/src/commonMain/kotlin/ui/component/sheet/StoryBottomSheetState.kt rename to modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/ui/component/sheet/StoryBottomSheetState.kt diff --git a/modules/gallery/src/commonMain/kotlin/ui/theme/ColorScheme.kt b/modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/ui/theme/ColorScheme.kt similarity index 100% rename from modules/gallery/src/commonMain/kotlin/ui/theme/ColorScheme.kt rename to modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/ui/theme/ColorScheme.kt diff --git a/modules/gallery/src/commonMain/kotlin/ui/theme/StoryGalleryTheme.kt b/modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/ui/theme/StoryGalleryTheme.kt similarity index 100% rename from modules/gallery/src/commonMain/kotlin/ui/theme/StoryGalleryTheme.kt rename to modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/ui/theme/StoryGalleryTheme.kt diff --git a/modules/gallery/src/commonMain/kotlin/ui/theme/Typography.kt b/modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/ui/theme/Typography.kt similarity index 100% rename from modules/gallery/src/commonMain/kotlin/ui/theme/Typography.kt rename to modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/ui/theme/Typography.kt diff --git a/modules/gallery/src/commonMain/kotlin/utils/ScreenSize.kt b/modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/utils/ScreenSize.kt similarity index 100% rename from modules/gallery/src/commonMain/kotlin/utils/ScreenSize.kt rename to modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/utils/ScreenSize.kt diff --git a/modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/utils/cast.kt b/modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/utils/cast.kt new file mode 100644 index 0000000..cd04027 --- /dev/null +++ b/modules/gallery/src/commonMain/kotlin/org/jetbrains/compose/storytale/gallery/utils/cast.kt @@ -0,0 +1,6 @@ +package org.jetbrains.compose.storytale.gallery.utils + +@Throws(ClassCastException::class) +internal inline fun Any?.cast(): T = this as T + +internal inline fun Any?.castOrNull(): T? = this as? T diff --git a/modules/gallery/src/commonMain/kotlin/utils/cast.kt b/modules/gallery/src/commonMain/kotlin/utils/cast.kt deleted file mode 100644 index afded33..0000000 --- a/modules/gallery/src/commonMain/kotlin/utils/cast.kt +++ /dev/null @@ -1,6 +0,0 @@ -package utils - -@Throws(ClassCastException::class) -inline fun Any?.cast(): T = this as T - -inline fun Any?.castOrNull(): T? = this as? T diff --git a/modules/gallery/src/desktopMain/kotlin/DesktopCodeBlock.kt b/modules/gallery/src/desktopMain/kotlin/org/jetbrains/compose/storytale/gallery/DesktopCodeBlock.kt similarity index 99% rename from modules/gallery/src/desktopMain/kotlin/DesktopCodeBlock.kt rename to modules/gallery/src/desktopMain/kotlin/org/jetbrains/compose/storytale/gallery/DesktopCodeBlock.kt index 244d152..2670041 100644 --- a/modules/gallery/src/desktopMain/kotlin/DesktopCodeBlock.kt +++ b/modules/gallery/src/desktopMain/kotlin/org/jetbrains/compose/storytale/gallery/DesktopCodeBlock.kt @@ -1,3 +1,5 @@ +package org.jetbrains.compose.storytale.gallery + import androidx.compose.animation.AnimatedVisibility import androidx.compose.animation.EnterTransition import androidx.compose.animation.ExitTransition diff --git a/modules/gallery/src/desktopMain/kotlin/platform/StoryGallery.desktop.kt b/modules/gallery/src/desktopMain/kotlin/org/jetbrains/compose/storytale/gallery/platform/StoryGallery.desktop.kt similarity index 98% rename from modules/gallery/src/desktopMain/kotlin/platform/StoryGallery.desktop.kt rename to modules/gallery/src/desktopMain/kotlin/org/jetbrains/compose/storytale/gallery/platform/StoryGallery.desktop.kt index b83ab10..812493b 100644 --- a/modules/gallery/src/desktopMain/kotlin/platform/StoryGallery.desktop.kt +++ b/modules/gallery/src/desktopMain/kotlin/org/jetbrains/compose/storytale/gallery/platform/StoryGallery.desktop.kt @@ -1,6 +1,6 @@ package org.jetbrains.compose.storytale.gallery.platform -import DesktopCodeBlock +import org.jetbrains.compose.storytale.gallery.DesktopCodeBlock import androidx.compose.animation.AnimatedContent import androidx.compose.animation.AnimatedContentTransitionScope.SlideDirection.Companion.Start import androidx.compose.animation.core.animateDpAsState diff --git a/modules/gallery/src/desktopMain/kotlin/utils/ScreenSize.desktop.kt b/modules/gallery/src/desktopMain/kotlin/org/jetbrains/compose/storytale/gallery/utils/ScreenSize.desktop.kt similarity index 100% rename from modules/gallery/src/desktopMain/kotlin/utils/ScreenSize.desktop.kt rename to modules/gallery/src/desktopMain/kotlin/org/jetbrains/compose/storytale/gallery/utils/ScreenSize.desktop.kt diff --git a/modules/gallery/src/iosMain/kotlin/utils/ScreenSize.ios.kt b/modules/gallery/src/iosMain/kotlin/org/jetbrains/compose/storytale/gallery/utils/ScreenSize.ios.kt similarity index 100% rename from modules/gallery/src/iosMain/kotlin/utils/ScreenSize.ios.kt rename to modules/gallery/src/iosMain/kotlin/org/jetbrains/compose/storytale/gallery/utils/ScreenSize.ios.kt diff --git a/modules/gallery/src/mobileMain/kotlin/MobileGallery.kt b/modules/gallery/src/mobileMain/kotlin/org/jetbrains/compose/storytale/gallery/MobileGallery.kt similarity index 98% rename from modules/gallery/src/mobileMain/kotlin/MobileGallery.kt rename to modules/gallery/src/mobileMain/kotlin/org/jetbrains/compose/storytale/gallery/MobileGallery.kt index 03f0169..dee772f 100644 --- a/modules/gallery/src/mobileMain/kotlin/MobileGallery.kt +++ b/modules/gallery/src/mobileMain/kotlin/org/jetbrains/compose/storytale/gallery/MobileGallery.kt @@ -1,3 +1,5 @@ +package org.jetbrains.compose.storytale.gallery + import androidx.compose.foundation.background import androidx.compose.foundation.layout.* import androidx.compose.material3.HorizontalDivider diff --git a/modules/gallery/src/mobileMain/kotlin/MobileStoryParameterSheet.kt b/modules/gallery/src/mobileMain/kotlin/org/jetbrains/compose/storytale/gallery/MobileStoryParameterSheet.kt similarity index 99% rename from modules/gallery/src/mobileMain/kotlin/MobileStoryParameterSheet.kt rename to modules/gallery/src/mobileMain/kotlin/org/jetbrains/compose/storytale/gallery/MobileStoryParameterSheet.kt index ac2086b..7b3398c 100644 --- a/modules/gallery/src/mobileMain/kotlin/MobileStoryParameterSheet.kt +++ b/modules/gallery/src/mobileMain/kotlin/org/jetbrains/compose/storytale/gallery/MobileStoryParameterSheet.kt @@ -1,3 +1,5 @@ +package org.jetbrains.compose.storytale.gallery + import androidx.compose.animation.AnimatedContent import androidx.compose.animation.AnimatedContentTransitionScope.SlideDirection.Companion.Down import androidx.compose.animation.AnimatedContentTransitionScope.SlideDirection.Companion.Up diff --git a/modules/gallery/src/mobileMain/kotlin/platform/StoryGallery.mobile.kt b/modules/gallery/src/mobileMain/kotlin/org/jetbrains/compose/storytale/gallery/platform/StoryGallery.mobile.kt similarity index 97% rename from modules/gallery/src/mobileMain/kotlin/platform/StoryGallery.mobile.kt rename to modules/gallery/src/mobileMain/kotlin/org/jetbrains/compose/storytale/gallery/platform/StoryGallery.mobile.kt index 48fcba5..e356e68 100644 --- a/modules/gallery/src/mobileMain/kotlin/platform/StoryGallery.mobile.kt +++ b/modules/gallery/src/mobileMain/kotlin/org/jetbrains/compose/storytale/gallery/platform/StoryGallery.mobile.kt @@ -1,6 +1,6 @@ package org.jetbrains.compose.storytale.gallery.platform -import MobileGallery +import org.jetbrains.compose.storytale.gallery.MobileGallery import androidx.compose.animation.AnimatedContentTransitionScope.SlideDirection.Companion.End import androidx.compose.animation.AnimatedContentTransitionScope.SlideDirection.Companion.Start import androidx.compose.animation.core.tween diff --git a/modules/gradle-plugin/build.gradle.kts b/modules/gradle-plugin/build.gradle.kts index 7de518c..52b7ae6 100644 --- a/modules/gradle-plugin/build.gradle.kts +++ b/modules/gradle-plugin/build.gradle.kts @@ -11,7 +11,7 @@ gradlePlugin { plugins { create("storytale") { id = "org.jetbrains.compose.storytale" - implementationClass = "org.jetbrains.compose.plugin.storytale.StorytaleGradlePlugin" + implementationClass = "org.jetbrains.compose.storytale.plugin.StorytaleGradlePlugin" } } } @@ -24,8 +24,7 @@ dependencies { implementation(libs.kotlin.poet) } -group = "org.jetbrains.compose" -version = libs.versions.storytale.get() +group = "org.jetbrains.compose.storytale" val emptyJavadocJar by tasks.registering(Jar::class) { archiveClassifier.set("javadoc") @@ -34,7 +33,7 @@ val emptyJavadocJar by tasks.registering(Jar::class) { publishing { publications { create("maven") { - artifactId = "storytale" + artifactId = "gradle-plugin" from(components["kotlin"]) } withType { @@ -49,12 +48,12 @@ tasks.withType().configureEach { buildTimeConfig { config { - packageName.set("org.jetbrains.compose.plugin.storytale") + packageName.set("org.jetbrains.compose.storytale.plugin") objectName.set("BuildTimeConfig") destination.set(project.layout.buildDirectory.get().asFile) configProperties { - val PROJECT_VERSION: String by string(libs.versions.storytale.get()) + val PROJECT_VERSION: String by string(version as String) } } } \ No newline at end of file diff --git a/modules/gradle-plugin/src/main/kotlin/AndroidMultiplatformTask.kt b/modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/AndroidMultiplatformTask.kt similarity index 99% rename from modules/gradle-plugin/src/main/kotlin/AndroidMultiplatformTask.kt rename to modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/AndroidMultiplatformTask.kt index 2cca78b..a3d9116 100644 --- a/modules/gradle-plugin/src/main/kotlin/AndroidMultiplatformTask.kt +++ b/modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/AndroidMultiplatformTask.kt @@ -1,4 +1,4 @@ -package org.jetbrains.compose.plugin.storytale +package org.jetbrains.compose.storytale.plugin import com.android.build.gradle.AppExtension import com.android.build.gradle.api.ApplicationVariant diff --git a/modules/gradle-plugin/src/main/kotlin/AndroidSourceGeneratorTask.kt b/modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/AndroidSourceGeneratorTask.kt similarity index 98% rename from modules/gradle-plugin/src/main/kotlin/AndroidSourceGeneratorTask.kt rename to modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/AndroidSourceGeneratorTask.kt index 977d5f0..f22ab74 100644 --- a/modules/gradle-plugin/src/main/kotlin/AndroidSourceGeneratorTask.kt +++ b/modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/AndroidSourceGeneratorTask.kt @@ -1,4 +1,4 @@ -package org.jetbrains.compose.plugin.storytale +package org.jetbrains.compose.storytale.plugin import com.squareup.kotlinpoet.* import org.gradle.api.DefaultTask diff --git a/modules/gradle-plugin/src/main/kotlin/JsMultiplatformTasks.kt b/modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/JsMultiplatformTasks.kt similarity index 97% rename from modules/gradle-plugin/src/main/kotlin/JsMultiplatformTasks.kt rename to modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/JsMultiplatformTasks.kt index 56c01b2..c468f9b 100644 --- a/modules/gradle-plugin/src/main/kotlin/JsMultiplatformTasks.kt +++ b/modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/JsMultiplatformTasks.kt @@ -1,4 +1,5 @@ -package org.jetbrains.compose.plugin.storytale +@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") +package org.jetbrains.compose.storytale.plugin import org.gradle.api.Project import org.gradle.api.file.DuplicatesStrategy diff --git a/modules/gradle-plugin/src/main/kotlin/JsSourceGeneratorTask.kt b/modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/JsSourceGeneratorTask.kt similarity index 94% rename from modules/gradle-plugin/src/main/kotlin/JsSourceGeneratorTask.kt rename to modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/JsSourceGeneratorTask.kt index a0e6d19..2788aa6 100644 --- a/modules/gradle-plugin/src/main/kotlin/JsSourceGeneratorTask.kt +++ b/modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/JsSourceGeneratorTask.kt @@ -1,4 +1,4 @@ -package org.jetbrains.compose.plugin.storytale +package org.jetbrains.compose.storytale.plugin import com.squareup.kotlinpoet.AnnotationSpec import com.squareup.kotlinpoet.ClassName @@ -75,7 +75,7 @@ open class JsSourceGeneratorTask : DefaultTask() { | | Gallery | - | + | | | | diff --git a/modules/gradle-plugin/src/main/kotlin/JvmMultiplatformTasks.kt b/modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/JvmMultiplatformTasks.kt similarity index 98% rename from modules/gradle-plugin/src/main/kotlin/JvmMultiplatformTasks.kt rename to modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/JvmMultiplatformTasks.kt index a646bbd..ca7dbbb 100644 --- a/modules/gradle-plugin/src/main/kotlin/JvmMultiplatformTasks.kt +++ b/modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/JvmMultiplatformTasks.kt @@ -1,4 +1,4 @@ -package org.jetbrains.compose.plugin.storytale +package org.jetbrains.compose.storytale.plugin import org.gradle.api.Project import org.gradle.api.file.FileCollection diff --git a/modules/gradle-plugin/src/main/kotlin/JvmSourceGeneratorTask.kt b/modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/JvmSourceGeneratorTask.kt similarity index 97% rename from modules/gradle-plugin/src/main/kotlin/JvmSourceGeneratorTask.kt rename to modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/JvmSourceGeneratorTask.kt index 24aa962..3e09f5c 100644 --- a/modules/gradle-plugin/src/main/kotlin/JvmSourceGeneratorTask.kt +++ b/modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/JvmSourceGeneratorTask.kt @@ -1,4 +1,4 @@ -package org.jetbrains.compose.plugin.storytale +package org.jetbrains.compose.storytale.plugin import com.squareup.kotlinpoet.FileSpec import org.gradle.api.DefaultTask diff --git a/modules/gradle-plugin/src/main/kotlin/NativeCopyResourcesTask.kt b/modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/NativeCopyResourcesTask.kt similarity index 97% rename from modules/gradle-plugin/src/main/kotlin/NativeCopyResourcesTask.kt rename to modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/NativeCopyResourcesTask.kt index 4d47c74..3798832 100644 --- a/modules/gradle-plugin/src/main/kotlin/NativeCopyResourcesTask.kt +++ b/modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/NativeCopyResourcesTask.kt @@ -1,4 +1,4 @@ -package org.jetbrains.compose.plugin.storytale +package org.jetbrains.compose.storytale.plugin import org.gradle.api.DefaultTask import org.gradle.api.file.DirectoryProperty diff --git a/modules/gradle-plugin/src/main/kotlin/NativeMultiplatformTasks.kt b/modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/NativeMultiplatformTasks.kt similarity index 92% rename from modules/gradle-plugin/src/main/kotlin/NativeMultiplatformTasks.kt rename to modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/NativeMultiplatformTasks.kt index 33daac4..31333f2 100644 --- a/modules/gradle-plugin/src/main/kotlin/NativeMultiplatformTasks.kt +++ b/modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/NativeMultiplatformTasks.kt @@ -1,13 +1,12 @@ -package org.jetbrains.compose.plugin.storytale +@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") +package org.jetbrains.compose.storytale.plugin import org.gradle.api.GradleException import org.gradle.api.Project import org.gradle.api.Task import org.gradle.api.provider.Property -import org.gradle.api.provider.Provider import org.gradle.configurationcache.extensions.capitalized import org.gradle.kotlin.dsl.property -import org.gradle.kotlin.dsl.provideDelegate import org.gradle.kotlin.dsl.task import org.jetbrains.kotlin.gradle.plugin.KotlinCompilation import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeCompilation @@ -27,9 +26,9 @@ fun Project.processNativeCompilation(extension: StorytaleExtension, target: Kotl } private fun Project.createNativeStorytaleCompileTask( - extension: StorytaleExtension, - target: KotlinNativeTarget, - generatorTask: NativeSourceGeneratorTask + extension: StorytaleExtension, + target: KotlinNativeTarget, + generatorTask: NativeSourceGeneratorTask ): KotlinNativeCompilation { val storytaleBuildDir = extension.getBuildDirectory(target) val mainCompilation = target.compilations.named(KotlinCompilation.MAIN_COMPILATION_NAME).get() @@ -70,8 +69,8 @@ private fun Project.createNativeStorytaleCompileTask( } private fun Project.createNativeStorytaleGenerateSourceTask( - extension: StorytaleExtension, - target: KotlinNativeTarget + extension: StorytaleExtension, + target: KotlinNativeTarget ): NativeSourceGeneratorTask { val storytaleBuildDir = extension.getBuildDirectory(target) return task("${target.name}${StorytaleGradlePlugin.STORYTALE_GENERATE_SUFFIX}") { @@ -84,9 +83,9 @@ private fun Project.createNativeStorytaleGenerateSourceTask( } private fun Project.createNativeStorytaleExecTask( - compilation: KotlinNativeCompilation, - extension: StorytaleExtension, - target: KotlinNativeTarget + compilation: KotlinNativeCompilation, + extension: StorytaleExtension, + target: KotlinNativeTarget ): Task? { if (!target.name.contains("Simulator")) return null @@ -194,11 +193,11 @@ private fun Project.findAvailableIOsRuntime(): String { } private fun Project.createBuildTask( - targetSuffix: String, - deviceId: Property, - unzipResourceTask: UnzipResourceTask, - simulatorRegistrationTask: Task, - linkTask: KotlinNativeLink + targetSuffix: String, + deviceId: Property, + unzipResourceTask: UnzipResourceTask, + simulatorRegistrationTask: Task, + linkTask: KotlinNativeLink ): Task { return task("${StorytaleGradlePlugin.STORYTALE_TASK_GROUP}Build$targetSuffix") { group = StorytaleGradlePlugin.STORYTALE_TASK_GROUP @@ -236,12 +235,12 @@ private fun Project.createBuildTask( } private fun Project.createCopyNativeResourcesTask( - platform: String, - target: KotlinNativeTarget, - targetSuffix: String, - compilation: KotlinNativeCompilation, - unzipResourceTask: UnzipResourceTask, - buildTask: Task + platform: String, + target: KotlinNativeTarget, + targetSuffix: String, + compilation: KotlinNativeCompilation, + unzipResourceTask: UnzipResourceTask, + buildTask: Task ): NativeCopyResourcesTask { val frameworkResources = files().apply { compilation.allKotlinSourceSets.forAll { from(it.resources.sourceDirectories) } @@ -267,12 +266,12 @@ private fun Project.createCopyNativeResourcesTask( } private fun Project.createInstallApplicationToSimulatorTask( - deviceId: Property, - targetSuffix: String, - platform: String, - unzipResourceTask: UnzipResourceTask, - buildTask: Task, - copyResourcesTask: Task + deviceId: Property, + targetSuffix: String, + platform: String, + unzipResourceTask: UnzipResourceTask, + buildTask: Task, + copyResourcesTask: Task ): Task { return task("${StorytaleGradlePlugin.STORYTALE_TASK_GROUP}InstallApp$targetSuffix") { group = StorytaleGradlePlugin.STORYTALE_TASK_GROUP diff --git a/modules/gradle-plugin/src/main/kotlin/NativeSourceGeneratorTask.kt b/modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/NativeSourceGeneratorTask.kt similarity index 96% rename from modules/gradle-plugin/src/main/kotlin/NativeSourceGeneratorTask.kt rename to modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/NativeSourceGeneratorTask.kt index 5699862..c4dc368 100644 --- a/modules/gradle-plugin/src/main/kotlin/NativeSourceGeneratorTask.kt +++ b/modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/NativeSourceGeneratorTask.kt @@ -1,4 +1,4 @@ -package org.jetbrains.compose.plugin.storytale +package org.jetbrains.compose.storytale.plugin import com.squareup.kotlinpoet.ClassName import com.squareup.kotlinpoet.FileSpec diff --git a/modules/gradle-plugin/src/main/kotlin/StorytaleExtension.kt b/modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/StorytaleExtension.kt similarity index 96% rename from modules/gradle-plugin/src/main/kotlin/StorytaleExtension.kt rename to modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/StorytaleExtension.kt index 00f92f8..5b42e85 100644 --- a/modules/gradle-plugin/src/main/kotlin/StorytaleExtension.kt +++ b/modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/StorytaleExtension.kt @@ -1,4 +1,4 @@ -package org.jetbrains.compose.plugin.storytale +package org.jetbrains.compose.storytale.plugin import org.gradle.api.Project import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension diff --git a/modules/gradle-plugin/src/main/kotlin/StorytaleGradlePlugin.kt b/modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/StorytaleGradlePlugin.kt similarity index 91% rename from modules/gradle-plugin/src/main/kotlin/StorytaleGradlePlugin.kt rename to modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/StorytaleGradlePlugin.kt index cc15d11..df07604 100644 --- a/modules/gradle-plugin/src/main/kotlin/StorytaleGradlePlugin.kt +++ b/modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/StorytaleGradlePlugin.kt @@ -1,4 +1,4 @@ -package org.jetbrains.compose.plugin.storytale +package org.jetbrains.compose.storytale.plugin import org.gradle.api.Project import org.jetbrains.kotlin.gradle.plugin.KotlinCompilation @@ -23,12 +23,12 @@ class StorytaleGradlePlugin : KotlinCompilerPluginSupportPlugin { } } - override fun getCompilerPluginId() = PLUGIN_ID + override fun getCompilerPluginId() = COMPILER_PLUGIN_ID override fun isApplicable(kotlinCompilation: KotlinCompilation<*>) = true override fun getPluginArtifact() = - SubpluginArtifact("org.jetbrains.compose", "storytale-compiler-plugin", VERSION) + SubpluginArtifact("org.jetbrains.compose.storytale", "compiler-plugin", VERSION) override fun applyToCompilation(kotlinCompilation: KotlinCompilation<*>) = kotlinCompilation.target.project.provider { emptyList() } @@ -50,7 +50,7 @@ class StorytaleGradlePlugin : KotlinCompilerPluginSupportPlugin { } companion object { - const val PLUGIN_ID = "org.jetbrains.compose.storytale" + const val COMPILER_PLUGIN_ID = "org.jetbrains.compose.storytale.compiler-plugin" const val STORYTALE_TASK_GROUP = "storytale" const val STORYTALE_EXTENSION_NAME = "storytale" const val STORYTALE_PACKAGE = "org.jetbrains.compose.storytale.generated" diff --git a/modules/gradle-plugin/src/main/kotlin/Utils.kt b/modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/Utils.kt similarity index 93% rename from modules/gradle-plugin/src/main/kotlin/Utils.kt rename to modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/Utils.kt index b4127b8..dd40c65 100644 --- a/modules/gradle-plugin/src/main/kotlin/Utils.kt +++ b/modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/Utils.kt @@ -1,10 +1,12 @@ @file:OptIn(org.jetbrains.kotlin.gradle.InternalKotlinGradlePluginApi::class) -package org.jetbrains.compose.plugin.storytale +@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") +package org.jetbrains.compose.storytale.plugin import com.squareup.kotlinpoet.FileSpec import com.squareup.kotlinpoet.FunSpec import com.squareup.kotlinpoet.MemberSpecHolder import com.squareup.kotlinpoet.TypeSpec +import org.gradle.api.Action import org.gradle.api.DefaultTask import org.gradle.api.Project import org.gradle.api.file.DirectoryProperty @@ -14,7 +16,6 @@ import org.gradle.api.tasks.Input import org.gradle.api.tasks.OutputDirectory import org.gradle.api.tasks.TaskAction import org.gradle.configurationcache.extensions.capitalized -import org.gradle.kotlin.dsl.register import org.jetbrains.kotlin.gradle.plugin.KotlinCompilation import org.jetbrains.kotlin.gradle.plugin.KotlinTarget import org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrTarget @@ -101,11 +102,11 @@ val KotlinCompilation<*>.resolveDependencyResourcesTaskName: String get() = "${name.lowercase()}${target.name.capitalized()}ResolveDependencyResources" fun setupResourceResolvingForTarget(storytaleBuildDir: File, compilation: KotlinCompilation<*>) { - compilation.project.tasks.register(compilation.resolveDependencyResourcesTaskName) { + compilation.project.tasks.register(compilation.resolveDependencyResourcesTaskName, ResolveResourcesFromDependenciesTask::class.java, Action { filterResourcesByExtension.set(true) archivesFromDependencies.setFrom(getArchivesFromResources(compilation)) outputDirectory.set(storytaleBuildDir.resolve("resolved-dependency-resources")) - } + }) } fun getArchivesFromResources(compilation: KotlinCompilation<*>): FileCollection { diff --git a/modules/gradle-plugin/src/main/kotlin/WasmMultiplatformTasks.kt b/modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/WasmMultiplatformTasks.kt similarity index 83% rename from modules/gradle-plugin/src/main/kotlin/WasmMultiplatformTasks.kt rename to modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/WasmMultiplatformTasks.kt index 4c6f75c..d409d32 100644 --- a/modules/gradle-plugin/src/main/kotlin/WasmMultiplatformTasks.kt +++ b/modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/WasmMultiplatformTasks.kt @@ -1,7 +1,6 @@ -package org.jetbrains.compose.plugin.storytale +package org.jetbrains.compose.storytale.plugin import org.gradle.api.Project -import org.gradle.kotlin.dsl.task import org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrTarget fun Project.processWasmCompilation(extension: StorytaleExtension, target: KotlinJsIrTarget) { @@ -15,7 +14,7 @@ fun Project.processWasmCompilation(extension: StorytaleExtension, target: Kotlin private fun Project.createWasmStorytaleGenerateSourceTask(extension: StorytaleExtension, target: KotlinJsIrTarget) { val storytaleBuildDir = extension.getBuildDirectory(target) - task("${target.name}${StorytaleGradlePlugin.STORYTALE_GENERATE_SUFFIX}") { + tasks.register("${target.name}${StorytaleGradlePlugin.STORYTALE_GENERATE_SUFFIX}", WasmSourceGeneratorTask::class.java) { group = StorytaleGradlePlugin.STORYTALE_TASK_GROUP description = "Generate Wasm source files for '${target.name}'" title = target.name diff --git a/modules/gradle-plugin/src/main/kotlin/WasmSourceGeneratorTask.kt b/modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/WasmSourceGeneratorTask.kt similarity index 98% rename from modules/gradle-plugin/src/main/kotlin/WasmSourceGeneratorTask.kt rename to modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/WasmSourceGeneratorTask.kt index 419d557..ae001e8 100644 --- a/modules/gradle-plugin/src/main/kotlin/WasmSourceGeneratorTask.kt +++ b/modules/gradle-plugin/src/main/kotlin/org/jetbrains/compose/storytale/plugin/WasmSourceGeneratorTask.kt @@ -1,4 +1,4 @@ -package org.jetbrains.compose.plugin.storytale +package org.jetbrains.compose.storytale.plugin import com.squareup.kotlinpoet.AnnotationSpec import com.squareup.kotlinpoet.ClassName diff --git a/modules/runtime-api/build.gradle.kts b/modules/runtime-api/build.gradle.kts index 7447741..534fdbb 100644 --- a/modules/runtime-api/build.gradle.kts +++ b/modules/runtime-api/build.gradle.kts @@ -33,12 +33,11 @@ kotlin { } group = "org.jetbrains.compose.storytale" -version = libs.versions.storytale.get() publishing {} android { - namespace = "org.jetbrains.storytale.runtime" + namespace = "org.jetbrains.compose.storytale.runtime" compileSdk = libs.versions.android.compileSdk.get().toInt() sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml") } diff --git a/modules/runtime-api/src/commonMain/kotlin/Story.kt b/modules/runtime-api/src/commonMain/kotlin/org/jetbrains/compose/storytale/Story.kt similarity index 100% rename from modules/runtime-api/src/commonMain/kotlin/Story.kt rename to modules/runtime-api/src/commonMain/kotlin/org/jetbrains/compose/storytale/Story.kt diff --git a/modules/runtime-api/src/commonMain/kotlin/StoryDelegate.kt b/modules/runtime-api/src/commonMain/kotlin/org/jetbrains/compose/storytale/StoryDelegate.kt similarity index 100% rename from modules/runtime-api/src/commonMain/kotlin/StoryDelegate.kt rename to modules/runtime-api/src/commonMain/kotlin/org/jetbrains/compose/storytale/StoryDelegate.kt diff --git a/modules/runtime-api/src/commonMain/kotlin/StoryParameter.kt b/modules/runtime-api/src/commonMain/kotlin/org/jetbrains/compose/storytale/StoryParameter.kt similarity index 100% rename from modules/runtime-api/src/commonMain/kotlin/StoryParameter.kt rename to modules/runtime-api/src/commonMain/kotlin/org/jetbrains/compose/storytale/StoryParameter.kt diff --git a/modules/runtime-api/src/commonMain/kotlin/StoryParameterDelegate.kt b/modules/runtime-api/src/commonMain/kotlin/org/jetbrains/compose/storytale/StoryParameterDelegate.kt similarity index 100% rename from modules/runtime-api/src/commonMain/kotlin/StoryParameterDelegate.kt rename to modules/runtime-api/src/commonMain/kotlin/org/jetbrains/compose/storytale/StoryParameterDelegate.kt diff --git a/settings.gradle.kts b/settings.gradle.kts index 80cd6e6..f566b35 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -3,7 +3,6 @@ enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") pluginManagement { repositories { - maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev") google { mavenContent { includeGroupAndSubgroups("androidx") @@ -26,7 +25,6 @@ dependencyResolutionManagement { includeGroupAndSubgroups("com.google") } } - maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev") mavenCentral() mavenLocal() }