Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project for checking compatibility with Maven and JPS on CI #5201

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions ci/templates/maven-test-project/.gitignore
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions ci/templates/maven-test-project/README.md
Original file line number Diff line number Diff line change
@@ -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.0.21 -Dcompose-version=1.7.3
```
189 changes: 189 additions & 0 deletions ci/templates/maven-test-project/pom.xml
Original file line number Diff line number Diff line change
@@ -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.0.21</kotlin.version>
<compose.version>1.8.0+dev2001</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>
30 changes: 30 additions & 0 deletions ci/templates/maven-test-project/src/main/kotlin/Main.kt
Original file line number Diff line number Diff line change
@@ -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)
}
}
}
}