Browse Source

Publish components (#829)

pull/830/head
Igor Demin 3 years ago committed by GitHub
parent
commit
854de3681c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 21
      components/SplitPane/build.gradle.kts
  2. 2
      components/SplitPane/demo/build.gradle.kts
  3. 0
      components/SplitPane/demo/src/jvmMain/kotlin/org/jetbrains/compose/splitpane/demo/Main.kt
  4. 7
      components/SplitPane/library/build.gradle.kts
  5. 0
      components/SplitPane/library/src/commonMain/kotlin/org/jetbrains/compose/splitpane/ExperimentalSplitPaneApi.kt
  6. 0
      components/SplitPane/library/src/commonMain/kotlin/org/jetbrains/compose/splitpane/SplitPane.kt
  7. 0
      components/SplitPane/library/src/commonMain/kotlin/org/jetbrains/compose/splitpane/SplitPaneDSL.kt
  8. 0
      components/SplitPane/library/src/commonMain/kotlin/org/jetbrains/compose/splitpane/SplitPaneState.kt
  9. 0
      components/SplitPane/library/src/commonMain/kotlin/org/jetbrains/compose/splitpane/Splitter.kt
  10. 0
      components/SplitPane/library/src/desktopMain/kotlin/org/jetbrains/compose/splitpane/DesktopSplitPane.kt
  11. 0
      components/SplitPane/library/src/desktopMain/kotlin/org/jetbrains/compose/splitpane/DesktopSplitter.kt
  12. 21
      components/VideoPlayer/build.gradle.kts
  13. 2
      components/VideoPlayer/demo/build.gradle.kts
  14. 0
      components/VideoPlayer/demo/src/jvmMain/kotlin/org/jetbrains/compose/videoplayer/demo/Main.kt
  15. 0
      components/VideoPlayer/library/build.gradle.kts
  16. 0
      components/VideoPlayer/library/src/commonMain/kotlin/org/jetbrains/compose/videoplayer/VideoPlayer.kt
  17. 0
      components/VideoPlayer/library/src/desktopMain/kotlin/org/jetbrains/compose/videoplayer/DesktopVideoPlayer.kt
  18. 32
      components/build.gradle.kts
  19. 11
      components/buildSrc/build.gradle.kts
  20. 5
      components/buildSrc/settings.gradle.kts
  21. 32
      components/buildSrc/src/main/kotlin/CommonMavenProperties.kt
  22. 19
      components/buildSrc/src/main/kotlin/GradleUtils.kt
  23. 3
      components/gradle.properties
  24. 8
      components/settings.gradle.kts
  25. 6
      gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/ComposePlugin.kt

21
components/SplitPane/build.gradle.kts

@ -1,21 +0,0 @@
import org.jetbrains.compose.compose
plugins {
kotlin("multiplatform")
id("org.jetbrains.compose")
}
kotlin {
jvm {
withJava()
}
sourceSets {
named("jvmMain") {
dependencies {
implementation(compose.desktop.currentOs)
implementation(project("common"))
}
}
}
}

2
components/SplitPane/desktop/build.gradle.kts → components/SplitPane/demo/build.gradle.kts

@ -12,7 +12,7 @@ kotlin {
named("jvmMain") { named("jvmMain") {
dependencies { dependencies {
implementation(compose.desktop.currentOs) implementation(compose.desktop.currentOs)
implementation(project(":SplitPane:common")) implementation(project(":SplitPane:library"))
} }
} }
} }

0
components/SplitPane/desktop/src/jvmMain/kotlin/org/jetbrains/compose/splitpane/demo/Main.kt → components/SplitPane/demo/src/jvmMain/kotlin/org/jetbrains/compose/splitpane/demo/Main.kt

7
components/SplitPane/common/build.gradle.kts → components/SplitPane/library/build.gradle.kts

