-
Notifications
You must be signed in to change notification settings - Fork 929
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
Added dart to firebase CLI #7569
Merged
+97
−10
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
32c3a2d
Added dart to firebase CLI
maneesht e34190a
Removed emulator changes
maneesht 07d2b8d
temp
maneesht f5021e0
WIP
maneesht 299c3df
Merge remote-tracking branch 'public/launch.fdc-pp' into mtewani/dart…
maneesht 184c38d
Included dart sdk
maneesht 7d9e016
Removed experiment
maneesht 7a1732e
Removed unnecessary comment
maneesht 4f91fe3
Formatting fixes
maneesht File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
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 |
---|---|---|
|
@@ -15,6 +15,7 @@ | |
import { | ||
ConnectorInfo, | ||
ConnectorYaml, | ||
DartSDK, | ||
JavascriptSDK, | ||
KotlinSDK, | ||
Platform, | ||
|
@@ -23,6 +24,7 @@ | |
import { FirebaseError } from "../../../error"; | ||
import { camelCase, snakeCase, upperFirst } from "lodash"; | ||
import { logSuccess, logBullet } from "../../../utils"; | ||
import * as experiments from "../../../experiments"; | ||
Check failure on line 27 in src/init/features/dataconnect/sdk.ts GitHub Actions / unit (18)
Check failure on line 27 in src/init/features/dataconnect/sdk.ts GitHub Actions / lint (20)
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unused? |
||
|
||
export type SDKInfo = { | ||
connectorYamlContents: string; | ||
|
@@ -87,14 +89,16 @@ | |
} else { | ||
// If we still can't autodetect, just ask the user | ||
logBullet("Couldn't automatically detect your app's platform."); | ||
const platforms = [ | ||
{ name: "iOS (Swift)", value: Platform.IOS }, | ||
{ name: "Web (JavaScript)", value: Platform.WEB }, | ||
{ name: "Android (Kotlin)", value: Platform.ANDROID }, | ||
{ name: "Flutter (Dart)", value: Platform.DART }, | ||
]; | ||
targetPlatform = await promptOnce({ | ||
message: "Which platform do you want to set up a generated SDK for?", | ||
type: "list", | ||
choices: [ | ||
{ name: "iOS (Swift)", value: Platform.IOS }, | ||
{ name: "Web (JavaScript)", value: Platform.WEB }, | ||
{ name: "Android (Kotlin)", value: Platform.ANDROID }, | ||
], | ||
choices: platforms, | ||
}); | ||
} | ||
} | ||
|
@@ -144,6 +148,21 @@ | |
newConnectorYaml.generate.javascriptSdk = javascriptSdk; | ||
} | ||
|
||
if (targetPlatform === Platform.DART) { | ||
const outputDir = | ||
newConnectorYaml.generate.dartSdk?.outputDir || | ||
path.relative( | ||
connectorInfo.directory, | ||
path.join(appDir, `generated/dart/${newConnectorYaml.connectorId}`), | ||
); | ||
const pkg = newConnectorYaml.generate.dartSdk?.package ?? newConnectorYaml.connectorId; | ||
const dartSdk: DartSDK = { | ||
outputDir, | ||
package: pkg, | ||
}; | ||
newConnectorYaml.generate.dartSdk = dartSdk; | ||
} | ||
|
||
if (targetPlatform === Platform.ANDROID) { | ||
// app/src/main/kotlin and app/src/main/java are conventional for Android, | ||
// but not required or enforced. If one of them is present (preferring the | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused, remove.