Browse Source

Fix examples, move all of them to Gradle 7.1.1

pull/1294/head
Nikolay Igotti 3 years ago
parent
commit
d876ecb0c4
  1. 1
      examples/codeviewer/common/build.gradle.kts
  2. 2
      examples/codeviewer/gradle/wrapper/gradle-wrapper.properties
  3. 5
      examples/falling-balls-web/build.gradle.kts
  4. 3
      examples/falling-balls-web/src/commonMain/kotlin/fallingBalls/Game.kt
  5. 2
      examples/falling-balls-web/src/commonMain/kotlin/fallingBalls/Piece.kt
  6. 4
      examples/falling-balls-web/src/commonMain/kotlin/fallingBalls/PieceData.kt
  7. 2
      examples/falling-balls-web/src/commonMain/kotlin/fallingBalls/fallingBalls.kt
  8. 2
      examples/falling-balls-web/src/commonMain/kotlin/modifiers/position.kt
  9. 2
      examples/falling-balls-web/src/jsMain/kotlin/modifiers/position.kt
  10. 2
      examples/falling-balls/build.gradle.kts
  11. 2
      examples/falling-balls/gradle/wrapper/gradle-wrapper.properties
  12. 2
      examples/intellij-plugin/build.gradle.kts
  13. 2
      examples/todoapp-lite/build.gradle.kts

1
examples/codeviewer/common/build.gradle.kts

