-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add normal compose desktop setup support and check project for it
Signed-off-by: Art Shendrik <[email protected]>
- Loading branch information
Showing
50 changed files
with
893 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<component name="ProjectRunConfigurationManager"> | ||
<configuration default="false" name="check-compose-desktop" type="GradleRunConfiguration" factoryName="Gradle" folderName="check"> | ||
<ExternalSystemSettings> | ||
<option name="env"> | ||
<map> | ||
<entry key="CI" value="true" /> | ||
<entry key="RELEASE" value="true" /> | ||
</map> | ||
</option> | ||
<option name="executionName" /> | ||
<option name="externalProjectPath" value="$PROJECT_DIR$/checks/compose-desktop" /> | ||
<option name="externalSystemIdString" value="GRADLE" /> | ||
<option name="scriptParameters" value="--stacktrace --continue" /> | ||
<option name="taskDescriptions"> | ||
<list /> | ||
</option> | ||
<option name="taskNames"> | ||
<list> | ||
<option value="build" /> | ||
<option value="assemble" /> | ||
<option value="check" /> | ||
<option value="packageReleaseDistributionForCurrentOS" /> | ||
</list> | ||
</option> | ||
<option name="vmOptions" /> | ||
</ExternalSystemSettings> | ||
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess> | ||
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess> | ||
<DebugAllEnabled>false</DebugAllEnabled> | ||
<RunAsTest>false</RunAsTest> | ||
<method v="2" /> | ||
</configuration> | ||
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<component name="ProjectRunConfigurationManager"> | ||
<configuration default="false" name="dependencyGuardBaseline (compose-desktop)" type="GradleRunConfiguration" factoryName="Gradle" folderName="preparations"> | ||
<ExternalSystemSettings> | ||
<option name="executionName" /> | ||
<option name="externalProjectPath" value="$PROJECT_DIR$/checks/compose-desktop" /> | ||
<option name="externalSystemIdString" value="GRADLE" /> | ||
<option name="scriptParameters" value="--stacktrace" /> | ||
<option name="taskDescriptions"> | ||
<list /> | ||
</option> | ||
<option name="taskNames"> | ||
<list> | ||
<option value="dependencyGuardBaseline" /> | ||
</list> | ||
</option> | ||
<option name="vmOptions" /> | ||
</ExternalSystemSettings> | ||
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess> | ||
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess> | ||
<DebugAllEnabled>false</DebugAllEnabled> | ||
<RunAsTest>false</RunAsTest> | ||
<method v="2" /> | ||
</configuration> | ||
</component> |
2 changes: 1 addition & 1 deletion
2
...endencyGuardBaseline (check-main).run.xml → .run/dependencyGuardBaseline (kmp).run.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import java.util.Calendar | ||
import org.jetbrains.compose.desktop.application.dsl.TargetFormat | ||
|
||
plugins { | ||
alias(libs.plugins.kotlin.jvm) | ||
alias(libs.plugins.jetbrains.compose) | ||
id("io.github.fluxo-kt.fluxo-kmp-conf") | ||
} | ||
|
||
// https://github.com/JetBrains/compose-multiplatform/blob/e1aff75/tutorials/Native_distributions_and_local_execution/README.md#specifying-package-version | ||
val appVersion = libs.versions.version.get() | ||
.substringBefore("-") | ||
.let { | ||
val (a, b) = it.split(".", limit = 3) | ||
if (a == "0") "1.0.$b" else it | ||
} | ||
|
||
version = appVersion | ||
group = "io.github.fluxo-kt" | ||
|
||
val mainClassName = "MainKt" | ||
tasks.named<Jar>("jar") { | ||
manifest.attributes["Main-Class"] = mainClassName | ||
} | ||
|
||
// See JB template and docs: | ||
// https://github.com/JetBrains/compose-multiplatform-desktop-template | ||
// https://github.com/JetBrains/compose-multiplatform/blob/e1aff75/tutorials/Native_distributions_and_local_execution/README.md | ||
|
||
fkcSetupKotlinApp { | ||
replaceOutgoingJar = true | ||
shrink { fullMode = true } | ||
shrinkWithProGuard() | ||
} | ||
|
||
dependencies { | ||
// `currentOs` should be used in launcher-sourceSet and in testMain only. | ||
// For a library, use compose.desktop.common. | ||
// With compose.desktop.common you will also lose @Preview functionality. | ||
implementation(compose.desktop.currentOs) | ||
|
||
testImplementation(compose.desktop.uiTestJUnit4) | ||
} | ||
|
||
compose.desktop.application { | ||
mainClass = mainClassName | ||
|
||
nativeDistributions { | ||
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb) | ||
packageVersion = appVersion | ||
packageName = "MyApp" | ||
description = "MyDescription" | ||
vendor = "MyCompany" | ||
|
||
val year = Calendar.getInstance().get(Calendar.YEAR) | ||
copyright = "© $year $packageName. All rights reserved." | ||
|
||
windows { | ||
shortcut = true | ||
menuGroup = packageName | ||
upgradeUuid = "3d4241d1-0400-401f-bd1f-000fdc8ae989" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
:plugin | ||
com.diffplug.durian:durian-collect:1.2.0 | ||
com.diffplug.durian:durian-core:1.2.0 | ||
com.diffplug.durian:durian-io:1.2.0 | ||
com.diffplug.durian:durian-swt.os:4.2.2 | ||
com.diffplug.spotless:spotless-lib-extra:2.45.0 | ||
com.diffplug.spotless:spotless-lib:2.45.0 | ||
com.diffplug.spotless:spotless-plugin-gradle:6.25.0 | ||
com.dropbox.dependency-guard:com.dropbox.dependency-guard.gradle.plugin:0.5.0 | ||
com.dropbox.dependency-guard:dependency-guard:0.5.0 | ||
com.github.ben-manes.versions:com.github.ben-manes.versions.gradle.plugin:0.51.0 | ||
com.github.ben-manes:gradle-versions-plugin:0.51.0 | ||
com.googlecode.concurrent-trees:concurrent-trees:2.6.1 | ||
com.googlecode.javaewah:JavaEWAH:1.2.3 | ||
com.squareup.moshi:moshi-kotlin:1.12.0 | ||
com.squareup.moshi:moshi:1.12.0 | ||
com.squareup.okhttp3:okhttp-bom:4.12.0 | ||
com.squareup.okhttp3:okhttp:4.12.0 | ||
com.squareup.okio:okio-jvm:3.6.0 | ||
com.squareup.okio:okio:3.6.0 | ||
commons-codec:commons-codec:1.16.0 | ||
dev.equo.ide:solstice:1.7.5 | ||
io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.23.6 | ||
org.antlr:antlr4-runtime:4.11.1 | ||
org.checkerframework:checker-qual:3.21.2 | ||
org.eclipse.jgit:org.eclipse.jgit:6.7.0.202309050840-r | ||
org.eclipse.platform:org.eclipse.osgi:3.18.300 | ||
org.jetbrains.compose:compose-gradle-plugin:1.6.2 | ||
org.jetbrains.compose:org.jetbrains.compose.gradle.plugin:1.6.2 | ||
org.jetbrains.intellij.deps:trove4j:1.0.20200330 | ||
org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.9.23 | ||
org.jetbrains.kotlin:kotlin-android-extensions:1.9.23 | ||
org.jetbrains.kotlin:kotlin-build-tools-api:1.9.23 | ||
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.9.23 | ||
org.jetbrains.kotlin:kotlin-compiler-runner:1.9.23 | ||
org.jetbrains.kotlin:kotlin-daemon-client:1.9.23 | ||
org.jetbrains.kotlin:kotlin-daemon-embeddable:1.9.23 | ||
org.jetbrains.kotlin:kotlin-gradle-plugin-annotations:1.9.23 | ||
org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.9.23 | ||
org.jetbrains.kotlin:kotlin-gradle-plugin-idea-proto:1.9.23 | ||
org.jetbrains.kotlin:kotlin-gradle-plugin-idea:1.9.23 | ||
org.jetbrains.kotlin:kotlin-gradle-plugin-model:1.9.23 | ||
org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.23 | ||
org.jetbrains.kotlin:kotlin-gradle-plugins-bom:1.9.23 | ||
org.jetbrains.kotlin:kotlin-klib-commonizer-api:1.9.23 | ||
org.jetbrains.kotlin:kotlin-native-utils:1.9.23 | ||
org.jetbrains.kotlin:kotlin-project-model:1.9.23 | ||
org.jetbrains.kotlin:kotlin-reflect:1.9.22 | ||
org.jetbrains.kotlin:kotlin-scripting-common:1.9.23 | ||
org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.9.23 | ||
org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.9.23 | ||
org.jetbrains.kotlin:kotlin-scripting-jvm:1.9.23 | ||
org.jetbrains.kotlin:kotlin-tooling-core:1.9.23 | ||
org.jetbrains.kotlin:kotlin-util-io:1.9.23 | ||
org.jetbrains.kotlin:kotlin-util-klib:1.9.23 | ||
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.5.0 | ||
org.ow2.asm:asm:9.7 | ||
org.slf4j:slf4j-api:1.7.36 | ||
org.tomlj:tomlj:1.1.1 | ||
org.tukaani:xz:1.9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../detekt.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../gradle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
org.gradle.jvmargs=-Xmx3G -Dfile.encoding=UTF-8 -XX:+UseParallelGC | ||
kotlin.daemon.jvmargs=-Xmx2G -XX:+UseParallelGC | ||
kotlin.daemon.useFallbackStrategy=false | ||
MAX_DEBUG=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../gradlew |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../gradlew.bat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../fluxo-kmp-conf/pg/assumenosideeffects.pro |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../fluxo-kmp-conf/pg/assumptions.pro |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Compose Desktop ProGuard/R8 rules | ||
# https://github.com/JetBrains/compose-multiplatform/blob/382ad5b/gradle-plugins/compose/src/main/resources/default-compose-desktop-rules.pro | ||
|
||
#-keep class kotlin.** { *; } | ||
-keep,allowoptimization class org.jetbrains.skia.** { *; } | ||
-keep,allowoptimization class org.jetbrains.skiko.** { *; } | ||
|
||
-assumenosideeffects public class androidx.compose.runtime.ComposerKt { | ||
void sourceInformation(androidx.compose.runtime.Composer,java.lang.String); | ||
void sourceInformationMarkerStart(androidx.compose.runtime.Composer,int,java.lang.String); | ||
void sourceInformationMarkerEnd(androidx.compose.runtime.Composer); | ||
boolean isTraceInProgress(); | ||
void traceEventStart(int, java.lang.String); | ||
void traceEventEnd(); | ||
} | ||
|
||
|
||
# Kotlinx Coroutines Rules | ||
# https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/jvm/resources/META-INF/proguard/coroutines.pro | ||
|
||
#-keepnames class kotlinx.coroutines.internal.MainDispatcherFactory {} | ||
#-keepnames class kotlinx.coroutines.CoroutineExceptionHandler {} | ||
#-keepclassmembers class kotlinx.coroutines.** { | ||
# volatile <fields>; | ||
#} | ||
#-keepclassmembers class kotlin.coroutines.SafeContinuation { | ||
# volatile <fields>; | ||
#} | ||
#-dontwarn java.lang.instrument.ClassFileTransformer | ||
#-dontwarn sun.misc.SignalHandler | ||
#-dontwarn java.lang.instrument.Instrumentation | ||
#-dontwarn sun.misc.Signal | ||
#-dontwarn java.lang.ClassValue | ||
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement | ||
|
||
|
||
# https://github.com/Kotlin/kotlinx.coroutines/issues/2046 | ||
-dontwarn android.annotation.SuppressLint | ||
|
||
# https://github.com/JetBrains/compose-jb/issues/2393 | ||
-dontnote kotlin.coroutines.jvm.internal.** | ||
-dontnote kotlin.internal.** | ||
-dontnote kotlin.jvm.internal.** | ||
-dontnote kotlin.reflect.** | ||
-dontnote kotlinx.coroutines.debug.internal.** | ||
-dontnote kotlinx.coroutines.internal.** | ||
-keep,allowoptimization,allowobfuscation class kotlin.coroutines.Continuation | ||
-keep,allowoptimization,allowobfuscation class kotlin.coroutines.CoroutineContext | ||
-keep,allowoptimization,allowobfuscation class kotlinx.coroutines.CancellableContinuation | ||
-keep,allowoptimization,allowobfuscation class kotlinx.coroutines.CoroutineDispatcher | ||
-keep,allowoptimization,allowobfuscation class kotlinx.coroutines.CoroutineScope | ||
-keep,allowoptimization,allowobfuscation class kotlinx.coroutines.channels.Channel | ||
|
||
# this is a weird one, but breaks build on some combinations of OS and JDK (reproduced on Windows 10 + Corretto 16) | ||
-dontwarn org.graalvm.compiler.core.aarch64.AArch64NodeMatchRules_MatchStatementSet* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
# See `fluxo.shrink.ShrinkerKeepRulesBySeedsTest` for tests on what's supported by R8 and ProGuard. | ||
|
||
# The weakest rule that will keep annotations and attributes is | ||
# https://r8.googlesource.com/r8/+/refs/heads/master/compatibility-faq.md#r8-full-mode | ||
# -keep[classmembers],allowshrinking,allowoptimization,allowobfuscation,allowaccessmodification class-specification | ||
|
||
-keepclasseswithmembernames,includedescriptorclasses class * { | ||
native <methods>; | ||
} | ||
|
||
-dontwarn androidx.annotation.** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
-include rules.pro | ||
|
||
# ProGuard-only configuration. | ||
# Dangerous, can increase size of the artifact! | ||
# https://www.guardsquare.com/manual/configuration/optimizations#aggressive-optimization | ||
-optimizeaggressively | ||
|
||
# ProGuard-only configuration. | ||
#-skipnonpubliclibraryclasses |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
### | ||
# ProGuard/R8 rules | ||
### | ||
|
||
-optimizationpasses 8 | ||
-repackageclasses | ||
|
||
-overloadaggressively | ||
-allowaccessmodification | ||
|
||
# Horizontal class merging increases size of the artifact. | ||
#-optimizations !class/merging/horizontal | ||
|
||
-adaptclassstrings | ||
-adaptresourcefilenames **.properties,**.gif,**.jpg,**.png,**.webp,**.svg,**.ttf,**.otf,**.txt,**.xml | ||
-adaptresourcefilecontents **.properties,**.MF | ||
|
||
# For problems reporting. | ||
-renamesourcefileattribute P | ||
-keepattributes SourceFile,LineNumberTable | ||
|
||
-include keep.pro | ||
-include compose-desktop-rules.pro | ||
|
||
# Note: -assumenosideeffects should not be used with constructors! | ||
# It leads to bugs like https://sourceforge.net/p/proguard/bugs/702/ | ||
# Using -assumenoexternalsideeffects is fine though and should be used for that purpose. | ||
-include assumptions.pro | ||
-include assumenosideeffects.pro |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
pluginManagement { | ||
repositories { | ||
// For Gradle plugins only. Last because proxies to mavenCentral. | ||
gradlePluginPortal() | ||
} | ||
includeBuild("../../") | ||
} | ||
|
||
plugins { | ||
id("com.gradle.enterprise") version "3.16.2" | ||
} | ||
|
||
dependencyResolutionManagement { | ||
repositories { | ||
google() | ||
mavenCentral() | ||
} | ||
} | ||
|
||
rootProject.name = "check-compose-desktop" |
Oops, something went wrong.