-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add the ability to explictly specify the path to the npm executable
- Loading branch information
Showing
7 changed files
with
179 additions
and
2 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
37 changes: 37 additions & 0 deletions
37
...dSrc/src/main/java/com/google/firebase/example/dataconnect/gradle/TransformerInterop.java
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,37 @@ | ||
/* | ||
* Copyright 2024 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.google.firebase.example.dataconnect.gradle; | ||
|
||
import org.gradle.api.Transformer; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
// TODO: Remove this interface and use Transformer directly once the Kotlin | ||
// version is upgraded to a later version that doesn't require it, such as | ||
// 1.9.25. At the time of writing, the Kotlin version in use is 1.9.22. | ||
// | ||
// Using this interface works around the following Kotlin compiler error: | ||
// | ||
// > Task :plugin:compileKotlin FAILED | ||
// e: DataConnectGradlePlugin.kt:93:15 Type mismatch: inferred type is RegularFile? but TypeVariable(S) was expected | ||
// e: DataConnectGradlePlugin.kt:102:15 Type mismatch: inferred type is String? but TypeVariable(S) was expected | ||
// e: DataConnectGradlePlugin.kt:111:15 Type mismatch: inferred type is DataConnectExecutable.VerificationInfo? but TypeVariable(S) was expected | ||
public interface TransformerInterop<OUT, IN> extends Transformer<OUT, IN> { | ||
|
||
@Override | ||
@Nullable OUT transform(@NotNull IN in); | ||
|
||
} |
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
30 changes: 30 additions & 0 deletions
30
...ct/buildSrc/src/main/kotlin/com/google/firebase/example/dataconnect/gradle/LocalConfig.kt
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,30 @@ | ||
/* | ||
* Copyright 2024 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.google.firebase.example.dataconnect.gradle | ||
|
||
import java.io.File | ||
import kotlinx.serialization.Serializable | ||
import kotlinx.serialization.Transient | ||
|
||
@Serializable | ||
internal data class LocalConfig(val npmExecutable: String? = null, @Transient val srcFile: File? = null) : | ||
java.io.Serializable { | ||
companion object { | ||
@Suppress("ConstPropertyName") | ||
private const val serialVersionUID = 6103369922496556758L | ||
} | ||
} |
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,10 @@ | ||
[dataconnect] | ||
|
||
# The path of the "npm" executable to use to install firebase-tools. | ||
# Setting this is normally not necessary; however, if "npm" is not in the global | ||
# PATH, or the wrong version is in the global PATH, then setting this to the absolute | ||
# path of the npm executable to use works around that problem. Setting it to null | ||
# uses "npm" as found in the PATH. | ||
# | ||
# eg. npmExecutable = "/home/myusername/local/nvm/versions/node/v20.13.1/bin/npm" | ||
npmExecutable = null |