Browse Source

Fix `web` module after upgrading it to Kotlin 1.7.20

Also rename COMPOSE_CORE_VERSION and COMPOSE_WEB_VERSION to compose.version (as in the other places). It simplifies

Also add .idea to the global .gitignore
fixWebForKotlin1720
Igor Demin 2 years ago
parent
commit
1bde85471b
  1. 8
      .gitignore
  2. 2
      tools/replace.sh
  3. 4
      web/build.gradle.kts
  4. 2
      web/buildSrc/gradle.properties
  5. 2
      web/compose-compiler-integration/README.md
  6. 4
      web/compose-compiler-integration/build.gradle.kts
  7. 4
      web/compose-compiler-integration/main-template/settings.gradle.kts
  8. 3
      web/gradle.properties
  9. 729
      web/kotlin-js-store/yarn.lock
  10. 2
      web/settings.gradle.kts

8
.gitignore vendored

@ -4,13 +4,7 @@ out
*.iml *.iml
.gradle .gradle
/local.properties /local.properties
/.idea .idea/
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store .DS_Store
build/ build/
/captures /captures

2
tools/replace.sh

@ -34,8 +34,6 @@ replaceCompose() {
replaceComposeInFile() { replaceComposeInFile() {
echo "Replace in $1" echo "Replace in $1"
replaceCompose '^compose.version=.*' 'compose.version='"$COMPOSE_VERSION"'' $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 '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 replaceCompose '"org.jetbrains.compose:compose-gradle-plugin:.*"' '"org.jetbrains.compose:compose-gradle-plugin:'"$COMPOSE_VERSION"'"' $1
} }

4
web/build.gradle.kts

@ -2,13 +2,13 @@ import org.gradle.api.tasks.testing.AbstractTestTask
import org.gradle.api.tasks.testing.logging.TestExceptionFormat import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.jetbrains.compose.gradle.kotlinKarmaConfig import org.jetbrains.compose.gradle.kotlinKarmaConfig
import org.jetbrains.kotlin.gradle.dsl.kotlinExtension import org.jetbrains.kotlin.gradle.dsl.kotlinExtension
import org.jetbrains.kotlin.gradle.plugin.mpp.pm20.targets import org.jetbrains.kotlin.gradle.plugin.mpp.pm20.util.targets
plugins { plugins {
kotlin("multiplatform") apply false kotlin("multiplatform") apply false
} }
val COMPOSE_WEB_VERSION: String by project val COMPOSE_WEB_VERSION: String = extra["compose.version"] as String
val COMPOSE_REPO_USERNAME: String? by project val COMPOSE_REPO_USERNAME: String? by project
val COMPOSE_REPO_KEY: String? by project val COMPOSE_REPO_KEY: String? by project
val COMPOSE_WEB_BUILD_WITH_SAMPLES = project.property("compose.web.buildSamples")!!.toString().toBoolean() val COMPOSE_WEB_BUILD_WITH_SAMPLES = project.property("compose.web.buildSamples")!!.toString().toBoolean()

2
web/buildSrc/gradle.properties

@ -1,2 +1,2 @@
# __KOTLIN_COMPOSE_VERSION__ # __KOTLIN_COMPOSE_VERSION__
kotlin.version=1.6.10 kotlin.version=1.7.20

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

@ -2,7 +2,7 @@ RUN from project root directory:
`./gradlew :compose-compiler-integration:checkComposeCases` `./gradlew :compose-compiler-integration:checkComposeCases`
To use specific version: To use specific version:
`./gradlew :compose-compiler-integration:checkComposeCases -PCOMPOSE_CORE_VERSION=1.0.1-rc2 -PCOMPOSE_WEB_VERSION=1.0.1-rc2 `./gradlew :compose-compiler-integration:checkComposeCases -Pcompose.version=1.2.0-beta03
To fun only filtered cases (check for contained in file path): To fun only filtered cases (check for contained in file path):
`./gradlew :compose-compiler-integration:checkComposeCases -PFILTER_CASES=CaseName` `./gradlew :compose-compiler-integration:checkComposeCases -PFILTER_CASES=CaseName`

4
web/compose-compiler-integration/build.gradle.kts

@ -61,7 +61,7 @@ fun build(
) { ) {
val isWin = System.getProperty("os.name").startsWith("Win") val isWin = System.getProperty("os.name").startsWith("Win")
val arguments = buildCmd.toMutableList().also { val arguments = buildCmd.toMutableList().also {
it.add("-PCOMPOSE_CORE_VERSION=$composeVersion") it.add("-Pcompose.version=$composeVersion")
it.add("-Pkotlin.version=$kotlinVersion") it.add("-Pkotlin.version=$kotlinVersion")
}.toTypedArray() }.toTypedArray()
@ -176,7 +176,7 @@ fun runCasesInDirectory(
tasks.register("checkComposeCases") { tasks.register("checkComposeCases") {
doLast { doLast {
val filterCases = project.findProperty("FILTER_CASES")?.toString() ?: "" val filterCases = project.findProperty("FILTER_CASES")?.toString() ?: ""
val composeVersion = project.findProperty("COMPOSE_CORE_VERSION")?.toString() ?: "0.0.0-SNASPHOT" val composeVersion = project.findProperty("compose.version")?.toString() ?: "0.0.0-SNASPHOT"
val kotlinVersion = kotlin.coreLibrariesVersion val kotlinVersion = kotlin.coreLibrariesVersion
val expectedFailingCasesDir = File("${projectDir.absolutePath}/testcases/failing") val expectedFailingCasesDir = File("${projectDir.absolutePath}/testcases/failing")

4
web/compose-compiler-integration/main-template/settings.gradle.kts

@ -12,8 +12,8 @@ pluginManagement {
println("KotlinVersion=[$kotlinVersion]") println("KotlinVersion=[$kotlinVersion]")
eachPlugin { eachPlugin {
if (requested.id.id == "org.jetbrains.compose") { if (requested.id.id == "org.jetbrains.compose") {
val useVersion = if (extra.has("COMPOSE_CORE_VERSION")) { val useVersion = if (extra.has("compose.version")) {
extra["COMPOSE_CORE_VERSION"].toString() extra["compose.version"].toString()
} else { } else {
"0.0.0-SNASPHOT" "0.0.0-SNASPHOT"
} }

3
web/gradle.properties

@ -1,5 +1,4 @@
COMPOSE_CORE_VERSION=1.1.0 compose.version=1.2.0-beta03
COMPOSE_WEB_VERSION=1.1.0
compose.web.buildSamples=false compose.web.buildSamples=false
compose.web.tests.integration.withFirefox compose.web.tests.integration.withFirefox
compose.web.tests.skip.benchmarks=false compose.web.tests.skip.benchmarks=false

729
web/kotlin-js-store/yarn.lock

File diff suppressed because it is too large Load Diff

2
web/settings.gradle.kts

@ -1,5 +1,5 @@
pluginManagement { pluginManagement {
val COMPOSE_CORE_VERSION: String by settings val COMPOSE_CORE_VERSION = extra["compose.version"] as String
println("[build] compose core version: $COMPOSE_CORE_VERSION") println("[build] compose core version: $COMPOSE_CORE_VERSION")
// pluginManagement section won't see outer scope, hence the FQ names // pluginManagement section won't see outer scope, hence the FQ names

Loading…
Cancel
Save