Browse Source

Modify replace.sh for replacing Compose version (#1511)

Remove:
```
__LATEST_COMPOSE_RELEASE_VERSION__
__KOTLIN_COMPOSE_VERSION__
System.getenv("COMPOSE_TEMPLATE_COMPOSE_VERSION")
```

They pollute templates/examples.

Now, all paths where we need to change the version are hardcoded in the script.

Usage:
```
./replace.sh 1.0.0-rc6
```

This script is planned to run on CI

In the future I will add support for changing Kotlin version
pull/2159/head
Igor Demin 3 years ago committed by GitHub
parent
commit
dbd0a21949
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      benchmarks/build.gradle.kts
  2. 1
      ci/compose-uber-jar/gradle.properties
  3. 16
      components/build.gradle.kts
  4. 3
      components/gradle.properties
  5. 14
      components/settings.gradle.kts
  6. 17
      examples/codeviewer/build.gradle.kts
  7. 3
      examples/codeviewer/gradle.properties
  8. 21
      examples/codeviewer/settings.gradle.kts
  9. 4
      examples/falling-balls-web/build.gradle.kts
  10. 2
      examples/falling-balls-web/gradle.properties
  11. 8
      examples/falling-balls-web/settings.gradle.kts
  12. 9
      examples/falling-balls-web/src/jvmMain/kotlin/App.kt
  13. 2
      examples/falling-balls-web/src/jvmMain/kotlin/modifiers/position.kt
  14. 6
      examples/falling-balls/build.gradle.kts
  15. 2
      examples/falling-balls/gradle.properties
  16. 7
      examples/falling-balls/settings.gradle.kts
  17. 15
      examples/imageviewer/build.gradle.kts
  18. 3
      examples/imageviewer/gradle.properties
  19. 21
      examples/imageviewer/settings.gradle.kts
  20. 5
      examples/intellij-plugin/build.gradle.kts
  21. 2
      examples/intellij-plugin/gradle.properties
  22. 7
      examples/intellij-plugin/settings.gradle.kts
  23. 17
      examples/issues/build.gradle.kts
  24. 3
      examples/issues/gradle.properties
  25. 21
      examples/issues/settings.gradle.kts
  26. 6
      examples/notepad/build.gradle.kts
  27. 2
      examples/notepad/gradle.properties
  28. 5
      examples/notepad/settings.gradle.kts
  29. 15
      examples/todoapp-lite/build.gradle.kts
  30. 3
      examples/todoapp-lite/gradle.properties
  31. 21
      examples/todoapp-lite/settings.gradle.kts
  32. 4
      examples/todoapp/buildSrc/build.gradle.kts
  33. 29
      examples/todoapp/buildSrc/buildSrc/src/main/kotlin/Deps.kt
  34. 2
      examples/todoapp/buildSrc/gradle.properties
  35. 10
      examples/todoapp/buildSrc/src/main/kotlin/multiplatform-setup.gradle.kts
  36. 6
      examples/visual-effects/build.gradle.kts
  37. 2
      examples/visual-effects/gradle.properties
  38. 9
      examples/visual-effects/settings.gradle.kts
  39. 4
      examples/web-compose-bird/build.gradle.kts
  40. 2
      examples/web-compose-bird/gradle.properties
  41. 8
      examples/web-compose-bird/settings.gradle.kts
  42. 4
      examples/web-landing/build.gradle.kts
  43. 2
      examples/web-landing/gradle.properties
  44. 8
      examples/web-landing/settings.gradle.kts
  45. 4
      examples/web-with-react/build.gradle.kts
  46. 2
      examples/web-with-react/gradle.properties
  47. 7
      examples/web-with-react/settings.gradle.kts
  48. 17
      examples/widgets-gallery/build.gradle.kts
  49. 3
      examples/widgets-gallery/gradle.properties
  50. 21
      examples/widgets-gallery/settings.gradle.kts
  51. 2
      experimental/build_from_cli/build_and_run_from_cli_example.sh
  52. 2
      experimental/cef/build.gradle.kts
  53. 1
      experimental/components/build.gradle.kts
  54. 2
      experimental/components/gradle.properties
  55. 4
      experimental/lwjgl-integration/build.gradle.kts
  56. 1
      gradle-plugins/build.gradle.kts
  57. 1
      gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/TestKotlinVersion.kt
  58. 1
      gradle-plugins/gradle.properties
  59. 2
      idea-plugin/examples/simple-preview-example/build.gradle.kts
  60. 6
      templates/desktop-template/build.gradle.kts
  61. 2
      templates/desktop-template/gradle.properties
  62. 5
      templates/desktop-template/settings.gradle.kts
  63. 1
      templates/multiplatform-template/android/src/main/AndroidManifest.xml
  64. 18
      templates/multiplatform-template/build.gradle.kts
  65. 3
      templates/multiplatform-template/gradle.properties
  66. 17
      templates/multiplatform-template/settings.gradle.kts
  67. 8
      templates/web-template/build.gradle.kts
  68. 2
      templates/web-template/gradle.properties
  69. 5
      templates/web-template/settings.gradle.kts
  70. 60
      tools/replace.sh
  71. 2
      tutorials/Getting_Started/README.md
  72. 23
      tutorials/checker/build.gradle.kts
  73. 5
      web/compose-compiler-integration/README.md
  74. 1
      web/gradle.properties

3
benchmarks/build.gradle.kts

@ -3,11 +3,8 @@ import kotlinx.benchmark.gradle.*
import org.jetbrains.kotlin.allopen.gradle.*
plugins {
// __KOTLIN_COMPOSE_VERSION__
kotlin("jvm") version "1.4.20"
// __LATEST_COMPOSE_RELEASE_VERSION__
id("org.jetbrains.compose") version "0.2.0-build132"
// __KOTLIN_COMPOSE_VERSION__
kotlin("plugin.allopen") version "1.4.20"
id("kotlinx.benchmark") version "0.3.0"
}

1
ci/compose-uber-jar/gradle.properties

@ -1,3 +1,2 @@
# __LATEST_COMPOSE_RELEASE_VERSION__
compose.version=1.0.0
kotlin.code.style=official

16
components/build.gradle.kts

@ -1,19 +1,3 @@
buildscript {
val composeVersion = property("compose.version")
repositories {
google()
mavenCentral()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
dependencies {
classpath("org.jetbrains.compose:compose-gradle-plugin:$composeVersion")
// __KOTLIN_COMPOSE_VERSION__
classpath(kotlin("gradle-plugin", version = "1.5.31"))
}
}
subprojects {
version = findProperty("deploy.version") ?: property("compose.version")!!

3
components/gradle.properties

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

14
components/settings.gradle.kts

@ -1,2 +1,16 @@
pluginManagement {
repositories {
gradlePluginPortal()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
google()
}
plugins {
kotlin("jvm").version(extra["kotlin.version"] as String)
kotlin("multiplatform").version(extra["kotlin.version"] as String)
id("org.jetbrains.compose").version(extra["compose.version"] as String)
}
}
include(":SplitPane:library")
include(":SplitPane:demo")

17
examples/codeviewer/build.gradle.kts

@ -1,20 +1,3 @@
buildscript {
repositories {
mavenLocal()
google()
mavenCentral()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
dependencies {
// __LATEST_COMPOSE_RELEASE_VERSION__
classpath("org.jetbrains.compose:compose-gradle-plugin:1.0.0")
classpath("com.android.tools.build:gradle:4.2.2")
// __KOTLIN_COMPOSE_VERSION__
classpath(kotlin("gradle-plugin", version = "1.5.31"))
}
}
allprojects {
repositories {
google()

3
examples/codeviewer/gradle.properties

@ -19,3 +19,6 @@ android.useAndroidX=true
android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
kotlin.version=1.5.31
agp.version=4.2.2
compose.version=1.0.0

21
examples/codeviewer/settings.gradle.kts

@ -1 +1,22 @@
pluginManagement {
repositories {
gradlePluginPortal()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
google()
}
plugins {
val kotlinVersion = extra["kotlin.version"] as String
val agpVersion = extra["agp.version"] as String
val composeVersion = extra["compose.version"] as String
kotlin("jvm").version(kotlinVersion)
kotlin("multiplatform").version(kotlinVersion)
kotlin("android").version(kotlinVersion)
id("com.android.application").version(agpVersion)
id("com.android.library").version(agpVersion)
id("org.jetbrains.compose").version(composeVersion)
}
}
include(":common", ":android", ":desktop")

4
examples/falling-balls-web/build.gradle.kts

@ -3,8 +3,8 @@ import org.jetbrains.compose.compose
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
plugins {
kotlin("multiplatform") version "1.5.31"
id("org.jetbrains.compose") version "1.0.0"
kotlin("multiplatform")
id("org.jetbrains.compose")
}
version = "1.0-SNAPSHOT"

2
examples/falling-balls-web/gradle.properties

@ -0,0 +1,2 @@
kotlin.version=1.5.31
compose.version=1.0.0

8
examples/falling-balls-web/settings.gradle.kts

@ -2,10 +2,14 @@ pluginManagement {
repositories {
gradlePluginPortal()
mavenCentral()
maven { url = uri("https://maven.pkg.jetbrains.space/public/p/compose/dev") }
google()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
plugins {
kotlin("multiplatform").version(extra["kotlin.version"] as String)
id("org.jetbrains.compose").version(extra["compose.version"] as String)
}
}
rootProject.name = "falling_balls_with_web"

9
examples/falling-balls-web/src/jvmMain/kotlin/App.kt

@ -1,17 +1,16 @@
package org.jetbrains.compose.common.demo
import androidx.compose.desktop.Window
import androidx.compose.ui.unit.IntSize
import org.jetbrains.compose.demo.falling.views.fallingBalls
import org.jetbrains.compose.demo.falling.Game
import androidx.compose.runtime.remember
import androidx.compose.ui.window.singleWindowApplication
import org.jetbrains.compose.demo.falling.Game
import org.jetbrains.compose.demo.falling.views.fallingBalls
class JvmGame : Game() {
override fun now() = System.nanoTime()
}
fun main() {
Window(title = "Demo", size = IntSize(600, 400)) {
singleWindowApplication(title = "Demo") {
fallingBalls(
remember {
JvmGame().apply {

2
examples/falling-balls-web/src/jvmMain/kotlin/modifiers/position.kt

@ -2,11 +2,11 @@ package org.jetbrains.compose.common.demo
import androidx.compose.runtime.Composable
import org.jetbrains.compose.common.ui.Modifier
import org.jetbrains.compose.common.foundation.layout.offset
import org.jetbrains.compose.common.ui.unit.Dp
import org.jetbrains.compose.common.internal.castOrCreate
import org.jetbrains.compose.common.ui.unit.implementation
import androidx.compose.foundation.layout.offset
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi
@Composable
@OptIn(ExperimentalComposeWebWidgetsApi::class)

6
examples/falling-balls/build.gradle.kts

@ -3,10 +3,8 @@ import org.jetbrains.compose.desktop.application.dsl.TargetFormat
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
// __KOTLIN_COMPOSE_VERSION__
kotlin("jvm") version "1.5.31"
// __LATEST_COMPOSE_RELEASE_VERSION__
id("org.jetbrains.compose") version "1.0.0"
kotlin("jvm")
id("org.jetbrains.compose")
}
group = "me.user"

2
examples/falling-balls/gradle.properties

@ -1 +1,3 @@
kotlin.code.style=official
kotlin.version=1.5.31
compose.version=1.0.0

7
examples/falling-balls/settings.gradle.kts

@ -1 +1,8 @@
pluginManagement {
plugins {
kotlin("jvm").version(extra["kotlin.version"] as String)
id("org.jetbrains.compose").version(extra["compose.version"] as String)
}
}
rootProject.name = "falling_balls"

15
examples/imageviewer/build.gradle.kts

@ -1,18 +1,3 @@
buildscript {
repositories {
google()
mavenCentral()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
dependencies {
// __LATEST_COMPOSE_RELEASE_VERSION__
classpath("org.jetbrains.compose:compose-gradle-plugin:1.0.0")
classpath("com.android.tools.build:gradle:4.1.0")
classpath(kotlin("gradle-plugin", version = "1.5.31"))
}
}
allprojects {
repositories {
google()

3
examples/imageviewer/gradle.properties

@ -19,3 +19,6 @@ android.useAndroidX=true
android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
kotlin.version=1.5.31
agp.version=4.2.2
compose.version=1.0.0

21
examples/imageviewer/settings.gradle.kts

@ -1 +1,22 @@
pluginManagement {
repositories {
gradlePluginPortal()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
google()
}
plugins {
val kotlinVersion = extra["kotlin.version"] as String
val agpVersion = extra["agp.version"] as String
val composeVersion = extra["compose.version"] as String
kotlin("jvm").version(kotlinVersion)
kotlin("multiplatform").version(kotlinVersion)
kotlin("android").version(kotlinVersion)
id("com.android.application").version(agpVersion)
id("com.android.library").version(agpVersion)
id("org.jetbrains.compose").version(composeVersion)
}
}
include(":common", ":android", ":desktop")

5
examples/intellij-plugin/build.gradle.kts

@ -3,9 +3,8 @@ import org.jetbrains.compose.compose
plugins {
id("org.jetbrains.intellij") version "1.1.4"
java
kotlin("jvm") version "1.5.31"
// __LATEST_COMPOSE_RELEASE_VERSION__
id("org.jetbrains.compose") version "1.0.0"
kotlin("jvm")
id("org.jetbrains.compose")
id("idea")
}

2
examples/intellij-plugin/gradle.properties

@ -1 +1,3 @@
kotlin.code.style=official
kotlin.version=1.5.31
compose.version=1.0.0

7
examples/intellij-plugin/settings.gradle.kts

@ -1,9 +1,8 @@
rootProject.name = "ComposeDemoPlugin"
pluginManagement {
repositories {
gradlePluginPortal()
mavenCentral()
maven { url = uri("https://maven.pkg.jetbrains.space/public/p/compose/dev") }
plugins {
kotlin("jvm").version(extra["kotlin.version"] as String)
id("org.jetbrains.compose").version(extra["compose.version"] as String)
}
}

17
examples/issues/build.gradle.kts

@ -1,20 +1,3 @@
buildscript {
repositories {
mavenLocal()
google()
mavenCentral()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
dependencies {
// __LATEST_COMPOSE_RELEASE_VERSION__
classpath("org.jetbrains.compose:compose-gradle-plugin:1.0.0")
classpath("com.android.tools.build:gradle:4.1.3")
// __KOTLIN_COMPOSE_VERSION__
classpath(kotlin("gradle-plugin", version = "1.5.31"))
}
}
allprojects {
repositories {
mavenLocal()

3
examples/issues/gradle.properties

@ -19,3 +19,6 @@ kotlin.code.style=official
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
kotlin.version=1.5.31
agp.version=4.2.2
compose.version=1.0.0

21
examples/issues/settings.gradle.kts

@ -1 +1,22 @@
pluginManagement {
repositories {
gradlePluginPortal()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
google()
}
plugins {
val kotlinVersion = extra["kotlin.version"] as String
val agpVersion = extra["agp.version"] as String
val composeVersion = extra["compose.version"] as String
kotlin("jvm").version(kotlinVersion)
kotlin("multiplatform").version(kotlinVersion)
kotlin("android").version(kotlinVersion)
id("com.android.application").version(agpVersion)
id("com.android.library").version(agpVersion)
id("org.jetbrains.compose").version(composeVersion)
}
}
include(":common", ":android", ":desktop")

6
examples/notepad/build.gradle.kts

@ -2,10 +2,8 @@ import org.jetbrains.compose.compose
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
plugins {
// __KOTLIN_COMPOSE_VERSION__
kotlin("jvm") version "1.5.31"
// __LATEST_COMPOSE_RELEASE_VERSION__
id("org.jetbrains.compose") version ("1.0.0")
kotlin("jvm")
id("org.jetbrains.compose")
}
repositories {

2
examples/notepad/gradle.properties

@ -1,2 +1,4 @@
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
kotlin.code.style=official
kotlin.version=1.5.31
compose.version=1.0.0

5
examples/notepad/settings.gradle.kts

@ -3,4 +3,9 @@ pluginManagement {
gradlePluginPortal()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
plugins {
kotlin("jvm").version(extra["kotlin.version"] as String)
id("org.jetbrains.compose").version(extra["compose.version"] as String)
}
}

15
examples/todoapp-lite/build.gradle.kts

@ -1,18 +1,3 @@
buildscript {
repositories {
google()
mavenCentral()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
dependencies {
// __LATEST_COMPOSE_RELEASE_VERSION__
classpath("org.jetbrains.compose:compose-gradle-plugin:1.0.0")
classpath("com.android.tools.build:gradle:4.1.0")
classpath(kotlin("gradle-plugin", version = "1.5.31"))
}
}
allprojects {
repositories {
google()

3
examples/todoapp-lite/gradle.properties

@ -19,3 +19,6 @@ android.useAndroidX=true
android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
kotlin.version=1.5.31
agp.version=4.2.2
compose.version=1.0.0

21
examples/todoapp-lite/settings.gradle.kts

@ -1 +1,22 @@
pluginManagement {
repositories {
gradlePluginPortal()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
google()
}
plugins {
val kotlinVersion = extra["kotlin.version"] as String
val agpVersion = extra["agp.version"] as String
val composeVersion = extra["compose.version"] as String
kotlin("jvm").version(kotlinVersion)
kotlin("multiplatform").version(kotlinVersion)
kotlin("android").version(kotlinVersion)
id("com.android.application").version(agpVersion)
id("com.android.library").version(agpVersion)
id("org.jetbrains.compose").version(composeVersion)
}
}
include(":common", ":android", ":desktop")

4
examples/todoapp/buildSrc/build.gradle.kts

@ -10,8 +10,8 @@ repositories {
}
dependencies {
implementation(Deps.JetBrains.Compose.gradlePlugin)
implementation(Deps.JetBrains.Kotlin.gradlePlugin)
implementation(Deps.JetBrains.Compose(project).gradlePlugin)
implementation(Deps.JetBrains.Kotlin(project).gradlePlugin)
implementation(Deps.Android.Tools.Build.gradlePlugin)
implementation(Deps.Squareup.SQLDelight.gradlePlugin)
}

29
examples/todoapp/buildSrc/buildSrc/src/main/kotlin/Deps.kt

@ -1,20 +1,23 @@
object Deps {
// We store Kotlin and Compose versions in gradle.properties to
// be able to override them on CI.
// You probably won't need this, so you can get rid of `project` in this file.
import org.gradle.api.Project
object Deps {
object JetBrains {
object Kotlin {
// __KOTLIN_COMPOSE_VERSION__
private const val VERSION = "1.5.31"
const val gradlePlugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:$VERSION"
const val testCommon = "org.jetbrains.kotlin:kotlin-test-common:$VERSION"
const val testJunit = "org.jetbrains.kotlin:kotlin-test-junit:$VERSION"
const val testJs = "org.jetbrains.kotlin:kotlin-test-js:$VERSION"
const val testAnnotationsCommon = "org.jetbrains.kotlin:kotlin-test-annotations-common:$VERSION"
class Kotlin(private val project: Project) {
private val VERSION = project.properties["kotlin.version"]
val gradlePlugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:$VERSION"
val testCommon = "org.jetbrains.kotlin:kotlin-test-common:$VERSION"
val testJunit = "org.jetbrains.kotlin:kotlin-test-junit:$VERSION"
val testJs = "org.jetbrains.kotlin:kotlin-test-js:$VERSION"
val testAnnotationsCommon = "org.jetbrains.kotlin:kotlin-test-annotations-common:$VERSION"
}
object Compose {
// __LATEST_COMPOSE_RELEASE_VERSION__
private const val VERSION = "1.0.0"
const val gradlePlugin = "org.jetbrains.compose:compose-gradle-plugin:$VERSION"
class Compose(private val project: Project) {
private val VERSION = project.properties["compose.version"]
val gradlePlugin = "org.jetbrains.compose:compose-gradle-plugin:$VERSION"
}
}

2
examples/todoapp/buildSrc/gradle.properties

@ -0,0 +1,2 @@
kotlin.version=1.5.31
compose.version=1.0.0

10
examples/todoapp/buildSrc/src/main/kotlin/multiplatform-setup.gradle.kts

@ -15,24 +15,24 @@ kotlin {
sourceSets {
named("commonTest") {
dependencies {
implementation(Deps.JetBrains.Kotlin.testCommon)
implementation(Deps.JetBrains.Kotlin.testAnnotationsCommon)
implementation(Deps.JetBrains.Kotlin(project).testCommon)
implementation(Deps.JetBrains.Kotlin(project).testAnnotationsCommon)
}
}
named("androidTest") {
dependencies {
implementation(Deps.JetBrains.Kotlin.testJunit)
implementation(Deps.JetBrains.Kotlin(project).testJunit)
}
}
named("desktopTest") {
dependencies {
implementation(Deps.JetBrains.Kotlin.testJunit)
implementation(Deps.JetBrains.Kotlin(project).testJunit)
}
}
named("jsTest") {
dependencies {
implementation(Deps.JetBrains.Kotlin.testJs)
implementation(Deps.JetBrains.Kotlin(project).testJs)
}
}
}

6
examples/visual-effects/build.gradle.kts

@ -3,10 +3,8 @@ import org.jetbrains.compose.desktop.application.dsl.TargetFormat
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
// __KOTLIN_COMPOSE_VERSION__
kotlin("jvm") version "1.5.31"
// __LATEST_COMPOSE_RELEASE_VERSION__
id("org.jetbrains.compose") version "1.0.0"
kotlin("jvm")
id("org.jetbrains.compose")
}
group = "me.user"

2
examples/visual-effects/gradle.properties

@ -1 +1,3 @@
kotlin.code.style=official
kotlin.version=1.5.31
compose.version=1.0.0

9
examples/visual-effects/settings.gradle.kts

@ -1,10 +1,13 @@
pluginManagement {
repositories {
gradlePluginPortal()
mavenCentral()
maven { url = uri("https://maven.pkg.jetbrains.space/public/p/compose/dev") }
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
plugins {
kotlin("jvm").version(extra["kotlin.version"] as String)
id("org.jetbrains.compose").version(extra["compose.version"] as String)
}
}
rootProject.name = "visual-effects"
rootProject.name = "visual-effects"

4
examples/web-compose-bird/build.gradle.kts

@ -1,8 +1,8 @@
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
plugins {
kotlin("multiplatform") version "1.5.31"
id("org.jetbrains.compose") version "1.0.0"
kotlin("multiplatform")
id("org.jetbrains.compose")
}
group = "com.theapache64.composebird"
version = "1.0.0-alpha01"

2
examples/web-compose-bird/gradle.properties

@ -1,2 +1,4 @@
kotlin.code.style=official
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
kotlin.version=1.5.31
compose.version=1.0.0

8
examples/web-compose-bird/settings.gradle.kts

@ -1,9 +1,15 @@
pluginManagement {
repositories {
gradlePluginPortal()
mavenCentral()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
google()
}
plugins {
kotlin("multiplatform").version(extra["kotlin.version"] as String)
id("org.jetbrains.compose").version(extra["compose.version"] as String)
}
}
rootProject.name = "web-compose-bird"

4
examples/web-landing/build.gradle.kts

@ -1,8 +1,8 @@
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
plugins {
kotlin("multiplatform") version "1.5.31"
id("org.jetbrains.compose") version "1.0.0"
kotlin("multiplatform")
id("org.jetbrains.compose")
}
repositories {

2
examples/web-landing/gradle.properties

@ -1 +1,3 @@
kotlin.code.style=official
kotlin.version=1.5.31
compose.version=1.0.0

8
examples/web-landing/settings.gradle.kts

@ -2,10 +2,14 @@ pluginManagement {
repositories {
gradlePluginPortal()
mavenCentral()
maven { url = uri("https://maven.pkg.jetbrains.space/public/p/compose/dev") }
google()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
plugins {
kotlin("multiplatform").version(extra["kotlin.version"] as String)
id("org.jetbrains.compose").version(extra["compose.version"] as String)
}
}
rootProject.name = "compose-web-lp"

4
examples/web-with-react/build.gradle.kts

@ -1,7 +1,7 @@
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
plugins {
kotlin("multiplatform") version "1.5.31"
id("org.jetbrains.compose") version "1.0.0"
kotlin("multiplatform")
id("org.jetbrains.compose")
}
repositories {

2
examples/web-with-react/gradle.properties

@ -1 +1,3 @@
kotlin.code.style=official
kotlin.version=1.5.31
compose.version=1.0.0

7
examples/web-with-react/settings.gradle.kts

@ -1,8 +1,13 @@
pluginManagement {
repositories {
gradlePluginPortal()
mavenCentral()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
google()
}
plugins {
kotlin("multiplatform").version(extra["kotlin.version"] as String)
id("org.jetbrains.compose").version(extra["compose.version"] as String)
}
}

17
examples/widgets-gallery/build.gradle.kts

@ -1,20 +1,3 @@
buildscript {
repositories {
mavenLocal()
google()
mavenCentral()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
dependencies {
// __LATEST_COMPOSE_RELEASE_VERSION__
classpath("org.jetbrains.compose:compose-gradle-plugin:1.0.0")
classpath("com.android.tools.build:gradle:4.2.0")
// __KOTLIN_COMPOSE_VERSION__
classpath(kotlin("gradle-plugin", version = "1.5.31"))
}
}
allprojects {
repositories {
google()

3
examples/widgets-gallery/gradle.properties

@ -19,3 +19,6 @@ android.useAndroidX=true
android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
kotlin.version=1.5.31
compose.version=1.0.0
agp.version=4.2.2

21
examples/widgets-gallery/settings.gradle.kts

@ -1 +1,22 @@
pluginManagement {
repositories {
gradlePluginPortal()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
google()
}
plugins {
val kotlinVersion = extra["kotlin.version"] as String
val agpVersion = extra["agp.version"] as String
val composeVersion = extra["compose.version"] as String
kotlin("jvm").version(kotlinVersion)
kotlin("multiplatform").version(kotlinVersion)
kotlin("android").version(kotlinVersion)
id("com.android.application").version(agpVersion)
id("com.android.library").version(agpVersion)
id("org.jetbrains.compose").version(composeVersion)
}
}
include(":common", ":android", ":desktop")

2
experimental/build_from_cli/build_and_run_from_cli_example.sh

@ -20,9 +20,7 @@ function mavenDep {
PLATFORM=macos-x64
SKIKO_VERSION=0.2.33
# __KOTLIN_COMPOSE_VERSION__
KOTLIN_VERSION=1.5.0
# __LATEST_COMPOSE_RELEASE_VERSION__
COMPOSE_VERSION=0.4.0-build209
COROUTINES_VERSION=1.3.6
COLLECTIONS_VERSION=0.3

2
experimental/cef/build.gradle.kts

@ -4,9 +4,7 @@ import de.undercouch.gradle.tasks.download.Download
import kotlin.text.capitalize
plugins {
// __KOTLIN_COMPOSE_VERSION__
kotlin("jvm") version "1.5.21"
// __LATEST_COMPOSE_RELEASE_VERSION__
id("org.jetbrains.compose") version "1.0.0-alpha1"
id("de.undercouch.download") version "4.1.1"
application

1
experimental/components/build.gradle.kts

@ -9,7 +9,6 @@ buildscript {
dependencies {
classpath("org.jetbrains.compose:compose-gradle-plugin:$composeVersion")
// __KOTLIN_COMPOSE_VERSION__
classpath(kotlin("gradle-plugin", version = "1.5.31"))
}
}

2
experimental/components/gradle.properties

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

4
experimental/lwjgl-integration/build.gradle.kts

@ -2,10 +2,8 @@ import org.jetbrains.compose.compose
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
plugins {
// __KOTLIN_COMPOSE_VERSION__
kotlin("jvm") version "1.5.31"
// __LATEST_COMPOSE_RELEASE_VERSION__
id("org.jetbrains.compose") version (System.getenv("COMPOSE_TEMPLATE_COMPOSE_VERSION") ?: "1.0.0")
id("org.jetbrains.compose") version "1.0.0"
}
repositories {

1
gradle-plugins/build.gradle.kts

@ -1,7 +1,6 @@
import com.gradle.publish.PluginBundleExtension
plugins {
// __KOTLIN_COMPOSE_VERSION__
kotlin("jvm") version "1.5.10" apply false
id("com.gradle.plugin-publish") version "0.17.0" apply false
}

1
gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/TestKotlinVersion.kt

@ -7,7 +7,6 @@ package org.jetbrains.compose.test
@Suppress("EnumEntryName")
enum class TestKotlinVersion(val versionString: String) {
// __KOTLIN_COMPOSE_VERSION__
Default("1.5.31"),
V1_5_20("1.5.20")
}

1
gradle-plugins/gradle.properties

@ -5,7 +5,6 @@ kotlin.code.style=official
# that will be used by published Gradle plugin,
# unless overridden by COMPOSE_GRADLE_PLUGIN_COMPOSE_VERSION env var.
#
# __LATEST_COMPOSE_RELEASE_VERSION__
compose.version=1.0.0
compose.with.web=false

2
idea-plugin/examples/simple-preview-example/build.gradle.kts

@ -5,9 +5,7 @@ buildscript {
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
dependencies {
// __LATEST_COMPOSE_RELEASE_VERSION__
classpath("org.jetbrains.compose:compose-gradle-plugin:0.0.9-preview-images")
// __KOTLIN_COMPOSE_VERSION__
classpath(kotlin("gradle-plugin", version = "1.5.31"))
}
}

6
templates/desktop-template/build.gradle.kts

@ -2,10 +2,8 @@ import org.jetbrains.compose.compose
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
plugins {
// __KOTLIN_COMPOSE_VERSION__
kotlin("jvm") version "1.5.31"
// __LATEST_COMPOSE_RELEASE_VERSION__
id("org.jetbrains.compose") version (System.getenv("COMPOSE_TEMPLATE_COMPOSE_VERSION") ?: "1.0.0")
kotlin("jvm")
id("org.jetbrains.compose")
}
repositories {

2
templates/desktop-template/gradle.properties

@ -1,2 +1,4 @@
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
kotlin.code.style=official
kotlin.version=1.5.31
compose.version=1.0.0

5
templates/desktop-template/settings.gradle.kts

@ -3,4 +3,9 @@ pluginManagement {
gradlePluginPortal()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
plugins {
kotlin("jvm").version(extra["kotlin.version"] as String)
id("org.jetbrains.compose").version(extra["compose.version"] as String)
}
}

1
templates/multiplatform-template/android/src/main/AndroidManifest.xml

@ -10,6 +10,7 @@
android:supportsRtl="true"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
<activity
android:exported="true"
android:name=".MainActivity"
android:label="@string/app_name">
<intent-filter>

18
templates/multiplatform-template/build.gradle.kts

@ -1,21 +1,3 @@
buildscript {
// __LATEST_COMPOSE_RELEASE_VERSION__
val composeVersion = System.getenv("COMPOSE_TEMPLATE_COMPOSE_VERSION") ?: "1.0.0"
repositories {
mavenCentral()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
google()
}
dependencies {
classpath("org.jetbrains.compose:compose-gradle-plugin:$composeVersion")
classpath("com.android.tools.build:gradle:4.1.3")
// __KOTLIN_COMPOSE_VERSION__
classpath(kotlin("gradle-plugin", version = "1.5.31"))
}
}
allprojects {
repositories {
google()

3
templates/multiplatform-template/gradle.properties

@ -2,3 +2,6 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
android.useAndroidX=true
android.enableJetifier=true
kotlin.code.style=official
kotlin.version=1.5.31
agp.version=4.2.2
compose.version=1.0.0

17
templates/multiplatform-template/settings.gradle.kts

@ -1 +1,18 @@
pluginManagement {
repositories {
gradlePluginPortal()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
google()
}
plugins {
kotlin("jvm").version(extra["kotlin.version"] as String)
kotlin("multiplatform").version(extra["kotlin.version"] as String)
kotlin("android").version(extra["kotlin.version"] as String)
id("com.android.application").version(extra["agp.version"] as String)
id("com.android.library").version(extra["agp.version"] as String)
id("org.jetbrains.compose").version(extra["compose.version"] as String)
}
}
include(":common", ":android", ":desktop")

8
templates/web-template/build.gradle.kts

@ -3,10 +3,8 @@ import org.jetbrains.compose.desktop.application.dsl.TargetFormat
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
plugins {
// __KOTLIN_COMPOSE_VERSION__
kotlin("multiplatform") version "1.5.31"
// __LATEST_COMPOSE_RELEASE_VERSION__
id("org.jetbrains.compose") version ("1.0.0")
kotlin("multiplatform")
id("org.jetbrains.compose")
}
repositories {
@ -35,7 +33,7 @@ kotlin {
// a temporary workaround for a bug in jsRun invocation - see https://youtrack.jetbrains.com/issue/KT-48273
afterEvaluate {
rootProject.extensions.configure<NodeJsRootExtension> {
rootProject.extensions.configure<NodeJsRootExtension> {
versions.webpackDevServer.version = "4.0.0"
versions.webpackCli.version = "4.9.0"
}

2
templates/web-template/gradle.properties

@ -1,2 +1,4 @@
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
kotlin.code.style=official
kotlin.version=1.5.31
compose.version=1.0.0

5
templates/web-template/settings.gradle.kts

@ -3,4 +3,9 @@ pluginManagement {
gradlePluginPortal()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
plugins {
kotlin("multiplatform").version(extra["kotlin.version"] as String)
id("org.jetbrains.compose").version(extra["compose.version"] as String)
}
}

60
tools/replace.sh

@ -1,13 +1,51 @@
#!/bin/bash
# Replace hard-coded Compose version in Compose repo projects. Usage: ./replace.sh 1.0.0-rc6
ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/..
COMPOSE_OLDVER=0.4.0-rc2
COMPOSE_NEWVER=0.4.0
find -E $ROOT -regex '.*\.(kts|properties|kt)' -exec sed -i '' -e "s/$COMPOSE_OLDVER/$COMPOSE_NEWVER/g" {} \;
APPCOMPAT_OLDVER=1.1.0
APPCOMPAT_NEWVER=1.3.0-beta01
find -E $ROOT -regex '.*\.(kts|properties|kt)' -exec sed -i '' -e "s/$APPCOMPAT_OLDVER/$APPCOMPAT_NEWVER/g" {} \;
KOTLIN_OLDVER=1.5.10
KOTLIN_NEWVER=1.5.10
find -E $ROOT -regex '.*\.(kts|properties|kt)' -exec sed -i '' -e "s/$KOTLIN_OLDVER/$KOTLIN_NEWVER/g" {} \;
git grep -C 1 __KOTLIN_COMPOSE_VERSION__ $ROOT
git grep -C 1 __LATEST_COMPOSE_RELEASE_VERSION__ $ROOT
# Add folders which should contain up-to-date versions
declare -a folders=(
"templates"
"examples"
"gradle-plugins"
"components"
"ci"
"web"
"tutorials"
)
if [ -z "$@" ]; then
echo "Specify Compose version. For example: ./replace.sh 1.0.0-rc6"
exit 1
fi
COMPOSE_VERSION=$@
if [[ $OSTYPE == 'darwin'* ]]; then
SED=gsed
else
SED=sed
fi
replaceCompose() {
$SED -i -e "s/$1/$2/g" $3
}
replaceComposeInFile() {
echo "Replace in $1"
replaceCompose '^compose.version=.*' 'compose.version='"$COMPOSE_VERSION"'' $1
replaceCompose '^COMPOSE_CORE_VERSION=.*' 'COMPOSE_CORE_VERSION='"$COMPOSE_VERSION"'' $1
replaceCompose '^COMPOSE_WEB_VERSION=.*' 'COMPOSE_WEB_VERSION='"$COMPOSE_VERSION"'' $1
replaceCompose 'id("org.jetbrains.compose") version ".*"' 'id("org.jetbrains.compose") version "'"$COMPOSE_VERSION"'"' $1
replaceCompose '"org.jetbrains.compose:compose-gradle-plugin:.*"' '"org.jetbrains.compose:compose-gradle-plugin:'"$COMPOSE_VERSION"'"' $1
}
replaceComposeInFolder() {
find $ROOT/$1 -wholename $2 -not -path "**/build**" -not -path "**/.gradle**" | while read file; do replaceComposeInFile "$file"; done
}
for folder in "${folders[@]}"
do
replaceComposeInFolder $folder "**gradle.properties"
replaceComposeInFolder $folder "**README.md"
done

2
tutorials/Getting_Started/README.md

@ -40,7 +40,7 @@ just search for "Compose Multiplatform".
### Update the wizard plugin
The Compose plugin version used in the wizard above may be not the last. Update the version of the plugin to the latest available by editing the `build.gradle.kts` file, finding and updating the version information as shown below. In this example the latest version of the plugin was 1.0.0 and a compatible version of kotlin was 1.5.31. For the latest versions, see the [latest versions](https://github.com/JetBrains/compose-jb/releases) site and the [Kotlin](https://kotlinlang.org/) site.
The Compose plugin version used in the wizard above may be not the last. Update the version of the plugin to the latest available by editing the `build.gradle.kts` file, finding and updating the version information as shown below. For the latest versions, see the [latest versions](https://github.com/JetBrains/compose-jb/releases) site and the [Kotlin](https://kotlinlang.org/) site.
```
plugins {
kotlin("jvm") version "1.5.31"

23
tutorials/checker/build.gradle.kts

@ -50,18 +50,31 @@ fun cloneTemplate(template: String, index: Int, content: String): File {
return tempDir
}
@OptIn(ExperimentalStdlibApi::class)
fun checkDirs(dirs: List<String>, template: String, buildCmd: String = "build") {
val snippets = findSnippets(dirs)
snippets.forEachIndexed { index, snippet ->
println("process snippet $index at ${snippet.file}:${snippet.lineNumber} with $template")
snippet.tempDir = cloneTemplate(template, index, snippet.content)
val isWin = System.getProperty("os.name").startsWith("Win")
val procBuilder = if (isWin) {
ProcessBuilder("gradlew.bat", "$buildCmd")
} else {
ProcessBuilder("bash", "./gradlew", "$buildCmd")
val args = buildList {
if (isWin) {
add("gradlew.bat")
} else {
add("bash")
add("./gradlew")
}
add(buildCmd)
project.findProperty("kotlin.version")?.also {
add("-Pkotlin.version=$it")
}
project.findProperty("compose.version")?.also {
add("-Pcompose.version=$it")
}
}
val proc = procBuilder
val proc = ProcessBuilder(*args.toTypedArray())
.directory(snippet.tempDir)
.redirectOutput(ProcessBuilder.Redirect.PIPE)
.redirectError(ProcessBuilder.Redirect.PIPE)

5
web/compose-compiler-integration/README.md

@ -1,9 +1,8 @@
RUN from project root directory:
`./gradlew :compose-compiler-integration:checkComposeCases`
To use specific version (the default is 0.0.0-SNASPHOT):
`./gradlew :compose-compiler-integration:checkComposeCases -PCOMPOSE_CORE_VERSION=0.5.0-build243`
To use specific version:
`./gradlew :compose-compiler-integration:checkComposeCases -PCOMPOSE_CORE_VERSION=1.0.0 -PCOMPOSE_WEB_VERSION=1.0.0
To fun only filtered cases (check for contained in file path):
`./gradlew :compose-compiler-integration:checkComposeCases -PFILTER_CASES=CaseName`

1
web/gradle.properties

@ -1,4 +1,3 @@
# __LATEST_COMPOSE_RELEASE_VERSION__
COMPOSE_CORE_VERSION=1.0.0
COMPOSE_WEB_VERSION=1.0.0
compose.web.buildSamples=false

Loading…
Cancel
Save