Run post-build hooks.

@param array  $appConfig
@param string $buildDir

@return bool|null
False if the build hooks fail, true if they succeed, null if not
applicable.
774830
protected function runPostBuildHooks(array $appConfig, $buildDir)
    {
        if (!isset($appConfig['hooks']['build'])) {
            return null;
        }
        if (!empty($this->settings['no-build-hooks'])) {
            $this->output->writeln('Skipping post-build hooks');
            return null;
        }
        $this->output->writeln('Running post-build hooks');

        return $this->runHook($appConfig['hooks']['build'], $buildDir);
    }
1134083
function watchBuild(config) {
  // verify config
  if (!lintConfig(config)) throw new Error('invalid config')

  // set development env
  CONTEXT.env = 'development'

  // build once immediately
  buildOnce(config)

  // bind watch handler
  assist.tryWatch(
    config.$path.source.client,
    function (e, file) {
      if (!file) return
      CONTEXT.entries.push(path.join(config.$path.source.client, file))
      buildOnce(config, CONTEXT)
      CONTEXT.entries = []
    }
  )
}
944837
def post_exec_hook(hook):
    
    #post_setupnode hook
    module_name = '.'.join([env.project_package_name,'deploy'])
    funcs_run = []
    try:
        imported = import_module(module_name)
        func = vars(imported).get(hook)
        if func:
            func()
            funcs_run.append(func)
    except ImportError:
        return

   #run per app
    for app in env.INSTALLED_APPS:
        if app == 'woven': continue
        module_name = '.'.join([app,'deploy'])
        try:
            imported = import_module(module_name)
            func = vars(imported).get(hook)
            if func and func not in funcs_run:
                func()
                funcs_run.append(func)
        except ImportError:
            pass
    import woven.deploy
    func = vars(woven.deploy).get(hook)
    if func and func not in funcs_run: func()
237817
protected function createEnv($projectRoot, $docRoot, $address, array $appConfig)
    {
        $realDocRoot = realpath($docRoot);
        $envPrefix = $this->config()->get('service.env_prefix');
        $env = [
            '_PLATFORM_VARIABLES_PREFIX' => $envPrefix,
            $envPrefix . 'ENVIRONMENT' => '_local',
            $envPrefix . 'APPLICATION' => base64_encode(json_encode($appConfig)),
            $envPrefix . 'APPLICATION_NAME' => isset($appConfig['name']) ? $appConfig['name'] : '',
            $envPrefix . 'DOCUMENT_ROOT' => $realDocRoot,
            $envPrefix . 'ROUTES' => base64_encode(json_encode($this->getRoutesList($projectRoot, $address))),
        ];

        list($env['IP'], $env['PORT']) = explode(':', $address);

        if (dirname($realDocRoot, 2) === $projectRoot . '/' . $this->config()->get('local.build_dir')) {
            $env[$envPrefix . 'APP_DIR'] = dirname($realDocRoot);
        }

        if ($projectRoot === $this->getProjectRoot()) {
            try {
                $project = $this->getCurrentProject();
                if ($project) {
                    $env[$envPrefix . 'PROJECT'] = $project->id;
                }
            } catch (\Exception $e) {
                // Ignore errors
            }
        }

        return $env;
    }
