Exemplo n.º 1
0
        private void InstallTestRPCCallback(object sender, EventArgs e)
        {
            OutputPane pane = package.TrufflePane;

            pane.Clear();
            pane.AddLine("Checking Node.JS and NPM installation...");

            TruffleENV.CheckNPMInstalled((isNPMInstalled) =>
            {
                if (isNPMInstalled == false)
                {
                    pane.AddLine("Cannot install TestRPC. It appears you don't have Node.JS or NPM installed on your system. Please visit http://nodejs.org for more information.");
                    return;
                }

                pane.AddLine("Installing TestRPC... (this may take a minute)");

                pane.RunInProject("npm install ethereumjs-testrpc", () =>
                {
                    pane.AddLine("Done! Checking installation...");

                    if (TruffleENV.CheckTestRPCInstalled(package.ProjectPath) == true)
                    {
                        ((TrufflePackage)this.package).RecheckEnvironment();
                        pane.AddLine("Completed successfully.");
                    }
                    else
                    {
                        pane.AddLine("Installation failed. Please see error messages above and try again.");
                    }
                });
            });
        }
Exemplo n.º 2
0
 private void StartTestRPCCallback(object sender, EventArgs e)
 {
     package.TestRPCPane.Clear();
     package.TestRPCPane.AddLine("Starting TestRPC...");
     package.TestRPCPane.RunCommand("\"" + TruffleENV.ExpectedTestRPCBinary(package.ProjectPath) + "\"", () =>
     {
         package.TestRPCPane.AddLine("Stopped.");
         package.RecheckEnvironment();
     });
 }
Exemplo n.º 3
0
        private void SolutionOpened()
        {
            string   solutionPath;
            Projects projects;

            try
            {
                DTE dte = (DTE)Microsoft.VisualStudio.Shell.Package.GetGlobalService(typeof(DTE));
                projects     = dte.Solution.Projects;
                solutionPath = Path.GetDirectoryName(dte.Solution.FullName);
            } catch
            {
                // Nothing we can do here if this errors. Don't go on.
                return;
            }

            this.InSolution   = true;
            this.SolutionPath = solutionPath;

            // Use the first Truffle project we find
            // TODO: Somehow support multiple projects
            foreach (Project project in projects)
            {
                string projectPath = Path.GetDirectoryName(project.FullName);

                // If no project path is specified, let's at least set the first one.
                if (this.ProjectPath == null)
                {
                    this.ProjectPath = projectPath;
                }

                if (TruffleENV.CheckTruffleInstalled(projectPath) == true)
                {
                    this.ProjectPath      = projectPath;
                    this.TruffleInstalled = true;
                    this.TrufflePath      = TruffleENV.ExpectedTruffleBinary(projectPath);
                    break;
                }
            }

            this.TestRPCInstalled          = TruffleENV.CheckTestRPCInstalled(this.ProjectPath);
            this.TruffleProjectInitialized = TruffleENV.CheckTruffleProjectInitialized(this.ProjectPath);

            this.OnOpen();
        }