public void Bind(KProject templateProject)
        {
            loadProjectIsCombo();

            _templateProject                = templateProject;
            _checkBoxKickstart.Checked      = _templateProject.Kickstart;
            _textBoxProjectName.Text        = _templateProject.ProjectFullName;
            _textBoxProjectFolder.Text      = _templateProject.ProjectFolder;
            _comboBoxProjectIs.SelectedItem = _templateProject.ProjectIs;
        }
示例#2
0
 private static string GetPackagePath(KProject project, string outputPath)
 {
     return Path.Combine(outputPath, project.Name + "." + project.Version + ".nupkg");
 }
示例#3
0
        private static AssemblyLoadResult Clean(KProject project, string outputPath, FrameworkName targetFramework)
        {
            var loader = CreateLoader(Path.GetDirectoryName(project.ProjectFilePath));
            loader.Walk(project.Name, project.Version, targetFramework);

            var targetFrameworkFolder = VersionUtility.GetShortFrameworkName(targetFramework);
            string targetPath = Path.Combine(outputPath, targetFrameworkFolder);

            var loadContext = new LoadContext(project.Name, targetFramework)
            {
                OutputPath = targetPath,
                ArtifactPaths = new List<string>(),
                CreateArtifacts = false
            };

            var result = loader.Load(loadContext);

            if (result == null || result.Errors != null)
            {
                return result;
            }

            // REVIEW: This might not work so well when building for multiple frameworks
            RunStaticMethod("Compiler", "Clean", targetPath, loadContext.ArtifactPaths);

            if (loadContext.ArtifactPaths.Count > 0)
            {
                Trace.TraceInformation("Cleaning generated artifacts for {0}", targetFramework);

                foreach (var path in loadContext.ArtifactPaths)
                {
                    if (File.Exists(path))
                    {
                        Trace.TraceInformation("Cleaning {0}", path);

                        File.Delete(path);
                    }
                }
            }

            return result;
        }
示例#4
0
        private static AssemblyLoadResult Build(KProject project, string outputPath, FrameworkName targetFramework, PackageBuilder builder)
        {
            var loader = CreateLoader(Path.GetDirectoryName(project.ProjectFilePath));

            loader.Walk(project.Name, project.Version, targetFramework);

            var targetFrameworkFolder = VersionUtility.GetShortFrameworkName(targetFramework);
            string targetPath = Path.Combine(outputPath, targetFrameworkFolder);

            var loadContext = new LoadContext(project.Name, targetFramework)
            {
                OutputPath = targetPath,
                PackageBuilder = builder,
            };

            var result = loader.Load(loadContext);

            if (result == null || result.Errors != null)
            {
                return result;
            }

            // REVIEW: This might not work so well when building for multiple frameworks
            RunStaticMethod("Compiler", "Compile", targetPath);

            return result;
        }