From ced58ee7078e7880d1a2051a74200777fb8f3ecd Mon Sep 17 00:00:00 2001 From: Shagen Ogandzhanian Date: Thu, 26 Aug 2021 16:10:53 +0200 Subject: [PATCH 01/14] Build web with gradle@7.1.1 and web-landing example --- .../gradle/wrapper/gradle-wrapper.properties | 2 +- examples/web-landing/gradlew.bat | 178 +++++++++--------- web/gradle/wrapper/gradle-wrapper.properties | 2 +- web/gradlew.bat | 178 +++++++++--------- 4 files changed, 180 insertions(+), 180 deletions(-) diff --git a/examples/web-landing/gradle/wrapper/gradle-wrapper.properties b/examples/web-landing/gradle/wrapper/gradle-wrapper.properties index 29e4134576..af7be50b10 100644 --- a/examples/web-landing/gradle/wrapper/gradle-wrapper.properties +++ b/examples/web-landing/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/web-landing/gradlew.bat b/examples/web-landing/gradlew.bat index 107acd32c4..ac1b06f938 100644 --- a/examples/web-landing/gradlew.bat +++ b/examples/web-landing/gradlew.bat @@ -1,89 +1,89 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/web/gradle/wrapper/gradle-wrapper.properties b/web/gradle/wrapper/gradle-wrapper.properties index 29e4134576..af7be50b10 100644 --- a/web/gradle/wrapper/gradle-wrapper.properties +++ b/web/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/web/gradlew.bat b/web/gradlew.bat index 107acd32c4..ac1b06f938 100644 --- a/web/gradlew.bat +++ b/web/gradlew.bat @@ -1,89 +1,89 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega From ebb116999f0699ee8575dc57f3f79edc8c3e1f7c Mon Sep 17 00:00:00 2001 From: Igor Demin Date: Thu, 26 Aug 2021 23:20:20 +0300 Subject: [PATCH 02/14] Desktop. Templates. Update versions --- templates/desktop-template/build.gradle.kts | 2 +- templates/multiplatform-template/build.gradle.kts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/desktop-template/build.gradle.kts b/templates/desktop-template/build.gradle.kts index 26f1814bb0..c6a0b393f5 100644 --- a/templates/desktop-template/build.gradle.kts +++ b/templates/desktop-template/build.gradle.kts @@ -5,7 +5,7 @@ plugins { // __KOTLIN_COMPOSE_VERSION__ kotlin("jvm") version "1.5.21" // __LATEST_COMPOSE_RELEASE_VERSION__ - id("org.jetbrains.compose") version (System.getenv("COMPOSE_TEMPLATE_COMPOSE_VERSION") ?: "1.0.0-alpha1") + id("org.jetbrains.compose") version (System.getenv("COMPOSE_TEMPLATE_COMPOSE_VERSION") ?: "1.0.0-alpha3") } repositories { diff --git a/templates/multiplatform-template/build.gradle.kts b/templates/multiplatform-template/build.gradle.kts index e3a349a9cd..631c3f9c89 100644 --- a/templates/multiplatform-template/build.gradle.kts +++ b/templates/multiplatform-template/build.gradle.kts @@ -1,6 +1,6 @@ buildscript { // __LATEST_COMPOSE_RELEASE_VERSION__ - val composeVersion = System.getenv("COMPOSE_TEMPLATE_COMPOSE_VERSION") ?: "1.0.0-alpha1" + val composeVersion = System.getenv("COMPOSE_TEMPLATE_COMPOSE_VERSION") ?: "1.0.0-alpha3" repositories { mavenCentral() @@ -10,7 +10,7 @@ buildscript { dependencies { classpath("org.jetbrains.compose:compose-gradle-plugin:$composeVersion") - classpath("com.android.tools.build:gradle:4.0.1") + classpath("com.android.tools.build:gradle:4.1.3") // __KOTLIN_COMPOSE_VERSION__ classpath(kotlin("gradle-plugin", version = "1.5.21")) } From c0735db613bfbaf15242e9848f74e11d8ce2d585 Mon Sep 17 00:00:00 2001 From: Shagen Ogandzhanian Date: Thu, 26 Aug 2021 23:40:13 +0200 Subject: [PATCH 03/14] [web] [ci] Don't install gradle in Dockerfile-Basic --- ci/docker/compose-web/Dockerfile-Basic | 7 ------- 1 file changed, 7 deletions(-) diff --git a/ci/docker/compose-web/Dockerfile-Basic b/ci/docker/compose-web/Dockerfile-Basic index ed09cedbbc..80cd763ea1 100644 --- a/ci/docker/compose-web/Dockerfile-Basic +++ b/ci/docker/compose-web/Dockerfile-Basic @@ -22,12 +22,6 @@ RUN export CHROME_DRIVER_VERSION=$(wget -qO- https://chromedriver.storage.google && wget https://chromedriver.storage.googleapis.com/${CHROME_DRIVER_VERSION}/chromedriver_linux64.zip -P ~/tmp \ && mkdir -p /root/.gradle/selenium/chrome && unzip -d /root/.gradle/selenium/chrome ~/tmp/chromedriver_linux64.zip && rm ~/tmp/chromedriver_linux64.zip -ARG GRADLE_VERSION=7.0.2 -RUN wget https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip -P /tmp -RUN unzip -d /opt/gradle /tmp/gradle-${GRADLE_VERSION}-bin.zip -ENV GRADLE_HOME=/opt/gradle/gradle-${GRADLE_VERSION} -ENV PATH=$GRADLE_HOME/bin:$PATH - ARG CHROME_VERSION="google-chrome-stable" RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - RUN echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \ @@ -35,5 +29,4 @@ RUN echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/so ${CHROME_VERSION:-google-chrome-stable} COPY chrome-no-sandbox /usr/bin/chrome-no-sandbox -COPY gradle.properties /root/.gradle/gradle.properties RUN chmod u+x /usr/bin/chrome-no-sandbox From 166b314919104819ef3c18b732897a389aa648ce Mon Sep 17 00:00:00 2001 From: Shagen Ogandzhanian Date: Thu, 26 Aug 2021 23:57:01 +0200 Subject: [PATCH 04/14] [web] [ci] always install latest firefox --- ci/docker/compose-web/Dockerfile-Basic | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/ci/docker/compose-web/Dockerfile-Basic b/ci/docker/compose-web/Dockerfile-Basic index 80cd763ea1..1c34bae67c 100644 --- a/ci/docker/compose-web/Dockerfile-Basic +++ b/ci/docker/compose-web/Dockerfile-Basic @@ -6,8 +6,6 @@ RUN echo "dash dash/sh boolean false" | debconf-set-selections RUN dpkg-reconfigure -f noninteractive dash RUN dpkg --add-architecture i386 && apt-get update -yqq && apt-get install -y \ - firefox \ - git \ gnupg2 \ openjdk-11-jdk \ python3 \ @@ -15,6 +13,16 @@ RUN dpkg --add-architecture i386 && apt-get update -yqq && apt-get install -y \ unzip \ wget + +ARG CHROME_VERSION="google-chrome-stable" +RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - + +RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A6DCF7707EBC211F \ + && echo "deb http://ppa.launchpad.net/ubuntu-mozilla-security/ppa/ubuntu focal main" >> /etc/apt/sources.list.d/mozilla.list \ + && echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \ + && apt-get update -yqq \ + && apt-get install -y firefox ${CHROME_VERSION:-google-chrome-stable} + RUN wget https://github.com/mozilla/geckodriver/releases/download/v0.29.1/geckodriver-v0.29.1-linux64.tar.gz \ && tar -xvzf geckodriver-v0.29.1-linux64.tar.gz && mkdir -p /root/.gradle/selenium/gecko &&mv geckodriver /root/.gradle/selenium/gecko @@ -22,11 +30,5 @@ RUN export CHROME_DRIVER_VERSION=$(wget -qO- https://chromedriver.storage.google && wget https://chromedriver.storage.googleapis.com/${CHROME_DRIVER_VERSION}/chromedriver_linux64.zip -P ~/tmp \ && mkdir -p /root/.gradle/selenium/chrome && unzip -d /root/.gradle/selenium/chrome ~/tmp/chromedriver_linux64.zip && rm ~/tmp/chromedriver_linux64.zip -ARG CHROME_VERSION="google-chrome-stable" -RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - -RUN echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \ - && apt-get update -yqq && apt-get install -y \ - ${CHROME_VERSION:-google-chrome-stable} - COPY chrome-no-sandbox /usr/bin/chrome-no-sandbox RUN chmod u+x /usr/bin/chrome-no-sandbox From 239d5d59700778746b758770687984822618a93c Mon Sep 17 00:00:00 2001 From: Shagen Ogandzhanian Date: Fri, 27 Aug 2021 13:26:30 +0200 Subject: [PATCH 05/14] [web] [ci] Install specific Firefox version and make it possible to customize it in build --- ci/docker/compose-web/Dockerfile-Basic | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ci/docker/compose-web/Dockerfile-Basic b/ci/docker/compose-web/Dockerfile-Basic index 1c34bae67c..66b97669da 100644 --- a/ci/docker/compose-web/Dockerfile-Basic +++ b/ci/docker/compose-web/Dockerfile-Basic @@ -17,11 +17,14 @@ RUN dpkg --add-architecture i386 && apt-get update -yqq && apt-get install -y \ ARG CHROME_VERSION="google-chrome-stable" RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - -RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A6DCF7707EBC211F \ - && echo "deb http://ppa.launchpad.net/ubuntu-mozilla-security/ppa/ubuntu focal main" >> /etc/apt/sources.list.d/mozilla.list \ - && echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \ +RUN echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \ && apt-get update -yqq \ - && apt-get install -y firefox ${CHROME_VERSION:-google-chrome-stable} + && apt-get install -y ${CHROME_VERSION:-google-chrome-stable} + +ARG FIREFOX_VERSION="92.0b9" +RUN wget https://ftp.mozilla.org/pub/firefox/releases/${FIREFOX_VERSION}/linux-x86_64/en-US/firefox-${FIREFOX_VERSION}.tar.bz2 \ + && tar xvf firefox-${FIREFOX_VERSION}.tar.bz2 \ + && mv firefox/ /usr/bin/firefox RUN wget https://github.com/mozilla/geckodriver/releases/download/v0.29.1/geckodriver-v0.29.1-linux64.tar.gz \ && tar -xvzf geckodriver-v0.29.1-linux64.tar.gz && mkdir -p /root/.gradle/selenium/gecko &&mv geckodriver /root/.gradle/selenium/gecko From e5fed5aa7b04a11f0a0382a4958f5b1e6938893b Mon Sep 17 00:00:00 2001 From: Shagen Ogandzhanian Date: Fri, 27 Aug 2021 15:17:19 +0200 Subject: [PATCH 06/14] Revert 239d5d59700778746b758770687984822618a93c till further investigation This reverts commit 239d5d59700778746b758770687984822618a93c. --- ci/docker/compose-web/Dockerfile-Basic | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/ci/docker/compose-web/Dockerfile-Basic b/ci/docker/compose-web/Dockerfile-Basic index 66b97669da..1c34bae67c 100644 --- a/ci/docker/compose-web/Dockerfile-Basic +++ b/ci/docker/compose-web/Dockerfile-Basic @@ -17,14 +17,11 @@ RUN dpkg --add-architecture i386 && apt-get update -yqq && apt-get install -y \ ARG CHROME_VERSION="google-chrome-stable" RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - -RUN echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \ +RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A6DCF7707EBC211F \ + && echo "deb http://ppa.launchpad.net/ubuntu-mozilla-security/ppa/ubuntu focal main" >> /etc/apt/sources.list.d/mozilla.list \ + && echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \ && apt-get update -yqq \ - && apt-get install -y ${CHROME_VERSION:-google-chrome-stable} - -ARG FIREFOX_VERSION="92.0b9" -RUN wget https://ftp.mozilla.org/pub/firefox/releases/${FIREFOX_VERSION}/linux-x86_64/en-US/firefox-${FIREFOX_VERSION}.tar.bz2 \ - && tar xvf firefox-${FIREFOX_VERSION}.tar.bz2 \ - && mv firefox/ /usr/bin/firefox + && apt-get install -y firefox ${CHROME_VERSION:-google-chrome-stable} RUN wget https://github.com/mozilla/geckodriver/releases/download/v0.29.1/geckodriver-v0.29.1-linux64.tar.gz \ && tar -xvzf geckodriver-v0.29.1-linux64.tar.gz && mkdir -p /root/.gradle/selenium/gecko &&mv geckodriver /root/.gradle/selenium/gecko From f8ac4ad2c3dfd2d05d53ca57cf38070d2552cae0 Mon Sep 17 00:00:00 2001 From: Shagen Ogandzhanian Date: Fri, 27 Aug 2021 17:16:41 +0200 Subject: [PATCH 07/14] Don't run web-core tests in Firefox (till further investigation) --- web/core/build.gradle.kts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/web/core/build.gradle.kts b/web/core/build.gradle.kts index 6df6e53958..5246c4ac40 100644 --- a/web/core/build.gradle.kts +++ b/web/core/build.gradle.kts @@ -1,5 +1,4 @@ plugins { - //id("kotlin-multiplatform") kotlin("multiplatform") id("org.jetbrains.compose") } @@ -13,7 +12,7 @@ kotlin { testLogging.showStandardStreams = true useKarma { useChromeHeadless() - useFirefox() + //useFirefox() } } } From b3a4cbc9f3643b92092dcf4c3f972ed7aadd6f30 Mon Sep 17 00:00:00 2001 From: Igor Demin Date: Thu, 26 Aug 2021 14:49:35 +0300 Subject: [PATCH 08/14] Update Compose --- compose/.run/build extended icons.run.xml | 2 +- compose/.run/build.run.xml | 2 +- .../publish (without Android Layout Inspector).run.xml | 2 +- compose/README.md | 5 ++--- compose/frameworks/support | 2 +- compose/golden | 2 +- compose/gradle/wrapper/gradle-wrapper.properties | 2 +- compose/prebuilts/androidx/internal | 2 +- compose/scripts/downloadAndroidSdk | 10 ++++++---- compose/scripts/prepare | 2 +- 10 files changed, 16 insertions(+), 15 deletions(-) diff --git a/compose/.run/build extended icons.run.xml b/compose/.run/build extended icons.run.xml index b02cd3b814..397e072f21 100644 --- a/compose/.run/build extended icons.run.xml +++ b/compose/.run/build extended icons.run.xml @@ -4,7 +4,7 @@ diff --git a/compose/.run/build.run.xml b/compose/.run/build.run.xml index 4f02a631a2..e92e4e0022 100644 --- a/compose/.run/build.run.xml +++ b/compose/.run/build.run.xml @@ -4,7 +4,7 @@ diff --git a/compose/.run/publish (without Android Layout Inspector).run.xml b/compose/.run/publish (without Android Layout Inspector).run.xml index 95fcf49e1e..3583bc2f45 100644 --- a/compose/.run/publish (without Android Layout Inspector).run.xml +++ b/compose/.run/publish (without Android Layout Inspector).run.xml @@ -4,7 +4,7 @@ diff --git a/compose/README.md b/compose/README.md index 83c4cfb69a..1e48dc340f 100644 --- a/compose/README.md +++ b/compose/README.md @@ -15,13 +15,13 @@ git config --global submodule.recurse true - Java 11 (should be specified in JAVA_HOME) - [macOs/Linux] Android SDK downloaded via `./scripts/downloadAndroidSdk` - [Windows] Android SDK downloaded from Android Studio and specified in ANDROID_SDK_ROOT. Required components: - - Android 11 + - Android 12 - Build-Tools 30.0.3 - NDK 21.3.6528147 (in folder $androidSdk/ndk, not in $androidSdk/ndk/$version) - CMake 3.10.2.4988404 (in folder $androidSdk/cmake, not in $androidSdk/cmake/$version) ## Requirements to develop in IDE -- Android Studio Arctic Fox +- Android Studio 2021.1.1 Canary 8 (https://developer.android.com/studio/archive) - Custom Gradle 7.1 specified in `Settings -> Build, Execution, Deployment -> Build Tools -> Gradle` (because Android Studio will pick the wrong Gradle in the subproject instead of the Gradle in the root project) - Specified Gradle JDK 11 in `... -> Build Tools -> Gradle` - Environment variables: @@ -29,7 +29,6 @@ git config --global submodule.recurse true export ALLOW_PUBLIC_REPOS=1 export JAVA_TOOLS_JAR=$PWD/external/tools.jar export ANDROIDX_PROJECTS=COMPOSE -export COMPOSE_CUSTOM_GROUP=org.jetbrains.compose ``` - Gradle properties in ~/.gradle/gradle.properties: ``` diff --git a/compose/frameworks/support b/compose/frameworks/support index 30f010967c..efb2046671 160000 --- a/compose/frameworks/support +++ b/compose/frameworks/support @@ -1 +1 @@ -Subproject commit 30f010967cd12643134a80269c7eb2de65b2332b +Subproject commit efb20466711ebf8a29299d8d76de3ef4b1da741f diff --git a/compose/golden b/compose/golden index 1b20aa5514..2bc172b3d3 160000 --- a/compose/golden +++ b/compose/golden @@ -1 +1 @@ -Subproject commit 1b20aa551446123340cb42b4eb21d2f2797e608a +Subproject commit 2bc172b3d36904e78780624700c0d188acd83e1a diff --git a/compose/gradle/wrapper/gradle-wrapper.properties b/compose/gradle/wrapper/gradle-wrapper.properties index 1acc777d74..ffed3a254e 100644 --- a/compose/gradle/wrapper/gradle-wrapper.properties +++ b/compose/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/compose/prebuilts/androidx/internal b/compose/prebuilts/androidx/internal index 818a882ba7..c93d857e3c 160000 --- a/compose/prebuilts/androidx/internal +++ b/compose/prebuilts/androidx/internal @@ -1 +1 @@ -Subproject commit 818a882ba70e8603d6a22b17d421c9049926da4c +Subproject commit c93d857e3c972842489c8115fd6d3f2ff8e404e1 diff --git a/compose/scripts/downloadAndroidSdk b/compose/scripts/downloadAndroidSdk index 7f438aa19d..c06c08feb4 100755 --- a/compose/scripts/downloadAndroidSdk +++ b/compose/scripts/downloadAndroidSdk @@ -12,9 +12,11 @@ clone() { popd } +# Commit hashes and sdk versions from default.xml (git clone --branch androidx-main https://android.googlesource.com/platform/manifest) + downloadLinuxSDK() { - clone ../prebuilts/fullsdk-linux/platforms/android-30 https://android.googlesource.com/platform/prebuilts/fullsdk/platforms/android-30 master - clone ../prebuilts/fullsdk-linux/sources/android-30 https://android.googlesource.com/platform/prebuilts/fullsdk/sources/android-30 master + clone ../prebuilts/fullsdk-linux/platforms/android-31 https://android.googlesource.com/platform/prebuilts/fullsdk/platforms/android-31 master + clone ../prebuilts/fullsdk-linux/sources/android-31 https://android.googlesource.com/platform/prebuilts/fullsdk/sources/android-31 master clone ../prebuilts/fullsdk-linux/ndk https://android.googlesource.com/toolchain/prebuilts/ndk/r21 master clone ../prebuilts/fullsdk-linux/build-tools/30.0.3 https://android.googlesource.com/platform/prebuilts/fullsdk-linux/build-tools/30.0.3 master clone ../prebuilts/fullsdk-linux/platform-tools https://android.googlesource.com/platform/prebuilts/fullsdk-linux/platform-tools master @@ -23,8 +25,8 @@ downloadLinuxSDK() { } downloadMacOsSDK() { - clone ../prebuilts/fullsdk-darwin/platforms/android-30 https://android.googlesource.com/platform/prebuilts/fullsdk/platforms/android-30 master - clone ../prebuilts/fullsdk-darwin/sources/android-30 https://android.googlesource.com/platform/prebuilts/fullsdk/sources/android-30 master + clone ../prebuilts/fullsdk-darwin/platforms/android-31 https://android.googlesource.com/platform/prebuilts/fullsdk/platforms/android-31 master + clone ../prebuilts/fullsdk-darwin/sources/android-31 https://android.googlesource.com/platform/prebuilts/fullsdk/sources/android-31 master clone ../prebuilts/fullsdk-darwin/ndk https://android.googlesource.com/toolchain/prebuilts/ndk-darwin/r21 master clone ../prebuilts/fullsdk-darwin/build-tools/30.0.3 https://android.googlesource.com/platform/prebuilts/fullsdk-darwin/build-tools/30.0.3 master clone ../prebuilts/fullsdk-darwin/platform-tools https://android.googlesource.com/platform/prebuilts/fullsdk-darwin/platform-tools master diff --git a/compose/scripts/prepare b/compose/scripts/prepare index 63be054ca7..57dec964e5 100755 --- a/compose/scripts/prepare +++ b/compose/scripts/prepare @@ -6,4 +6,4 @@ export ALLOW_PUBLIC_REPOS=1 export JAVA_TOOLS_JAR=$SCRIPT_DIR/../external/tools.jar export ANDROIDX_PROJECTS=COMPOSE export COMPOSE_CUSTOM_GROUP=org.jetbrains.compose -export COMPOSE_DEFAULT_GRADLE_ARGS="-Pandroidx.compose.multiplatformEnabled=true -Pandroidx.versionExtraCheckEnabled=false -Pandroidx.alternativeProjectUrl=https://github.com/JetBrains/compose-jb -Pandroidx.compose.jsCompilerTestsEnabled=true" \ No newline at end of file +export COMPOSE_DEFAULT_GRADLE_ARGS="-Pandroidx.compose.multiplatformEnabled=true -Pandroidx.versionExtraCheckEnabled=false -Pandroidx.alternativeProjectUrl=https://github.com/JetBrains/compose-jb -Pandroidx.compose.jsCompilerTestsEnabled=true -Pandroidx.validateProjectStructure=false" \ No newline at end of file From c9a7b15e8657e06b41638cc70dea953dd7a3896b Mon Sep 17 00:00:00 2001 From: Igor Demin Date: Fri, 27 Aug 2021 17:17:27 +0300 Subject: [PATCH 09/14] Migrate to Kotlin 1.5.30 --- components/build.gradle.kts | 2 +- components/gradle.properties | 2 +- .../kotlin/org/jetbrains/compose/test/TestKotlinVersion.kt | 2 +- gradle-plugins/gradle.properties | 2 +- templates/desktop-template/build.gradle.kts | 4 ++-- templates/multiplatform-template/build.gradle.kts | 4 ++-- templates/web-template/build.gradle.kts | 4 ++-- web/buildSrc/build.gradle.kts | 2 +- .../main-template/build.gradle.kts | 2 +- web/gradle.properties | 4 ++-- web/settings.gradle.kts | 2 +- 11 files changed, 15 insertions(+), 15 deletions(-) diff --git a/components/build.gradle.kts b/components/build.gradle.kts index b24228ee1d..6dbdb19eab 100644 --- a/components/build.gradle.kts +++ b/components/build.gradle.kts @@ -10,7 +10,7 @@ buildscript { dependencies { classpath("org.jetbrains.compose:compose-gradle-plugin:$composeVersion") // __KOTLIN_COMPOSE_VERSION__ - classpath(kotlin("gradle-plugin", version = "1.5.21")) + classpath(kotlin("gradle-plugin", version = "1.5.30")) } } diff --git a/components/gradle.properties b/components/gradle.properties index d61dcdb7a9..2a97371d4b 100644 --- a/components/gradle.properties +++ b/components/gradle.properties @@ -4,4 +4,4 @@ android.enableJetifier=true kotlin.code.style=official # __LATEST_COMPOSE_RELEASE_VERSION__ -compose.version=1.0.0-alpha1 +compose.version=0.0.0-sync-2021-08-27-build327 diff --git a/gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/TestKotlinVersion.kt b/gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/TestKotlinVersion.kt index ceac76b168..b7b8ae01ef 100644 --- a/gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/TestKotlinVersion.kt +++ b/gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/TestKotlinVersion.kt @@ -8,6 +8,6 @@ package org.jetbrains.compose.test @Suppress("EnumEntryName") enum class TestKotlinVersion(val versionString: String) { // __KOTLIN_COMPOSE_VERSION__ - Default("1.5.21"), + Default("1.5.30"), V1_5_20("1.5.20") } \ No newline at end of file diff --git a/gradle-plugins/gradle.properties b/gradle-plugins/gradle.properties index c1419cc009..76cfd47b02 100644 --- a/gradle-plugins/gradle.properties +++ b/gradle-plugins/gradle.properties @@ -6,7 +6,7 @@ kotlin.code.style=official # unless overridden by COMPOSE_GRADLE_PLUGIN_COMPOSE_VERSION env var. # # __LATEST_COMPOSE_RELEASE_VERSION__ -compose.version=0.5.0-build262 +compose.version=0.0.0-sync-2021-08-27-build327 compose.with.web=false # A version of Gradle plugin, that will be published, diff --git a/templates/desktop-template/build.gradle.kts b/templates/desktop-template/build.gradle.kts index c6a0b393f5..ac3f413066 100644 --- a/templates/desktop-template/build.gradle.kts +++ b/templates/desktop-template/build.gradle.kts @@ -3,9 +3,9 @@ import org.jetbrains.compose.desktop.application.dsl.TargetFormat plugins { // __KOTLIN_COMPOSE_VERSION__ - kotlin("jvm") version "1.5.21" + kotlin("jvm") version "1.5.30" // __LATEST_COMPOSE_RELEASE_VERSION__ - id("org.jetbrains.compose") version (System.getenv("COMPOSE_TEMPLATE_COMPOSE_VERSION") ?: "1.0.0-alpha3") + id("org.jetbrains.compose") version (System.getenv("COMPOSE_TEMPLATE_COMPOSE_VERSION") ?: "0.0.0-sync-2021-08-27-build327") } repositories { diff --git a/templates/multiplatform-template/build.gradle.kts b/templates/multiplatform-template/build.gradle.kts index 631c3f9c89..6b0f73173f 100644 --- a/templates/multiplatform-template/build.gradle.kts +++ b/templates/multiplatform-template/build.gradle.kts @@ -1,6 +1,6 @@ buildscript { // __LATEST_COMPOSE_RELEASE_VERSION__ - val composeVersion = System.getenv("COMPOSE_TEMPLATE_COMPOSE_VERSION") ?: "1.0.0-alpha3" + val composeVersion = System.getenv("COMPOSE_TEMPLATE_COMPOSE_VERSION") ?: "0.0.0-sync-2021-08-27-build327" repositories { mavenCentral() @@ -12,7 +12,7 @@ buildscript { 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.21")) + classpath(kotlin("gradle-plugin", version = "1.5.30")) } } diff --git a/templates/web-template/build.gradle.kts b/templates/web-template/build.gradle.kts index 57e88a1176..4860669a1f 100644 --- a/templates/web-template/build.gradle.kts +++ b/templates/web-template/build.gradle.kts @@ -3,9 +3,9 @@ import org.jetbrains.compose.desktop.application.dsl.TargetFormat plugins { // __KOTLIN_COMPOSE_VERSION__ - kotlin("multiplatform") version "1.5.21" + kotlin("multiplatform") version "1.5.30" // __LATEST_COMPOSE_RELEASE_VERSION__ - id("org.jetbrains.compose") version ("1.0.0-alpha1") + id("org.jetbrains.compose") version ("0.0.0-sync-2021-08-27-build327") } repositories { diff --git a/web/buildSrc/build.gradle.kts b/web/buildSrc/build.gradle.kts index e1bd854525..30162436e7 100644 --- a/web/buildSrc/build.gradle.kts +++ b/web/buildSrc/build.gradle.kts @@ -10,5 +10,5 @@ repositories { } plugins { - id("org.jetbrains.kotlin.jvm") version "1.5.21" + id("org.jetbrains.kotlin.jvm") version "1.5.30" } diff --git a/web/compose-compiler-integration/main-template/build.gradle.kts b/web/compose-compiler-integration/main-template/build.gradle.kts index 04b3a5a6fd..2f3e62f08b 100644 --- a/web/compose-compiler-integration/main-template/build.gradle.kts +++ b/web/compose-compiler-integration/main-template/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - kotlin("multiplatform") version "1.5.21" + kotlin("multiplatform") version "1.5.30" id("org.jetbrains.compose") } diff --git a/web/gradle.properties b/web/gradle.properties index 59aaa5057e..dfb44f843f 100644 --- a/web/gradle.properties +++ b/web/gradle.properties @@ -1,6 +1,6 @@ # __LATEST_COMPOSE_RELEASE_VERSION__ -COMPOSE_CORE_VERSION=1.0.0-alpha4-build321 -COMPOSE_WEB_VERSION=1.0.0-alpha4 +COMPOSE_CORE_VERSION=0.0.0-sync-2021-08-27-build327 +COMPOSE_WEB_VERSION=0.0.0-sync-2021-08-27-build327 compose.web.buildSamples=false compose.web.tests.integration.withFirefox compose.web.tests.skip.benchmarks=false diff --git a/web/settings.gradle.kts b/web/settings.gradle.kts index fd760eebbf..530d042824 100644 --- a/web/settings.gradle.kts +++ b/web/settings.gradle.kts @@ -18,7 +18,7 @@ pluginManagement { println("[build] compose core version: ${extra["COMPOSE_CORE_VERSION"]}") useModule("org.jetbrains.compose:org.jetbrains.compose.gradle.plugin:${extra["COMPOSE_CORE_VERSION"]}") } else if (requested.id.id == "org.jetbrains.kotlin.multiplatform") { - useModule("org.jetbrains.kotlin.multiplatform:org.jetbrains.kotlin.multiplatform.gradle.plugin:1.5.21") + useModule("org.jetbrains.kotlin.multiplatform:org.jetbrains.kotlin.multiplatform.gradle.plugin:1.5.30") } } } From 128bbcf262153597bfc51c95be54dad6b629b302 Mon Sep 17 00:00:00 2001 From: Igor Demin Date: Fri, 27 Aug 2021 19:51:35 +0300 Subject: [PATCH 10/14] Fix tutorials --- tutorials/Context_Menu/README.md | 15 +++++++-------- tutorials/Mouse_Events/README.md | 7 +++++++ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/tutorials/Context_Menu/README.md b/tutorials/Context_Menu/README.md index 14409aeeae..e1e330841d 100644 --- a/tutorials/Context_Menu/README.md +++ b/tutorials/Context_Menu/README.md @@ -60,6 +60,7 @@ To enable additional context menu items for TextField and Text components, Conte ```kotlin import androidx.compose.desktop.DesktopMaterialTheme import androidx.compose.foundation.ContextMenuDataProvider +import androidx.compose.foundation.ContextMenuItem import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.height @@ -70,14 +71,13 @@ import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.ui.ExperimentalComposeUiApi import androidx.compose.ui.Modifier -import androidx.compose.ui.platform.ContextMenuItem import androidx.compose.ui.unit.dp import androidx.compose.ui.window.singleWindowApplication @OptIn(ExperimentalComposeUiApi::class, androidx.compose.foundation.ExperimentalFoundationApi::class) fun main() = singleWindowApplication(title = "Context menu") { - DesktopMaterialTheme { //it is mandatory for Context Menu - val text = remember {mutableStateOf("Hello!")} + DesktopMaterialTheme { //it is mandatory for Context Menu + val text = remember {mutableStateOf("Hello!")} Column { ContextMenuDataProvider( items = { @@ -100,7 +100,7 @@ fun main() = singleWindowApplication(title = "Context menu") { } } } - } + } } ``` In this example Text/TextField context menus will be extended with two additional items. @@ -109,9 +109,9 @@ In this example Text/TextField context menus will be extended with two additiona There is a possibility to create a context menu for an arbitrary application window area. This is implemented using ContextMenuArea API that is similar to ContextMenuDataProvider. ```kotlin - import androidx.compose.desktop.DesktopMaterialTheme import androidx.compose.foundation.ContextMenuArea +import androidx.compose.foundation.ContextMenuItem import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.height @@ -119,13 +119,12 @@ import androidx.compose.foundation.layout.width import androidx.compose.ui.ExperimentalComposeUiApi import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color -import androidx.compose.ui.platform.ContextMenuItem import androidx.compose.ui.unit.dp import androidx.compose.ui.window.singleWindowApplication @OptIn(ExperimentalComposeUiApi::class, androidx.compose.foundation.ExperimentalFoundationApi::class) fun main() = singleWindowApplication(title = "Context menu") { - DesktopMaterialTheme { //it is mandatory for Context Menu + DesktopMaterialTheme { //it is mandatory for Context Menu ContextMenuArea(items = { listOf( ContextMenuItem("User-defined Action") {/*do something here*/}, @@ -135,7 +134,7 @@ fun main() = singleWindowApplication(title = "Context menu") { Box(modifier = Modifier.background(Color.Blue).height(100.dp).width(100.dp)) { } } - } + } } ``` Right click on the Blue Square will show a context menu with two items diff --git a/tutorials/Mouse_Events/README.md b/tutorials/Mouse_Events/README.md index 2c76118bb4..dad71a4fb5 100644 --- a/tutorials/Mouse_Events/README.md +++ b/tutorials/Mouse_Events/README.md @@ -167,6 +167,13 @@ import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier +import androidx.compose.ui.input.pointer.isAltPressed +import androidx.compose.ui.input.pointer.isCtrlPressed +import androidx.compose.ui.input.pointer.isMetaPressed +import androidx.compose.ui.input.pointer.isPrimaryPressed +import androidx.compose.ui.input.pointer.isSecondaryPressed +import androidx.compose.ui.input.pointer.isShiftPressed +import androidx.compose.ui.input.pointer.isTertiaryPressed import androidx.compose.ui.window.singleWindowApplication @OptIn(ExperimentalDesktopApi::class) From a8bc62c519949d0903273e54e32a762af7a42d3b Mon Sep 17 00:00:00 2001 From: Igor Demin Date: Fri, 27 Aug 2021 23:29:58 +0300 Subject: [PATCH 11/14] Migrate to 1.0.0-alpha4-build328 --- components/gradle.properties | 2 +- gradle-plugins/gradle.properties | 2 +- templates/desktop-template/build.gradle.kts | 2 +- templates/multiplatform-template/build.gradle.kts | 2 +- templates/web-template/build.gradle.kts | 2 +- web/gradle.properties | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/components/gradle.properties b/components/gradle.properties index 2a97371d4b..b6eb615666 100644 --- a/components/gradle.properties +++ b/components/gradle.properties @@ -4,4 +4,4 @@ android.enableJetifier=true kotlin.code.style=official # __LATEST_COMPOSE_RELEASE_VERSION__ -compose.version=0.0.0-sync-2021-08-27-build327 +compose.version=1.0.0-alpha4-build328 diff --git a/gradle-plugins/gradle.properties b/gradle-plugins/gradle.properties index 76cfd47b02..cafcd12b99 100644 --- a/gradle-plugins/gradle.properties +++ b/gradle-plugins/gradle.properties @@ -6,7 +6,7 @@ kotlin.code.style=official # unless overridden by COMPOSE_GRADLE_PLUGIN_COMPOSE_VERSION env var. # # __LATEST_COMPOSE_RELEASE_VERSION__ -compose.version=0.0.0-sync-2021-08-27-build327 +compose.version=1.0.0-alpha4-build328 compose.with.web=false # A version of Gradle plugin, that will be published, diff --git a/templates/desktop-template/build.gradle.kts b/templates/desktop-template/build.gradle.kts index ac3f413066..93c8e3026e 100644 --- a/templates/desktop-template/build.gradle.kts +++ b/templates/desktop-template/build.gradle.kts @@ -5,7 +5,7 @@ plugins { // __KOTLIN_COMPOSE_VERSION__ kotlin("jvm") version "1.5.30" // __LATEST_COMPOSE_RELEASE_VERSION__ - id("org.jetbrains.compose") version (System.getenv("COMPOSE_TEMPLATE_COMPOSE_VERSION") ?: "0.0.0-sync-2021-08-27-build327") + id("org.jetbrains.compose") version (System.getenv("COMPOSE_TEMPLATE_COMPOSE_VERSION") ?: "1.0.0-alpha4-build328") } repositories { diff --git a/templates/multiplatform-template/build.gradle.kts b/templates/multiplatform-template/build.gradle.kts index 6b0f73173f..5dc286906f 100644 --- a/templates/multiplatform-template/build.gradle.kts +++ b/templates/multiplatform-template/build.gradle.kts @@ -1,6 +1,6 @@ buildscript { // __LATEST_COMPOSE_RELEASE_VERSION__ - val composeVersion = System.getenv("COMPOSE_TEMPLATE_COMPOSE_VERSION") ?: "0.0.0-sync-2021-08-27-build327" + val composeVersion = System.getenv("COMPOSE_TEMPLATE_COMPOSE_VERSION") ?: "1.0.0-alpha4-build328" repositories { mavenCentral() diff --git a/templates/web-template/build.gradle.kts b/templates/web-template/build.gradle.kts index 4860669a1f..5718590f65 100644 --- a/templates/web-template/build.gradle.kts +++ b/templates/web-template/build.gradle.kts @@ -5,7 +5,7 @@ plugins { // __KOTLIN_COMPOSE_VERSION__ kotlin("multiplatform") version "1.5.30" // __LATEST_COMPOSE_RELEASE_VERSION__ - id("org.jetbrains.compose") version ("0.0.0-sync-2021-08-27-build327") + id("org.jetbrains.compose") version ("1.0.0-alpha4-build328") } repositories { diff --git a/web/gradle.properties b/web/gradle.properties index dfb44f843f..62265c53a8 100644 --- a/web/gradle.properties +++ b/web/gradle.properties @@ -1,6 +1,6 @@ # __LATEST_COMPOSE_RELEASE_VERSION__ -COMPOSE_CORE_VERSION=0.0.0-sync-2021-08-27-build327 -COMPOSE_WEB_VERSION=0.0.0-sync-2021-08-27-build327 +COMPOSE_CORE_VERSION=1.0.0-alpha4-build328 +COMPOSE_WEB_VERSION=1.0.0-alpha4-build328 compose.web.buildSamples=false compose.web.tests.integration.withFirefox compose.web.tests.skip.benchmarks=false From 49bfb89c117db78552c888d90a6b8461ecd6bd1e Mon Sep 17 00:00:00 2001 From: Oleksandr Karpovich Date: Sat, 28 Aug 2021 18:42:04 +0200 Subject: [PATCH 12/14] Update Compose to include the fixes for web in compose plugin (FixComposableLambdaCalls.kt) --- compose/frameworks/support | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compose/frameworks/support b/compose/frameworks/support index efb2046671..f9fa0c45f4 160000 --- a/compose/frameworks/support +++ b/compose/frameworks/support @@ -1 +1 @@ -Subproject commit efb20466711ebf8a29299d8d76de3ef4b1da741f +Subproject commit f9fa0c45f480da2960e20a6007605d974b70cbcc From c8f91a9695a4bce0e0d0e6c66b8c4397143ad515 Mon Sep 17 00:00:00 2001 From: Shagen Ogandzhanian Date: Mon, 30 Aug 2021 22:10:20 +0200 Subject: [PATCH 13/14] Extract PositionTests from StaticComposableTests and use runTest in both --- .../jsTest/kotlin/StaticComposableTests.kt | 169 ++---------------- .../src/jsTest/kotlin/css/PositionTests.kt | 84 +++++++++ 2 files changed, 95 insertions(+), 158 deletions(-) create mode 100644 web/core/src/jsTest/kotlin/css/PositionTests.kt diff --git a/web/core/src/jsTest/kotlin/StaticComposableTests.kt b/web/core/src/jsTest/kotlin/StaticComposableTests.kt index 1b5dc868ee..9cb510b113 100644 --- a/web/core/src/jsTest/kotlin/StaticComposableTests.kt +++ b/web/core/src/jsTest/kotlin/StaticComposableTests.kt @@ -2,43 +2,29 @@ package org.jetbrains.compose.web.core.tests import org.jetbrains.compose.web.css.* import org.jetbrains.compose.web.dom.Div -import org.jetbrains.compose.web.dom.Span import org.jetbrains.compose.web.dom.Text -import org.jetbrains.compose.web.renderComposable -import org.w3c.dom.HTMLElement -import org.w3c.dom.get +import org.jetbrains.compose.web.testutils.runTest import kotlin.test.Test import kotlin.test.assertEquals -import kotlin.test.assertTrue -import org.jetbrains.compose.web.testutils.* class StaticComposableTests { @Test - fun emptyComposable() { - val root = "div".asHtmlElement() - renderComposable( - root = root - ) {} + fun emptyComposable() = runTest { + composition {} assertEquals("
", root.outerHTML) } @Test - fun textChild() { - val root = "div".asHtmlElement() - renderComposable( - root = root - ) { + fun textChild() = runTest { + composition { Text("inner text") } assertEquals("
inner text
", root.outerHTML) } @Test - fun attrs() { - val root = "div".asHtmlElement() - renderComposable( - root = root - ) { + fun attrs() = runTest { + composition { Div( attrs = { classes("some", "simple", "classes") @@ -50,8 +36,7 @@ class StaticComposableTests { ) } - val el = root.firstChild - assertTrue(el is HTMLElement, "element not found") + val el = nextChild() assertEquals("verySpecial", el.getAttribute("id")) assertEquals("some simple classes", el.getAttribute("class")) @@ -59,11 +44,8 @@ class StaticComposableTests { } @Test - fun styles() { - val root = "div".asHtmlElement() - renderComposable( - root = root - ) { + fun styles() = runTest { + composition { Div( { style { @@ -76,135 +58,6 @@ class StaticComposableTests { ) } - assertEquals("opacity: 0.2; color: green;", (root.children[0] as HTMLElement).style.cssText) - } - - - @Test - fun stylesTop() { - val root = "div".asHtmlElement() - renderComposable( - root = root - ) { - Div( - { - style { - top(100.px) - } - } - ) - Div( - { - style { - top(100.percent) - } - } - ) - } - - assertEquals("top: 100px;", (root.children[0] as HTMLElement).style.cssText) - assertEquals("top: 100%;", (root.children[1] as HTMLElement).style.cssText) - } - - @Test - fun stylesBottom() { - val root = "div".asHtmlElement() - renderComposable( - root = root - ) { - Div( - { - style { - bottom(100.px) - } - } - ) - Div( - { - style { - bottom(100.percent) - } - } - ) - } - - assertEquals("bottom: 100px;", (root.children[0] as HTMLElement).style.cssText) - assertEquals("bottom: 100%;", (root.children[1] as HTMLElement).style.cssText) - } - - @Test - fun stylesLeft() { - val root = "div".asHtmlElement() - renderComposable( - root = root - ) { - Div( - { - style { - left(100.px) - } - } - ) - Div( - { - style { - left(100.percent) - } - } - ) - } - - assertEquals("left: 100px;", (root.children[0] as HTMLElement).style.cssText) - assertEquals("left: 100%;", (root.children[1] as HTMLElement).style.cssText) - } - - @Test - fun stylesRight() { - val root = "div".asHtmlElement() - renderComposable( - root = root - ) { - Div( - { - style { - right(100.px) - } - } - ) - Div( - { - style { - right(100.percent) - } - } - ) - } - - assertEquals("right: 100px;", (root.children[0] as HTMLElement).style.cssText) - assertEquals("right: 100%;", (root.children[1] as HTMLElement).style.cssText) - } - - @Test - fun stylesPosition() = runTest { - val enumValues = Position.values() - - composition { - enumValues.forEach { position -> - Span( - { - style { - position(position) - } - } - ) - } - } - - enumValues.forEachIndexed { index, position -> - assertEquals( - "position: ${position.value};", - nextChild().style.cssText - ) - } + assertEquals("opacity: 0.2; color: green;", nextChild().style.cssText) } } diff --git a/web/core/src/jsTest/kotlin/css/PositionTests.kt b/web/core/src/jsTest/kotlin/css/PositionTests.kt new file mode 100644 index 0000000000..adda077e9e --- /dev/null +++ b/web/core/src/jsTest/kotlin/css/PositionTests.kt @@ -0,0 +1,84 @@ +/* + * 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. + */ + +package org.jetbrains.compose.web.core.tests.css + +import org.jetbrains.compose.web.core.tests.values +import org.jetbrains.compose.web.css.* +import org.jetbrains.compose.web.dom.Div +import org.jetbrains.compose.web.dom.Span +import org.jetbrains.compose.web.testutils.runTest +import kotlin.test.Test +import kotlin.test.assertEquals + +class PositionTests { + @Test + fun stylesTop() = runTest { + composition { + Div({ style { top(100.px) } }) + Div({ style { top(100.percent) } }) + } + + assertEquals("100px", nextChild().style.top) + assertEquals("100%", nextChild().style.top) + } + + @Test + fun stylesBottom() = runTest { + composition { + Div({ style { bottom(100.px) } }) + Div({ style { bottom(100.percent) } }) + } + + assertEquals("100px", nextChild().style.bottom) + assertEquals("100%", nextChild().style.bottom) + } + + @Test + fun stylesLeft() = runTest { + composition { + Div({ style { left(100.px) } }) + Div({ style { left(100.percent) } }) + } + + assertEquals("100px", nextChild().style.left) + assertEquals("100%", nextChild().style.left) + } + + @Test + fun stylesRight() = runTest { + composition { + Div({ style { right(100.px) } }) + Div({ style { right(100.percent) } }) + } + + assertEquals("100px", nextChild().style.right) + assertEquals("100%", nextChild().style.right) + } + + @Test + fun stylesPosition() = runTest { + val enumValues = Position.values() + + composition { + enumValues.forEach { position -> + Span( + { + style { + position(position) + } + } + ) + } + } + + enumValues.forEachIndexed { index, position -> + assertEquals( + "position: ${position.value};", + nextChild().style.cssText + ) + } + } +} \ No newline at end of file From d8de109ba1c7197ba72d40ca6e31d5f76b984b36 Mon Sep 17 00:00:00 2001 From: Shagen Ogandzhanian Date: Mon, 30 Aug 2021 22:21:48 +0200 Subject: [PATCH 14/14] [web] Re-enable Firefox tests after making build job non-parallel --- web/core/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/core/build.gradle.kts b/web/core/build.gradle.kts index 5246c4ac40..c80ed46a8c 100644 --- a/web/core/build.gradle.kts +++ b/web/core/build.gradle.kts @@ -12,7 +12,7 @@ kotlin { testLogging.showStandardStreams = true useKarma { useChromeHeadless() - //useFirefox() + useFirefox() } } }