954190
final public function get(array $appConfig): array
    {
        $this->appConfig = $appConfig;

        $defaults = $this->getSettings();

        $credentialsValidator = $defaults[static::KEY_USER_CREDENTIALS_VALIDATOR];
        assert(
            $this->checkPublicStaticCallable(
                $credentialsValidator,
                [ContainerInterface::class, 'string', 'string']
            ),
            "Invalid credentials validator."
        );

        $scopeValidator = $defaults[static::KEY_USER_SCOPE_VALIDATOR] ?? null;
        assert(
            $this->checkPublicStaticCallable(
                $scopeValidator,
                [
                    ContainerInterface::class,
                    'int',
                    function (ReflectionParameter $parameter) {
                        return $parameter->allowsNull() === true && $parameter->isArray() === true;
                    },
                ]
            ),
            "Invalid scope validator."
        );

        $customPropsProvider = $defaults[static::KEY_TOKEN_CUSTOM_PROPERTIES_PROVIDER] ?? null;
        assert(
            $customPropsProvider === null ||
            $this->checkPublicStaticCallable(
                $customPropsProvider,
                [ContainerInterface::class, TokenInterface::class],
                'array'
            ),
            "Invalid token custom properties provider."
        );

        $customUnAuthFactory = $defaults[static::KEY_FAILED_CUSTOM_UNAUTHENTICATED_FACTORY] ?? null;
        assert(
            $customUnAuthFactory === null ||
            $this->checkPublicStaticCallable(
                $customUnAuthFactory,
                [],
                ResponseInterface::class
            ),
            "Invalid custom factory."
        );

        $approvalUri = $defaults[static::KEY_APPROVAL_URI_STRING];
        assert(empty($approvalUri) === false, "Invalid Approval URI `$approvalUri`.");

        $errorUri = $defaults[static::KEY_ERROR_URI_STRING];
        assert(empty($errorUri) === false, "Invalid Error URI `$errorUri`.");

        $defaultClientId = $defaults[static::KEY_DEFAULT_CLIENT_ID];
        assert(empty($defaultClientId) === false, "Invalid Default Client ID `$defaultClientId`.");

        $userTable = $defaults[static::KEY_USER_TABLE_NAME];
        assert(empty($userTable) === false, "Invalid User Table Name `$userTable`.");

        $userPk = $defaults[static::KEY_USER_TABLE_NAME];
        assert(empty($userPk) === false, "Invalid User Primary Key Name `$userPk`.");

        return $defaults + [
                static::KEY_APPROVAL_URI_STRING              => $approvalUri,
                static::KEY_ERROR_URI_STRING                 => $errorUri,
                static::KEY_DEFAULT_CLIENT_ID                => $defaultClientId,
                static::KEY_USER_TABLE_NAME                  => $userTable,
                static::KEY_USER_PRIMARY_KEY_NAME            => $userPk,
                static::KEY_USER_CREDENTIALS_VALIDATOR       => $credentialsValidator,
                static::KEY_USER_SCOPE_VALIDATOR             => $scopeValidator,
                static::KEY_TOKEN_CUSTOM_PROPERTIES_PROVIDER => $customPropsProvider,
            ];
    }
230165
private function callDelCreaServer(string $appname, string $env = null)
    {
        if ($appname == '#none' && $env == null) {
            Server::delete(
                FEnvFcm::get("framework.root")."/public/components/apps/dev/",
                'directory'
            );
            Server::create(
                FEnvFcm::get("framework.root")."/public/components/apps/dev/",
                'directory'
            );
            Server::delete(
                FEnvFcm::get("framework.root")."/public/components/apps/prod/",
                'directory'
            );
            Server::create(
                FEnvFcm::get("framework.root")."/public/components/apps/prod/",
                'directory'
            );
        } elseif ($appname == '#none' && in_array($env, array("dev", "prod", "all"))) {
            if ($env == "all") {
                Server::delete(
                    FEnvFcm::get("framework.root")."/public/components/apps/dev/",
                    'directory'
                );
                Server::create(
                    FEnvFcm::get("framework.root")."/public/components/apps/dev/",
                    'directory'
                );
                Server::delete(
                    FEnvFcm::get("framework.root")."/public/components/apps/prod/",
                    'directory'
                );
                Server::create(
                    FEnvFcm::get("framework.root")."/public/components/apps/prod/",
                    'directory'
                );
            } else {
                Server::delete(FEnvFcm::get("framework.root")."/public/components/apps/".
                    strtolower($env)."/", 'directory');
                Server::create(FEnvFcm::get("framework.root")."/public/components/apps/".
                    strtolower($env)."/", 'directory');
            }
        } elseif ($appname !== '#none' && in_array($env, array("dev", "prod", "all"))) {
            if ($env == "all") {
                Server::delete(FEnvFcm::get("framework.root")."/public/components/apps/dev/".
                    strtolower($appname), 'directory');
                Server::delete(FEnvFcm::get("framework.root")."/public/components/apps/prod/".
                    strtolower($appname), 'directory');
            } else {
                Server::delete(FEnvFcm::get("framework.root")."/public/components/apps/".
                    strtolower($env)."/".
                    strtolower($appname), 'directory');
            }
        } elseif ($appname !== '#none' && $env == null) {
            Server::delete(
                FEnvFcm::get("framework.root") . "/public/components/apps/dev/" . strtolower($appname),
                'directory'
            );
            Server::delete(
                FEnvFcm::get("framework.root") . "/public/components/apps/prod/" . strtolower($appname),
                'directory'
            );
        } else {
            Output::displayAsRed("App name or env name does not exist. Referer to help command\n");
        }
    }
