[Gradle] Change property name to 'kotlin.user.home'

To be analogous to GRADLE_USER_HOME as they serve almost the same
purpose.

^KT-58223 In Progress
This commit is contained in:
Yahor Berdnikau
2023-08-14 22:44:16 +02:00
committed by Space Team
parent ce695de84d
commit cf44bff164
3 changed files with 5 additions and 7 deletions
@@ -547,7 +547,7 @@ open class CommonizerIT : KGPBaseTest() {
@TempDir tempDir: Path, @TempDir tempDir: Path,
) { ) {
nativeProject("commonizeCurlInterop", gradleVersion) { nativeProject("commonizeCurlInterop", gradleVersion) {
gradleProperties.append("kotlin.persistent.gradle.data.dir=${tempDir.absolutePathString()}") gradleProperties.append("kotlin.user.home=${tempDir.absolutePathString()}")
configureCommonizerTargets() configureCommonizerTargets()
@@ -539,13 +539,11 @@ internal class PropertiesProvider private constructor(private val project: Proje
internal fun get(propertyName: String): String? = propertiesBuildService.get(propertyName, project) internal fun get(propertyName: String): String? = propertiesBuildService.get(propertyName, project)
/** /**
* The directory where persistent data for Kotlin Gradle Plugin is stored. * The directory where Kotlin global caches, logs, or project persistent data are stored.
* This data is not cleaned by gradle clean task. This dir can be used to store data
* for IDE import i.e. `./gradlew clean` will not break IDE import state.
* *
* If the property is not set, the plugin will use `<user_home>/.kotlin` as default. * If the property is not set, the plugin will use `<user_home>/.kotlin` as default.
*/ */
val kotlinPersistentGradleDataDir: String? = get(PropertyNames.KOTLIN_PERSISTENT_GRADLE_DATA_DIR) val kotlinUserHomeDir: String? = get(PropertyNames.KOTLIN_USER_HOME_DIR)
/** /**
* Retrieves a comma-separated list of browsers to use when running karma tests for [target] * Retrieves a comma-separated list of browsers to use when running karma tests for [target]
@@ -637,7 +635,7 @@ internal class PropertiesProvider private constructor(private val project: Proje
val KONAN_DATA_DIR = property("konan.data.dir") val KONAN_DATA_DIR = property("konan.data.dir")
val KOTLIN_SUPPRESS_BUILD_TOOLS_API_VERSION_CONSISTENCY_CHECKS = val KOTLIN_SUPPRESS_BUILD_TOOLS_API_VERSION_CONSISTENCY_CHECKS =
property("kotlin.internal.suppress.buildToolsApiVersionConsistencyChecks") property("kotlin.internal.suppress.buildToolsApiVersionConsistencyChecks")
val KOTLIN_PERSISTENT_GRADLE_DATA_DIR = property("kotlin.persistent.gradle.data.dir") val KOTLIN_USER_HOME_DIR = property("kotlin.user.home")
/** /**
* Internal properties: builds get big non-suppressible warning when such properties are used * Internal properties: builds get big non-suppressible warning when such properties are used
@@ -18,7 +18,7 @@ private const val SESSIONS_DIR_NAME = "sessions"
private const val METADATA_DIR_NAME = "metadata" private const val METADATA_DIR_NAME = "metadata"
internal val Project.basePersistentDir internal val Project.basePersistentDir
get() = kotlinPropertiesProvider.kotlinPersistentGradleDataDir?.let { File(it) } get() = kotlinPropertiesProvider.kotlinUserHomeDir?.let { File(it) }
?: File(System.getProperty("user.home")).resolve(".kotlin") ?: File(System.getProperty("user.home")).resolve(".kotlin")
internal val Project.kotlinSessionsDir internal val Project.kotlinSessionsDir