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

feat: native executables #105

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion .github/workflows/run-tests-on-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: '19'
java-version: '17'

- name: Cache Gradle dependencies
uses: actions/cache@v2
Expand Down
23 changes: 23 additions & 0 deletions .run/Run Desktop App.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,27 @@
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration default="false" name="Run Desktop App" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$/platforms/desktop" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="run" />
<option value="-dontwarn" />
</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 build-plugins/configurations/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repositories {
}

kotlin {
jvmToolchain(19)
jvmToolchain(17)
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ plugins {
}

kotlin {
jvmToolchain(19)
jvmToolchain(17)
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ kotlin {
jvm()
androidTarget()

jvmToolchain(19)
jvmToolchain(17)
}

android {
Expand All @@ -20,8 +20,8 @@ android {
}

compileOptions {
targetCompatibility = JavaVersion.VERSION_19
sourceCompatibility = JavaVersion.VERSION_19
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_17
}
}

2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ plugins {
allprojects {
tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "19"
jvmTarget = "17"
}
}
}
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ android.useAndroidX=true
# org.gradle.unsafe.configuration-cache=true
org.gradle.caching=true
kotlin.mpp.androidSourceSetLayoutVersion=2
org.jetbrains.compose.experimental.jscanvas.enabled=true
org.jetbrains.compose.experimental.jscanvas.enabled=true
kotlin.mpp.applyDefaultHierarchyTemplate=false
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ junit = "4.13.2"
androidx-test-ext-junit = "1.1.5"
espresso-core = "3.5.1"
material = "1.11.0"
app-version = "1.0.0"

[libraries]
kotlinx-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" }
Expand Down
6 changes: 3 additions & 3 deletions platforms/android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ android {
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_19
targetCompatibility = JavaVersion.VERSION_19
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

buildTypes {
Expand Down Expand Up @@ -47,7 +47,7 @@ android {
}

kotlin {
jvmToolchain(19)
jvmToolchain(17)
}

dependencies {
Expand Down
51 changes: 48 additions & 3 deletions platforms/desktop/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import org.jetbrains.compose.desktop.application.dsl.TargetFormat

plugins {
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.compose.multiplatform)
application
}

version = libs.versions.app.version.get()

dependencies {
implementation(compose.desktop.currentOs)
implementation(compose.runtime)
Expand Down Expand Up @@ -32,8 +35,8 @@ dependencies {
}

java {
sourceCompatibility = JavaVersion.VERSION_19
targetCompatibility = JavaVersion.VERSION_19
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

tasks.withType<Zip> {
Expand All @@ -46,4 +49,46 @@ tasks.withType<Jar> {

tasks.withType<Tar> {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}

compose.desktop {

application {
mainClass = "io.timemates.app.MainKt"

buildTypes.release {
proguard {
optimize = true
obfuscate = false

configurationFiles.setFrom(File("src/main/compose-desktop.pro"))
}
}

nativeDistributions {
packageName = "TimeMates"
description = "The ultimate tool for organizing time and tasks, collaborating with team members, and tracking progress."
modules("java.instrument", "java.management", "java.sql", "jdk.unsupported")

val iconsFolder = "src/main/resources/icons"

outputBaseDir.set(File("build/distributions"))

windows {
iconFile.set(File("$iconsFolder/app-icon.ico"))
}
macOS {
iconFile.set(File("$iconsFolder/app-icon.icns"))
dockName = "TimeMates"
}
linux {
iconFile.set(File("$iconsFolder/app-icon.png"))
}

licenseFile.set(rootProject.file("LICENSE.txt"))
vendor = "TimeMates"

targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
}
}
}
4 changes: 4 additions & 0 deletions platforms/desktop/src/main/compose-desktop.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-keep class io.ktor.** { *; }
-keep class io.timemates.sdk.*
-keep class io.timemates.api.*
-keep class kotlinx.serialization.*
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions preview/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ android {
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_19
targetCompatibility = JavaVersion.VERSION_19
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.jetpackComposeCompilerVersion.get()
Expand Down
Loading