From b598af6d1e651d3c05cce4f972ce269a555e23b6 Mon Sep 17 00:00:00 2001 From: Denver Coneybeare Date: Tue, 19 Nov 2024 22:11:48 +0000 Subject: [PATCH] First start at supporting a nodeExecutable setting in dataconnect.local.toml --- .../example/dataconnect/gradle/LocalConfig.kt | 6 +++++- dataconnect/dataconnect.local.toml | 15 +++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/dataconnect/buildSrc/src/main/kotlin/com/google/firebase/example/dataconnect/gradle/LocalConfig.kt b/dataconnect/buildSrc/src/main/kotlin/com/google/firebase/example/dataconnect/gradle/LocalConfig.kt index 7a557f2a3..6f330a4c2 100644 --- a/dataconnect/buildSrc/src/main/kotlin/com/google/firebase/example/dataconnect/gradle/LocalConfig.kt +++ b/dataconnect/buildSrc/src/main/kotlin/com/google/firebase/example/dataconnect/gradle/LocalConfig.kt @@ -21,7 +21,11 @@ import kotlinx.serialization.Serializable import kotlinx.serialization.Transient @Serializable -internal data class LocalConfig(val npmExecutable: String? = null, @Transient val srcFile: File? = null) : +internal data class LocalConfig( + val npmExecutable: String? = null, + val nodeExecutable: String? = null, + @Transient val srcFile: File? = null +) : java.io.Serializable { companion object { @Suppress("ConstPropertyName") diff --git a/dataconnect/dataconnect.local.toml b/dataconnect/dataconnect.local.toml index 0da54c13a..01b53835e 100644 --- a/dataconnect/dataconnect.local.toml +++ b/dataconnect/dataconnect.local.toml @@ -6,5 +6,20 @@ # path of the npm executable to use works around that problem. Setting it to null # uses "npm" as found in the PATH. # +# NOTE: If this value is set then you almost certainly want to set nodeExecutable +# as well. +# # eg. npmExecutable = "/home/myusername/local/nvm/versions/node/v20.13.1/bin/npm" npmExecutable = null + +# The path of the "node" executable to use to run the "firebase" command. +# Setting this is normally not necessary; however, if "node" is not in the global +# PATH, or the wrong version is in the global PATH, then setting this to the absolute +# path of the node executable to use works around that problem. Setting it to null +# uses "node" as found in the PATH. +# +# NOTE: If this value is set then you almost certainly want to set npmExecutable +# as well. +# +# eg. nodeExecutable = "/home/myusername/local/nvm/versions/node/v20.13.1/bin/node" +nodeExecutable = null