863700
public function setConfigDir($configDir)
    {
        if (!is_dir($configDir)) {
            throw new \InvalidArgumentException(
                sprintf('Invalid Application Configuration Directory: %s', $configDir)
            );
        }

        $this->configDir = $configDir;

        return($this);
    }
942805
public function setAppName($appName, $resourceDir)
    {
        if (!is_string($appName)) {
            throw new AppName($appName);
        }

        $this->appName = $appName;
        $this->resourceDir = $resourceDir;
    }
1187063
protected function postLoad(array $config, ContainerBuilder $container)
    {
        $this
            ->loadBlocks($config['blocks'], $container)
            ->loadStatics($config['statics'], $container)
            ->loadBuilders($config['builders'], $container)
            ->loadDumpers($config['builders'], $container)
            ->loadProfiles($config['profiles'], $container);
    }
1333814
public static void main(final String[] args) throws Exception {
        if (args.length != 2) {
            throw new RuntimeException("Invalid build configuration. No command-line arguments specified");
        }
        final var buildDir = args[0];
        final var projectDir = args[1];
        new ConfigurationMetadataGenerator(buildDir, projectDir).execute();
    }
1354912
public function warmUp($cacheDir)
    {
        if ($this->container->has('admingenerator.generator.propel')) {
            $this->propelInit();
        }

        foreach ($this->finder->findAll() as $yaml) {
            try {
                $this->buildFromYaml($yaml);
            } catch (\Exception $e) {
                while ($e->getPrevious()) {
                    $e = $e->getPrevious();
                }
                echo ">> Skip warmup ".
                    $e->getMessage().
                    ".\nIn file ".
                    $e->getFile().
                    " on line ".
                    $e->getLine().
                    ".\nBacktrace:\n".
                    $e->getTraceAsString();
            }
        }
    }
238843
protected function handleBareRepository(Builder $builder, $reference, $buildPath)
    {
        $gitConfig = parse_ini_file($reference.'/config', true);

        // If it is indeed a bare repository, then extract it into our build path:
        if ($gitConfig['core']['bare']) {
            $cmd = 'mkdir %2$s; git --git-dir="%1$s" archive %3$s | tar -x -C "%2$s"';
            $builder->executeCommand($cmd, $reference, $buildPath, $this->getBranch());
            return true;
        }

        return false;
    }
936807
function resolveAppBuild(appTsConfigPath) {
  const outDir = getAppBuildFolder(appTsConfigPath);
  const buildPath = path.join(path.dirname(appTsConfigPath), outDir);
  return buildPath;
}
1156058
public function run()
	{
		$this->say('Building ' . $this->getJConfig()->extension . " " . $this->getJConfig()->version);

		if (!$this->checkFolders())
		{
			return false;
		}

		// Create directory
		$this->prepareDistDirectory();

		// Build extension
		$this->buildExtension($this->params)->run();

		// Create symlink to current folder
		if ($this->isWindows())
		{
			$this->_exec('mklink /J ' . JPATH_BASE . '\dist\current ' . $this->getWindowsPath($this->getBuildFolder()));
		}
		else
		{
			$this->_symlink($this->getBuildFolder(), JPATH_BASE . "/dist/current");
		}

		// Support multiple deployment methods, separated by spaces
		$deploy = explode(" ", $this->getJConfig()->target);

		if (count($deploy))
		{
			foreach ($deploy as $d)
			{
				$task = 'deploy' . ucfirst($d);

				$this->{$task}()->run();
			}
		}

		return true;
	}
335836
protected function ensureSubDirs($directory, Config $config = null)
    {
        $config = $config ?: new Config();

        return $this->createDir(Util::dirname($directory), $config);
    }
70681
public function runBuildTools(PackageWrapper $package, $isDevMode)
    {
        foreach ($this->buildTools as $buildTool) {
            if ($buildTool->supports($package)) {
                $this->io->write(
                    sprintf(
                        '<info>Running %s builder for %s</info>',
                        $buildTool->getName(),
                        $package->getPackage()->getPrettyName()
                    )
                );
                $buildTool->build($package, $isDevMode);
            }
        }
    }
809919
public static function buildRoutes($routeConfig, $app = null)
    {
        $app = empty($app) ? Yii::$app : $app;
        $rules = static::collectRoutes($routeConfig, $app);
        $app->urlManager->addRules($rules, $routeConfig['append']);
    }