@ -4,6 +4,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins { plugins {
kotlin("multiplatform") kotlin("multiplatform")
id("org.jetbrains.compose") id("org.jetbrains.compose")
id("maven-publish")
} }
kotlin { kotlin {
@ -25,3 +26,9 @@ kotlin {
tasks.withType<KotlinCompile>().configureEach { tasks.withType<KotlinCompile>().configureEach {
kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn" kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
} }
configureMavenPublication(
groupId = "org.jetbrains.compose.components",
artifactId = "components-splitpane",
name = "SplitPane for Compose JB"
)

0
components/SplitPane/common/src/commonMain/kotlin/org/jetbrains/compose/splitpane/ExperimentalSplitPaneApi.kt → components/SplitPane/library/src/commonMain/kotlin/org/jetbrains/compose/splitpane/ExperimentalSplitPaneApi.kt

0
components/SplitPane/common/src/commonMain/kotlin/org/jetbrains/compose/splitpane/SplitPane.kt → components/SplitPane/library/src/commonMain/kotlin/org/jetbrains/compose/splitpane/SplitPane.kt

0
components/SplitPane/common/src/commonMain/kotlin/org/jetbrains/compose/splitpane/SplitPaneDSL.kt → components/SplitPane/library/src/commonMain/kotlin/org/jetbrains/compose/splitpane/SplitPaneDSL.kt

0
components/SplitPane/common/src/commonMain/kotlin/org/jetbrains/compose/splitpane/SplitPaneState.kt → components/SplitPane/library/src/commonMain/kotlin/org/jetbrains/compose/splitpane/SplitPaneState.kt

0
components/SplitPane/common/src/commonMain/kotlin/org/jetbrains/compose/splitpane/Splitter.kt → components/SplitPane/library/src/commonMain/kotlin/org/jetbrains/compose/splitpane/Splitter.kt

0
components/SplitPane/common/src/desktopMain/kotlin/org/jetbrains/compose/splitpane/DesktopSplitPane.kt → components/SplitPane/library/src/desktopMain/kotlin/org/jetbrains/compose/splitpane/DesktopSplitPane.kt

0
components/SplitPane/common/src/desktopMain/kotlin/org/jetbrains/compose/splitpane/DesktopSplitter.kt → components/SplitPane/library/src/desktopMain/kotlin/org/jetbrains/compose/splitpane/DesktopSplitter.kt

21
components/VideoPlayer/build.gradle.kts

@ -1,21 +0,0 @@
import org.jetbrains.compose.compose
plugins {
kotlin("multiplatform")
id("org.jetbrains.compose")
}
kotlin {
jvm {
withJava()
}
sourceSets {
named("jvmMain") {
dependencies {
implementation(compose.desktop.currentOs)
implementation(project("common"))
}
}
}
}

2
components/VideoPlayer/desktop/build.gradle.kts → components/VideoPlayer/demo/build.gradle.kts

@ -11,7 +11,7 @@ kotlin {
named("jvmMain") { named("jvmMain") {
dependencies { dependencies {
implementation(compose.desktop.currentOs) implementation(compose.desktop.currentOs)
implementation(project(":VideoPlayer:common")) implementation(project(":VideoPlayer:library"))
} }
} }
} }

0
components/VideoPlayer/desktop/src/jvmMain/kotlin/org/jetbrains/compose/videoplayer/demo/Main.kt → components/VideoPlayer/demo/src/jvmMain/kotlin/org/jetbrains/compose/videoplayer/demo/Main.kt

0
components/VideoPlayer/common/build.gradle.kts → components/VideoPlayer/library/build.gradle.kts

0
components/VideoPlayer/common/src/commonMain/kotlin/org/jetbrains/compose/videoplayer/VideoPlayer.kt → components/VideoPlayer/library/src/commonMain/kotlin/org/jetbrains/compose/videoplayer/VideoPlayer.kt

0
components/VideoPlayer/common/src/desktopMain/kotlin/org/jetbrains/compose/videoplayer/DesktopVideoPlayer.kt → components/VideoPlayer/library/src/desktopMain/kotlin/org/jetbrains/compose/videoplayer/DesktopVideoPlayer.kt

32
components/build.gradle.kts

@ -1,6 +1,5 @@
buildscript { buildscript {
// __LATEST_COMPOSE_RELEASE_VERSION__ val composeVersion = property("compose.version")
val composeVersion = System.getenv("COMPOSE_RELEASE_VERSION") ?: "0.4.0"
repositories { repositories {
google() google()
@ -15,10 +14,37 @@ buildscript {
} }
} }
allprojects { subprojects {
version = findProperty("deploy.version") ?: property("compose.version")!!
repositories { repositories {
google() google()
mavenCentral() mavenCentral()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
} }
plugins.withId("java") {
configureIfExists<JavaPluginExtension> {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
withJavadocJar()
withSourcesJar()
}
}
plugins.withId("maven-publish") {
configureIfExists<PublishingExtension> {
repositories {
maven {
name = "ComposeRepo"
setUrl(System.getenv("COMPOSE_REPO_URL"))
credentials {
username = System.getenv("COMPOSE_REPO_USERNAME")
password = System.getenv("COMPOSE_REPO_KEY")
}
}
}
}
}
} }

11
components/buildSrc/build.gradle.kts

@ -0,0 +1,11 @@
plugins {
`kotlin-dsl`
}
repositories {
gradlePluginPortal()
}
dependencies {
compileOnly(gradleApi())
}

5
components/buildSrc/settings.gradle.kts

@ -0,0 +1,5 @@
pluginManagement {
repositories {
gradlePluginPortal()
}
}

32
components/buildSrc/src/main/kotlin/CommonMavenProperties.kt

@ -0,0 +1,32 @@
import org.gradle.api.Project
import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.kotlin.dsl.configure
fun Project.configureMavenPublication(
groupId: String,
artifactId: String,
name: String
) {
extensions.configure<PublishingExtension> {
publications {
all {
this as MavenPublication
this.groupId = groupId
mppArtifactId = artifactId
pom {
this.name.set(name)
url.set("https://github.com/JetBrains/compose-jb")
licenses {
license {
this.name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
}
}
}
}
}

19
components/buildSrc/src/main/kotlin/GradleUtils.kt

@ -0,0 +1,19 @@
/*
* Copyright 2020-2021 JetBrains s.r.o. and respective authors and developers.
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file.
*/
import org.gradle.api.Project
import org.gradle.api.publish.maven.MavenPublication
import java.lang.UnsupportedOperationException
inline fun <reified T> Project.configureIfExists(fn: T.() -> Unit) {
extensions.findByType(T::class.java)?.fn()
}
var MavenPublication.mppArtifactId: String
get() = throw UnsupportedOperationException()
set(value) {
val target = this.name
artifactId = if ("kotlinMultiplatform" in target) value else "$value-$target"
}

3
components/gradle.properties

@ -2,3 +2,6 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
android.useAndroidX=true android.useAndroidX=true
android.enableJetifier=true android.enableJetifier=true
kotlin.code.style=official kotlin.code.style=official
# __LATEST_COMPOSE_RELEASE_VERSION__
compose.version=0.4.0

8
components/settings.gradle.kts

@ -1,4 +1,4 @@
include(":VideoPlayer:common") include(":VideoPlayer:library")
include(":VideoPlayer:desktop") include(":VideoPlayer:demo")
include(":SplitPane:common") include(":SplitPane:library")
include(":SplitPane:desktop") include(":SplitPane:demo")

6
gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/ComposePlugin.kt

@ -123,6 +123,8 @@ class ComposePlugin : Plugin<Project> {
} }
object DesktopDependencies { object DesktopDependencies {
val components = DesktopComponentsDependencies
val common = composeDependency("org.jetbrains.compose.desktop:desktop") val common = composeDependency("org.jetbrains.compose.desktop:desktop")
val linux_x64 = composeDependency("org.jetbrains.compose.desktop:desktop-jvm-linux-x64") val linux_x64 = composeDependency("org.jetbrains.compose.desktop:desktop-jvm-linux-x64")
val windows_x64 = composeDependency("org.jetbrains.compose.desktop:desktop-jvm-windows-x64") val windows_x64 = composeDependency("org.jetbrains.compose.desktop:desktop-jvm-windows-x64")
@ -150,6 +152,10 @@ class ComposePlugin : Plugin<Project> {
} }
} }
object DesktopComponentsDependencies {
val splitPane = composeDependency("org.jetbrains.compose.components:components-splitpane")
}
object WebDependencies { object WebDependencies {
val core by lazy { val core by lazy {
composeDependency("org.jetbrains.compose.web:web-core") composeDependency("org.jetbrains.compose.web:web-core")

Loading…
Cancel
Save