Browse Source
Will be added [on CI](https://teamcity.jetbrains.com/buildConfiguration/JetBrainsPublicProjects_Compose_Task4ValidateTemplatesTutorials/4947977?buildTab=log&focusLine=1209&logView=flowAware) JPS (build tool for IntelliJ) uses POM files for dependency management. Occasianally, there are errors in POM files, which leads to inability to use Compose in IntelliJ. To avoid this, better to run CI checks. This fails: ``` mvn install exec:java -Dexec.mainClass="MainKt" -Dkotlin.version=2.0.21 -Dcompose.version=1.8.0-alpha01 ``` (https://youtrack.jetbrains.com/issue/CMP-7406/CMP-1.8.0-alpha01-doesnt-work-with-JPS-and-Maven) This don't: ``` mvn install exec:java -Dexec.mainClass="MainKt" -Dkotlin.version=2.0.21 -Dcompose.version=1.8.0+dev2001 ```pull/5206/head
5 changed files with 243 additions and 0 deletions
@ -0,0 +1,16 @@ |
|||||||
|
*.iml |
||||||
|
.gradle |
||||||
|
/local.properties |
||||||
|
/.idea |
||||||
|
/.idea/caches |
||||||
|
/.idea/libraries |
||||||
|
/.idea/modules.xml |
||||||
|
/.idea/workspace.xml |
||||||
|
/.idea/navEditor.xml |
||||||
|
/.idea/assetWizardSettings.xml |
||||||
|
.DS_Store |
||||||
|
build/ |
||||||
|
target/ |
||||||
|
/captures |
||||||
|
.externalNativeBuild |
||||||
|
.cxx |
||||||
@ -0,0 +1,5 @@ |
|||||||
|
The purpose of this test project is to check if Compose Multiplatform is resolvable via pom files, which are used by JPS, which is used by IntelliJ |
||||||
|
|
||||||
|
``` |
||||||
|
mvn install exec:java -Dexec.mainClass="MainKt" -Dkotlin.version=2.1.0 -Dcompose.version=1.8.0-alpha02 |
||||||
|
``` |
||||||
@ -0,0 +1,189 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||||
|
<modelVersion>4.0.0</modelVersion> |
||||||
|
|
||||||
|
<groupId>org.example</groupId> |
||||||
|
<artifactId>maven-test-project</artifactId> |
||||||
|
<version>1.0-SNAPSHOT</version> |
||||||
|
|
||||||
|
<properties> |
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
||||||
|
<kotlin.code.style>official</kotlin.code.style> |
||||||
|
<kotlin.compiler.jvmTarget>1.8</kotlin.compiler.jvmTarget> |
||||||
|
<kotlin.version>2.1.0</kotlin.version> |
||||||
|
<compose.version>1.8.0-alpha02</compose.version> |
||||||
|
</properties> |
||||||
|
|
||||||
|
<repositories> |
||||||
|
<repository> |
||||||
|
<id>mavenCentral</id> |
||||||
|
<url>https://repo1.maven.org/maven2/</url> |
||||||
|
</repository> |
||||||
|
<repository> |
||||||
|
<id>gMaven</id> |
||||||
|
<url>https://maven.google.com/</url> |
||||||
|
</repository> |
||||||
|
<repository> |
||||||
|
<id>composeDev</id> |
||||||
|
<url>https://maven.pkg.jetbrains.space/public/p/compose/dev</url> |
||||||
|
</repository> |
||||||
|
</repositories> |
||||||
|
|
||||||
|
<build> |
||||||
|
<sourceDirectory>src/main/kotlin</sourceDirectory> |
||||||
|
<testSourceDirectory>src/test/kotlin</testSourceDirectory> |
||||||
|
<plugins> |
||||||
|
<plugin> |
||||||
|
<groupId>org.jetbrains.kotlin</groupId> |
||||||
|
<artifactId>kotlin-maven-plugin</artifactId> |
||||||
|
<version>${kotlin.version}</version> |
||||||
|
<executions> |
||||||
|
<execution> |
||||||
|
<id>compile</id> |
||||||
|
<phase>compile</phase> |
||||||
|
<goals> |
||||||
|
<goal>compile</goal> |
||||||
|
</goals> |
||||||
|
</execution> |
||||||
|
<execution> |
||||||
|
<id>test-compile</id> |
||||||
|
<phase>test-compile</phase> |
||||||
|
<goals> |
||||||
|
<goal>test-compile</goal> |
||||||
|
</goals> |
||||||
|
</execution> |
||||||
|
</executions> |
||||||
|
<configuration> |
||||||
|
<args>org.jetbrains.kotlin:kotlin-compose-compiler-plugin-embeddable |
||||||
|
<arg>-Xplugin=${user.home}/.m2/repository/org/jetbrains/kotlin/kotlin-compose-compiler-plugin/${kotlin.version}/kotlin-compose-compiler-plugin-${kotlin.version}.jar</arg> |
||||||
|
</args> |
||||||
|
</configuration> |
||||||
|
</plugin> |
||||||
|
<plugin> |
||||||
|
<artifactId>maven-surefire-plugin</artifactId> |
||||||
|
<version>2.22.2</version> |
||||||
|
</plugin> |
||||||
|
<plugin> |
||||||
|
<artifactId>maven-failsafe-plugin</artifactId> |
||||||
|
<version>2.22.2</version> |
||||||
|
</plugin> |
||||||
|
<plugin> |
||||||
|
<groupId>org.codehaus.mojo</groupId> |
||||||
|
<artifactId>exec-maven-plugin</artifactId> |
||||||
|
<version>1.6.0</version> |
||||||
|
<configuration> |
||||||
|
<mainClass>MainKt</mainClass> |
||||||
|
</configuration> |
||||||
|
</plugin> |
||||||
|
</plugins> |
||||||
|
</build> |
||||||
|
|
||||||
|
<dependencies> |
||||||
|
<dependency> |
||||||
|
<groupId>org.jetbrains.kotlin</groupId> |
||||||
|
<artifactId>kotlin-test-junit5</artifactId> |
||||||
|
<version>${kotlin.version}</version> |
||||||
|
<scope>test</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>org.junit.jupiter</groupId> |
||||||
|
<artifactId>junit-jupiter</artifactId> |
||||||
|
<version>5.10.0</version> |
||||||
|
<scope>test</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>org.jetbrains.kotlin</groupId> |
||||||
|
<artifactId>kotlin-stdlib</artifactId> |
||||||
|
<version>${kotlin.version}</version> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>org.jetbrains.compose.material3</groupId> |
||||||
|
<artifactId>material3-desktop</artifactId> |
||||||
|
<version>${compose.version}</version> |
||||||
|
</dependency> |
||||||
|
|
||||||
|
<dependency> |
||||||
|
<groupId>org.jetbrains.compose.desktop</groupId> |
||||||
|
<artifactId>desktop-jvm-windows-x64</artifactId> |
||||||
|
<version>${compose.version}</version> |
||||||
|
<type>pom</type> |
||||||
|
<exclusions> |
||||||
|
<exclusion> |
||||||
|
<groupId>org.jetbrains.compose.desktop</groupId> |
||||||
|
<artifactId>desktop</artifactId> |
||||||
|
</exclusion> |
||||||
|
</exclusions> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>org.jetbrains.compose.desktop</groupId> |
||||||
|
<artifactId>desktop-jvm-windows-arm64</artifactId> |
||||||
|
<version>${compose.version}</version> |
||||||
|
<type>pom</type> |
||||||
|
<exclusions> |
||||||
|
<exclusion> |
||||||
|
<groupId>org.jetbrains.compose.desktop</groupId> |
||||||
|
<artifactId>desktop</artifactId> |
||||||
|
</exclusion> |
||||||
|
</exclusions> |
||||||
|
</dependency> |
||||||
|
|
||||||
|
<dependency> |
||||||
|
<groupId>org.jetbrains.compose.desktop</groupId> |
||||||
|
<artifactId>desktop-jvm-linux-x64</artifactId> |
||||||
|
<version>${compose.version}</version> |
||||||
|
<type>pom</type> |
||||||
|
<exclusions> |
||||||
|
<exclusion> |
||||||
|
<groupId>org.jetbrains.compose.desktop</groupId> |
||||||
|
<artifactId>desktop</artifactId> |
||||||
|
</exclusion> |
||||||
|
</exclusions> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>org.jetbrains.compose.desktop</groupId> |
||||||
|
<artifactId>desktop-jvm-linux-arm64</artifactId> |
||||||
|
<version>${compose.version}</version> |
||||||
|
<type>pom</type> |
||||||
|
<exclusions> |
||||||
|
<exclusion> |
||||||
|
<groupId>org.jetbrains.compose.desktop</groupId> |
||||||
|
<artifactId>desktop</artifactId> |
||||||
|
</exclusion> |
||||||
|
</exclusions> |
||||||
|
</dependency> |
||||||
|
|
||||||
|
<dependency> |
||||||
|
<groupId>org.jetbrains.compose.desktop</groupId> |
||||||
|
<artifactId>desktop-jvm-macos-x64</artifactId> |
||||||
|
<version>${compose.version}</version> |
||||||
|
<type>pom</type> |
||||||
|
<exclusions> |
||||||
|
<exclusion> |
||||||
|
<groupId>org.jetbrains.compose.desktop</groupId> |
||||||
|
<artifactId>desktop</artifactId> |
||||||
|
</exclusion> |
||||||
|
</exclusions> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>org.jetbrains.compose.desktop</groupId> |
||||||
|
<artifactId>desktop-jvm-macos-arm64</artifactId> |
||||||
|
<version>${compose.version}</version> |
||||||
|
<type>pom</type> |
||||||
|
<exclusions> |
||||||
|
<exclusion> |
||||||
|
<groupId>org.jetbrains.compose.desktop</groupId> |
||||||
|
<artifactId>desktop</artifactId> |
||||||
|
</exclusion> |
||||||
|
</exclusions> |
||||||
|
</dependency> |
||||||
|
|
||||||
|
<dependency> |
||||||
|
<groupId>org.jetbrains.kotlin</groupId> |
||||||
|
<artifactId>kotlin-compose-compiler-plugin</artifactId> |
||||||
|
<version>${kotlin.version}</version> |
||||||
|
</dependency> |
||||||
|
</dependencies> |
||||||
|
|
||||||
|
</project> |
||||||
@ -0,0 +1,30 @@ |
|||||||
|
import androidx.compose.material3.Button |
||||||
|
import androidx.compose.material3.MaterialTheme |
||||||
|
import androidx.compose.material3.Text |
||||||
|
import androidx.compose.runtime.LaunchedEffect |
||||||
|
import androidx.compose.runtime.getValue |
||||||
|
import androidx.compose.runtime.mutableStateOf |
||||||
|
import androidx.compose.runtime.remember |
||||||
|
import androidx.compose.runtime.setValue |
||||||
|
import androidx.compose.ui.window.Window |
||||||
|
import androidx.compose.ui.window.application |
||||||
|
import kotlinx.coroutines.delay |
||||||
|
|
||||||
|
fun main() = application { |
||||||
|
Window(onCloseRequest = ::exitApplication) { |
||||||
|
LaunchedEffect(Unit) { |
||||||
|
delay(1000) |
||||||
|
exitApplication() |
||||||
|
} |
||||||
|
|
||||||
|
var text by remember { mutableStateOf("Hello, World!") } |
||||||
|
|
||||||
|
MaterialTheme { |
||||||
|
Button(onClick = { |
||||||
|
text = "Hello, Desktop!" |
||||||
|
}) { |
||||||
|
Text(text) |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
Loading…
Reference in new issue