public function build()
    {
        $output = Application::getOutput();
        $input = Application::getInput();
        $this->package->setRendererInstance($this->generator->getRenderer());
        $this->package->setApplication(app(Application::class));
        $this->package->setOutputInstance($output);
        $this->package->setInputInstance($input);
        $this->package->builderLoaded();

        if ($this->getCommonTemplateDirectory() !== null) {
            $this->generator->getRenderer()->addPath($this->getCommonTemplateDirectory());
        }

        $this->generator->setVerbatimExcludePatterns($this->package->getVerbatimExcludePatterns());
        $this->generator->setVerbatimPatterns($this->package->getVerbatimPatterns());

        foreach ($this->package->getTransformPaths() as $pathKey => $processPath) {
            $this->generator->getPathManager()->getCollector()->addFileNames([$this->normalizePath($pathKey) => $this->normalizePath($processPath)]);
        }

        foreach ($this->package->getIgnoredPaths() as $ignoredPath) {
            $this->generator->getPathManager()->getGenerator()->addIgnoredPath($this->normalizePath($ignoredPath));
        }

        foreach ($this->package->getPathsToRemove() as $pathToRemove) {
            $this->generator->getPathManager()->getGenerator()->addAutomaticallyRemovedPath($this->normalizePath($pathToRemove));
        }

        $this->generator->addPaths((array)$this->getTemplateDirectory());
        $this->generator->generateContent($this->outputDirectory);
    }