Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const defaultDirectory = process.cwd();
const validDirectory = /^[\w -]+$/;

type Template = "empty" | "pedro";
type Library = "sloth" | "kotlin";
type Library = "sloth" | "kotlin" | "nextftc";

const inputs = await group(
{
Expand Down Expand Up @@ -64,6 +64,7 @@ const inputs = await group(
options: [
{ value: "kotlin", label: "Kotlin" },
{ value: "sloth", label: "Sloth" },
{ value: "nextftc", label: "NextFTC v2" },
],
required: false,
}),
Expand Down Expand Up @@ -111,6 +112,7 @@ steps.push(
inputs.template == "pedro",
inputs.libraries.includes("sloth"),
inputs.libraries.includes("kotlin"),
inputs.libraries.includes("nextftc"),
);
await writeFile(file, newGradle, "utf-8");
return "Wrote Gradle files";
Expand Down
7 changes: 7 additions & 0 deletions src/gradle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export function createGradle(
pedro: boolean,
sloth: boolean,
kotlin: boolean,
nextftc: boolean,
): string {
const version = getVersion(oldGradle);

Expand All @@ -47,6 +48,12 @@ export function createGradle(
sloth && block("dairy", ["implementation(Sloth)"]),
pedro &&
block("pedro", ["implementation(ftc)", "implementation(telemetry)"]),
nextftc &&
block("next.v2", [
"implementation(control)",
"implementation(hardware)",
"implementation(robot)",
]),
]);

return `${plugins}\n\n${ftc}`;
Expand Down