示例#1
0
        /// <summary>
        /// Invoke
        /// </summary>
        public async Task InvokeAsync(BuildOptions options)
        {
            var recipePath = Directory.GetCurrentDirectory();
            var recipe     = await RecipeManager.LoadFromFileAsync(recipePath);

            if (recipe == null)
            {
                Log.Error("Could not find the recipe file.");
                return;
            }

            // Ensure the library directory exists
            var libraryPath = PackageManager.BuildKitchenLibraryPath(_config);

            if (!Directory.Exists(libraryPath))
            {
                Directory.CreateDirectory(libraryPath);
            }

            // Now build the current project
            Log.Info(string.Empty);
            Log.Info("Building Project");
            var buildPath   = Path.Combine(Constants.ProjectGenerateFolderName, Constants.StoreBuildFolderName);
            var buildEngine = new BuildEngine(_config, _compiler);
            await buildEngine.ExecuteAsync(recipePath, recipe, options.Force);
        }