Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
abeatrix committed Aug 16, 2024
1 parent bd28342 commit ae79f3b
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 99 deletions.
5 changes: 3 additions & 2 deletions src/Cody.VisualStudio/source.extension.vsixmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
<Metadata>
<Identity Id="Cody.VisualStudio" Version="0.0.0" Language="en-US" Publisher="Sourcegraph" />
<DisplayName>Cody for Visual Studio - AI Coding Assistant</DisplayName>
<Description xml:space="preserve">AI coding assistant that uses search and codebase context to help you write code faster. Cody brings autocomplete, chat, and commands to VS Code, so you can generate code, write unit tests, create docs, and explain complex code using AI. Choose from the latest LLMs, including GPT-4o and Claude 3.</Description>
<MoreInfo>https://sourcegraph.com/</MoreInfo>
<Description xml:space="preserve">AI coding assistant that uses search and codebase context to help you write code faster. Cody brings chat, and commands to Visual Studio, so you can generate code, write unit tests, create docs, and explain complex code using AI. Choose from the latest LLMs, including GPT-4o, Claude 3.5 Sonnet, Claude 3 Opus, Google Gemini 1.5 Pro and more!</Description>
<MoreInfo>https://sourcegraph.com/cody</MoreInfo>
<GettingStartedGuide>https://sourcegraph.com/docs</GettingStartedGuide>
<Icon>Resources\Marketplace.png</Icon>
<PreviewImage>Resources\Preview.png</PreviewImage>
<Tags>ai, openai, anthropic, assistant, chatbot, chat, refactor, documentation, test, sourcegraph, codey, llm, codegen, bot, model, typescript, javascript, python, golang, go, html, css, java, php, swift, kotlin, ollama, c#, c++, gemini</Tags>
Expand Down
194 changes: 97 additions & 97 deletions src/build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -33,158 +33,158 @@ var marketplaceToken = EnvironmentVariable("CODY_VS_MARKETPLACE_RELEASE_TOKEN");
//////////////////////////////////////////////////////////////////////

