mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-10-30 15:48:36 +00:00
Since K2, Kotlin rebuilds a whole multiplatform module whenever an
incremental compile touches a file in a shared source set (commonMain,
jvmAndroid): the guard for KT-62686 ("Incremental compilation might be
incorrect"), still present in 2.5.0-Beta1. Nearly all of :commons and
:commonsUI is shared, and :commons doubled to ~200k lines in three
weeks, so every edit paid a full rebuild.
Measured on a one-line change in :commons commonMain, :amethyst:
assemblePlayDebug, M-series Mac:
- body or comment change: 38.6 s -> 9.5 s (:commons 31 s -> 2.7 s)
- new public declaration: 161 s -> 25.7 s (commons, commonsUI and the
app no longer all rebuild in full)
The guard covers common code resolving a platform declaration that
shadows a dependency's class of the same name, which can give a wrong
incremental result locally; a clean build fixes it. CI and release
builds start clean, so they are unaffected.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
51 lines
3.0 KiB
Properties
51 lines
3.0 KiB
Properties
# Project-wide Gradle settings.
|
|
# IDE (e.g. Android Studio) users:
|
|
# Gradle settings configured through the IDE *will override*
|
|
# any settings specified in this file.
|
|
# For more details on how to configure your build environment visit
|
|
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
|
# Specifies the JVM arguments used for the daemon process.
|
|
# The setting is particularly useful for tweaking memory settings.
|
|
org.gradle.jvmargs=-Xmx6g -Dfile.encoding=UTF-8
|
|
# When configured, Gradle will run in incubating parallel mode.
|
|
# This option should only be used with decoupled projects. More details, visit
|
|
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
|
org.gradle.parallel=true
|
|
org.gradle.caching=true
|
|
# AndroidX package structure to make it clearer which packages are bundled with the
|
|
# Android operating system, and which are packaged with your app's APK
|
|
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
|
android.useAndroidX=true
|
|
# Kotlin code style for this project: "official" or "obsolete":
|
|
kotlin.code.style=official
|
|
# Enables namespacing of each library's R class so that its R class includes only the
|
|
# resources declared in the library itself and none from the library's dependencies,
|
|
# thereby reducing the size of the R class for that library
|
|
android.nonTransitiveRClass=true
|
|
android.enableR8.fullMode=true
|
|
|
|
kotlin.daemon.jvmargs=-Xmx8g -XX:MaxMetaspaceSize=2g
|
|
|
|
# because we use a custom jvmAndroid target
|
|
kotlin.mpp.applyDefaultHierarchyTemplate=false
|
|
|
|
# This is needed for the Swift bridge to work.
|
|
kotlin.mpp.enableCInteropCommonization=true
|
|
# Incremental compilation for the KMP modules. Since K2, Kotlin rebuilds a whole KMP module
|
|
# whenever a recompiled file sits in a shared source set (commonMain, jvmAndroid): the guard
|
|
# for KT-62686, still in 2.5.0-Beta1. Nearly all of :commons and :commonsUI is shared, so every
|
|
# edit paid a full rebuild: a body change in :commons took ~39 s, a new public declaration
|
|
# ~161 s (commons, commonsUI and the app); with this, ~10 s and ~26 s. The risk the guard
|
|
# covers is narrow: common code resolving a platform declaration that shadows a dependency's
|
|
# class of the same name, which can give a wrong incremental result locally (a clean build
|
|
# fixes it). CI and release builds start clean, so they are unaffected.
|
|
kotlin.internal.incremental.enableUnsafeOptimizationsForMultiplatform=true
|
|
# Enabled parallel sync for Gradle 9.4+
|
|
org.gradle.tooling.parallel=true
|
|
# Apple test tasks (iosSimulatorArm64Test, macosArm64Test) can only run on a Mac; on Linux and
|
|
# Windows hosts KGP disables them and warned about it on every configuration. That is expected
|
|
# here (CI runs them on macos-latest), so the warning carries no signal. Note the flag silences
|
|
# every disabled-native-target notice, not only those: if a host ever loses the ability to
|
|
# compile an Apple target, that is quiet too. CI's macOS jobs are where Apple code is verified.
|
|
kotlin.native.ignoreDisabledTargets=true
|