@ -28,7 +28,6 @@ kotlin {
} }
named("desktopMain") { named("desktopMain") {
kotlin.srcDirs("src/jvmMain/kotlin") kotlin.srcDirs("src/jvmMain/kotlin")
resources.srcDirs("src/commonMain/resources")
dependencies { dependencies {
api(compose.desktop.common) api(compose.desktop.common)
} }

2
examples/codeviewer/gradle/wrapper/gradle-wrapper.properties vendored

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

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

@ -3,8 +3,8 @@ import org.jetbrains.compose.compose
import org.jetbrains.compose.desktop.application.dsl.TargetFormat import org.jetbrains.compose.desktop.application.dsl.TargetFormat
plugins { plugins {
kotlin("multiplatform") version "1.5.21" kotlin("multiplatform") version "1.5.31"
id("org.jetbrains.compose") version "1.0.0-alpha1-rc5" id("org.jetbrains.compose") version "0.0.0-master-build423"
} }
version = "1.0-SNAPSHOT" version = "1.0-SNAPSHOT"
@ -79,5 +79,6 @@ compose.desktop {
afterEvaluate { afterEvaluate {
rootProject.extensions.configure<NodeJsRootExtension> { rootProject.extensions.configure<NodeJsRootExtension> {
versions.webpackDevServer.version = "4.0.0" versions.webpackDevServer.version = "4.0.0"
versions.webpackCli.version = "4.9.0"
} }
} }

3
examples/falling-balls-web/src/commonMain/kotlin/fallingBalls/Game.kt

@ -6,11 +6,14 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import org.jetbrains.compose.common.ui.unit.IntSize import org.jetbrains.compose.common.ui.unit.IntSize
import org.jetbrains.compose.common.core.graphics.Color import org.jetbrains.compose.common.core.graphics.Color
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi
import kotlin.random.Random import kotlin.random.Random
@OptIn(ExperimentalComposeWebWidgetsApi::class)
private fun Color.Companion.random() = private fun Color.Companion.random() =
Color((0..255).random(), (0..255).random(), (0..255).random()) Color((0..255).random(), (0..255).random(), (0..255).random())
@OptIn(ExperimentalComposeWebWidgetsApi::class)
abstract class Game { abstract class Game {
internal var previousTime: Long = Long.MAX_VALUE internal var previousTime: Long = Long.MAX_VALUE
private var startTime = 0L private var startTime = 0L

2
examples/falling-balls-web/src/commonMain/kotlin/fallingBalls/Piece.kt

@ -14,7 +14,9 @@ import org.jetbrains.compose.common.ui.draw.clip
import org.jetbrains.compose.common.core.graphics.Color import org.jetbrains.compose.common.core.graphics.Color
import jetbrains.compose.common.shapes.CircleShape import jetbrains.compose.common.shapes.CircleShape
import org.jetbrains.compose.common.demo.position import org.jetbrains.compose.common.demo.position
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi
@OptIn(ExperimentalComposeWebWidgetsApi::class)
@Composable @Composable
fun Piece(index: Int, piece: PieceData) { fun Piece(index: Int, piece: PieceData) {
val boxSize = 40.dp val boxSize = 40.dp

4
examples/falling-balls-web/src/commonMain/kotlin/fallingBalls/PieceData.kt

@ -4,8 +4,10 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
import org.jetbrains.compose.common.core.graphics.Color import org.jetbrains.compose.common.core.graphics.Color
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi
data class PieceData(val game: Game, val velocity: Float, val color: Color) { @OptIn(ExperimentalComposeWebWidgetsApi::class)
data class PieceData constructor(val game: Game, val velocity: Float, val color: Color) {
var picked: Boolean by mutableStateOf(false) var picked: Boolean by mutableStateOf(false)
var position: Float by mutableStateOf(0f) var position: Float by mutableStateOf(0f)

2
examples/falling-balls-web/src/commonMain/kotlin/fallingBalls/fallingBalls.kt

@ -22,7 +22,9 @@ import org.jetbrains.compose.common.ui.size
import org.jetbrains.compose.common.core.graphics.Color import org.jetbrains.compose.common.core.graphics.Color
import org.jetbrains.compose.common.foundation.layout.fillMaxHeight import org.jetbrains.compose.common.foundation.layout.fillMaxHeight
import org.jetbrains.compose.common.foundation.layout.fillMaxWidth import org.jetbrains.compose.common.foundation.layout.fillMaxWidth
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi
@OptIn(ExperimentalComposeWebWidgetsApi::class)
@Composable @Composable
fun fallingBalls(game: Game) { fun fallingBalls(game: Game) {
Column(Modifier.fillMaxWidth().fillMaxHeight(1f)) { Column(Modifier.fillMaxWidth().fillMaxHeight(1f)) {

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

@ -1,8 +1,10 @@
package org.jetbrains.compose.common.demo package org.jetbrains.compose.common.demo
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi
import org.jetbrains.compose.common.ui.Modifier import org.jetbrains.compose.common.ui.Modifier
import org.jetbrains.compose.common.ui.unit.Dp import org.jetbrains.compose.common.ui.unit.Dp
@OptIn(ExperimentalComposeWebWidgetsApi::class)
@Composable @Composable
expect fun Modifier.position(width: Dp, height: Dp): Modifier expect fun Modifier.position(width: Dp, height: Dp): Modifier

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

@ -5,12 +5,14 @@ import org.jetbrains.compose.common.ui.Modifier
import org.jetbrains.compose.common.foundation.layout.offset import org.jetbrains.compose.common.foundation.layout.offset
import org.jetbrains.compose.common.ui.unit.Dp import org.jetbrains.compose.common.ui.unit.Dp
import org.jetbrains.compose.common.internal.castOrCreate import org.jetbrains.compose.common.internal.castOrCreate
import org.jetbrains.compose.common.ui.ExperimentalComposeWebWidgetsApi
import org.jetbrains.compose.web.css.top import org.jetbrains.compose.web.css.top
import org.jetbrains.compose.web.css.left import org.jetbrains.compose.web.css.left
import org.jetbrains.compose.web.css.px import org.jetbrains.compose.web.css.px
import org.jetbrains.compose.web.css.position import org.jetbrains.compose.web.css.position
import org.jetbrains.compose.web.css.Position import org.jetbrains.compose.web.css.Position
@OptIn(ExperimentalComposeWebWidgetsApi::class)
@Composable @Composable
actual fun Modifier.position(width: Dp, height: Dp): Modifier = castOrCreate().apply { actual fun Modifier.position(width: Dp, height: Dp): Modifier = castOrCreate().apply {
add { add {

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

@ -6,7 +6,7 @@ plugins {
// __KOTLIN_COMPOSE_VERSION__ // __KOTLIN_COMPOSE_VERSION__
kotlin("jvm") version "1.5.31" kotlin("jvm") version "1.5.31"
// __LATEST_COMPOSE_RELEASE_VERSION__ // __LATEST_COMPOSE_RELEASE_VERSION__
id("org.jetbrains.compose") version "0.0.0-master-build413" id("org.jetbrains.compose") version "0.0.0-master-build423"
} }
group = "me.user" group = "me.user"

2
examples/falling-balls/gradle/wrapper/gradle-wrapper.properties vendored

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

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

@ -5,7 +5,7 @@ plugins {
java java
kotlin("jvm") version "1.5.31" kotlin("jvm") version "1.5.31"
// __LATEST_COMPOSE_RELEASE_VERSION__ // __LATEST_COMPOSE_RELEASE_VERSION__
id("org.jetbrains.compose") version "1.0.0-alpha4-build361" id("org.jetbrains.compose") version "0.0.0-master-build423"
id("idea") id("idea")
} }

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

@ -7,7 +7,7 @@ buildscript {
dependencies { dependencies {
// __LATEST_COMPOSE_RELEASE_VERSION__ // __LATEST_COMPOSE_RELEASE_VERSION__
classpath("org.jetbrains.compose:compose-gradle-plugin:1.0.0-alpha4-build411") classpath("org.jetbrains.compose:compose-gradle-plugin:0.0.0-master-build423")
classpath("com.android.tools.build:gradle:4.1.0") classpath("com.android.tools.build:gradle:4.1.0")
classpath(kotlin("gradle-plugin", version = "1.5.31")) classpath(kotlin("gradle-plugin", version = "1.5.31"))
} }

Loading…
Cancel
Save