Task("BuildCodyAgent")
.Does(() =>
.Does(() =>
{
// Check for the env var to see if we should use the local cody directory.
// This is used to build the agent from the local cody directory instead of cloning from github.
var isDevMode = EnvironmentVariable("CODY_VS_DEV_PORT") == "3113";
if (isDevMode && DirectoryExists(codyDevDir))
{
Information($"--> Running in DevMode using:'{codyDir}'");
codyDir = codyDevDir;
}
// Check for the env var to see if we should use the local cody directory.
// This is used to build the agent from the local cody directory instead of cloning from github.
var isDevMode = EnvironmentVariable("CODY_VS_DEV_PORT") == "3113";
if (isDevMode && DirectoryExists(codyDevDir))
{
Information($"--> Running in DevMode using:'{codyDir}'");
codyDir = codyDevDir;
}
var codyAgentDir = MakeAbsolute(codyDir + Directory("agent"));
var codyAgentDistDir = codyAgentDir + Directory("dist");
var branchName = "main";
var codyAgentDir = MakeAbsolute(codyDir + Directory("agent"));
var codyAgentDistDir = codyAgentDir + Directory("dist");
var branchName = "main";
if (!DirectoryExists(codyDir) || !GitIsValidRepository(codyDir))
{
Information($"--> Cloning repository:'{codyRepo}'");
GitClone(codyRepo, codyDir, new GitCloneSettings { BranchName = branchName });
}
if (!DirectoryExists(codyDir) || !GitIsValidRepository(codyDir))
{
Information($"--> Cloning repository:'{codyRepo}'");
GitClone(codyRepo, codyDir, new GitCloneSettings { BranchName = branchName });
}
if (!isDevMode)
{
Information($"--> Checkout '{branchName}' ...");
GitCheckout(codyDir, branchName);
if (!isDevMode)
{
Information($"--> Checkout '{branchName}' ...");
GitCheckout(codyDir, branchName);
//GitCheckout(codyDir, codyCommit);
//GitCheckout(codyDir, codyCommit);
Information($"--> git pull ...");
GitPull(codyDir, "cake", "cake@cake.com");
}
Information($"--> git pull ...");
GitPull(codyDir, "cake", "cake@cake.com");
}
Information($"--> Cleaning '{codyAgentDistDir}' ...");
CleanDirectory(codyAgentDistDir);
Information($"--> Cleaning '{codyAgentDistDir}' ...");
CleanDirectory(codyAgentDistDir);
Context.Environment.WorkingDirectory = codyAgentDir;
Context.Environment.WorkingDirectory = codyAgentDir;
Information($"--> pnpm install ...");
PnpmInstall();
Information($"--> pnpm install ...");
PnpmInstall();
Information($"--> pnpm build ...");
PnpmRun("build");
Information($"--> pnpm build ...");
PnpmRun("build");
//PnpmRun("build:agent");
//PnpmRun("build:webviews");
//PnpmRun("build:agent");
//PnpmRun("build:webviews");
Context.Environment.WorkingDirectory = solutionDir;
Context.Environment.WorkingDirectory = solutionDir;
var deleteSettings = new DeleteDirectorySettings
{
Recursive = true,
Force = true
};
Information($"--> Cleaning '{agentDir}' ...");
CleanDirectory(agentDir);
var deleteSettings = new DeleteDirectorySettings
{
Recursive = true,
Force = true
};
Information($"--> Cleaning '{agentDir}' ...");
CleanDirectory(agentDir);
Information($"--> Copying the agent to '{agentDir}'");
CreateDirectory(agentDir);
CopyDirectory(codyAgentDistDir, agentDir);
Information($"--> Copying the agent to '{agentDir}'");
CreateDirectory(agentDir);
CopyDirectory(codyAgentDistDir, agentDir);
var codyWebviewsFolder = MakeAbsolute(codyDir + Directory("agent/dist/webviews"));
Information($"--> Copying the webviews from '{codyWebviewsFolder}' to '{agentDir}' ...");
CopyDirectory(codyWebviewsFolder, $"{agentDir}/webviews");
var codyWebviewsFolder = MakeAbsolute(codyDir + Directory("agent/dist/webviews"));
Information($"--> Copying the webviews from '{codyWebviewsFolder}' to '{agentDir}' ...");
CopyDirectory(codyWebviewsFolder, $"{agentDir}/webviews");
// removing pnpm build:root artefacts (/src and /scripts folders)
// removing pnpm build:root artefacts (/src and /scripts folders)
var srcFolder = @$"{agentDir}/src";
var scriptsFolder = @$"{agentDir}/scripts";
if (DirectoryExists(srcFolder))
DeleteDirectory(srcFolder, deleteSettings);
var srcFolder = @$"{agentDir}/src";
var scriptsFolder = @$"{agentDir}/scripts";
if (DirectoryExists(srcFolder))
DeleteDirectory(srcFolder, deleteSettings);
if (DirectoryExists(scriptsFolder))
DeleteDirectory(scriptsFolder, deleteSettings);
if (DirectoryExists(scriptsFolder))
DeleteDirectory(scriptsFolder, deleteSettings);
});

Task("DownloadNode")
.Does(() =>
.Does(() =>
{
if (!FileExists(nodeExeFile))
{
CreateDirectory(nodeBinariesDir);
DownloadFile(nodeBinaryUrl, nodeExeFile);
}
if (!FileExists(nodeArmExeFile))
{
CreateDirectory(nodeBinariesDir);
DownloadFile(nodeArmBinaryUrl, nodeArmExeFile);
}
CopyFileToDirectory(nodeExeFile, agentDir);
CopyFileToDirectory(nodeArmExeFile, agentDir);
if (!FileExists(nodeExeFile))
{
CreateDirectory(nodeBinariesDir);
DownloadFile(nodeBinaryUrl, nodeExeFile);
}
if (!FileExists(nodeArmExeFile))
{
CreateDirectory(nodeBinariesDir);
DownloadFile(nodeArmBinaryUrl, nodeArmExeFile);
}
CopyFileToDirectory(nodeExeFile, agentDir);
CopyFileToDirectory(nodeArmExeFile, agentDir);
});

Task("Build")
.IsDependentOn("BuildCodyAgent")
.IsDependentOn("DownloadNode")
.IsDependentOn("Restore")
.Does(() =>
.IsDependentOn("BuildCodyAgent")
.IsDependentOn("DownloadNode")
.IsDependentOn("Restore")
.Does(() =>
{
MSBuild("./Cody.sln", new MSBuildSettings
{
Configuration = configuration,
PlatformTarget = PlatformTarget.MSIL
});
MSBuild("./Cody.sln", new MSBuildSettings
{
Configuration = configuration,
PlatformTarget = PlatformTarget.MSIL
});
});

Task("Restore")
.Does(() =>
{
Information($"Restore ...");
Information($"Restore ...");
MSBuild("./Cody.sln", new MSBuildSettings {
Targets = { "Restore" },
Verbosity = Verbosity.Minimal
});
});

Task("Publish")
//.IsDependentOn("Build")
.Does(() =>
//.IsDependentOn("Build")
.Does(() =>
{
var args = new ProcessSettings().WithArguments(x => x
.Append("publish")
.AppendSwitchQuoted("-payload", buildExtensionFile)
.AppendSwitchQuoted("-publishManifest", publishManifestFile)
.AppendSwitchQuoted("-personalAccessToken", marketplaceToken)
);
var args = new ProcessSettings().WithArguments(x => x
.Append("publish")
.AppendSwitchQuoted("-payload", buildExtensionFile)
.AppendSwitchQuoted("-publishManifest", publishManifestFile)
.AppendSwitchQuoted("-personalAccessToken", marketplaceToken)
);
var returnCode = StartProcess(vsixPublisherFile, args);
if (returnCode != 0) throw new Exception("Publishing error");
var returnCode = StartProcess(vsixPublisherFile, args);
if (returnCode != 0) throw new Exception("Publishing error");
//StartProcess(vsixPublisherFile, $"publish -payload \"{buildExtensionFile}\" -publishManifest \"{publishManifestFile}\" -personalAccessToken \"{marketplaceToken}\"");
//StartProcess(vsixPublisherFile, $"publish -payload \"{buildExtensionFile}\" -publishManifest \"{publishManifestFile}\" -personalAccessToken \"{marketplaceToken}\"");
});

Task("Clean")
//.WithCriteria(c => HasArgument("rebuild"))
.Does(() =>
//.WithCriteria(c => HasArgument("rebuild"))
.Does(() =>
{
//todo
//todo
});

Task("Test")
.IsDependentOn("Build")
.Does(() =>
.IsDependentOn("Build")
.Does(() =>
{
//todo
//todo
});

//////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit ae79f3b

Please sign in to comment.