Beispiel #1
0
// get temporary directory and set paths
$tmpPath = Emergence_FS::getTmpDir();
$workspaceConfigTmpPath = "{$tmpPath}/.sencha";
$frameworkTmpPath = "{$tmpPath}/{$framework}-{$frameworkVersion}";
$packagesTmpPath = "{$tmpPath}/packages";
$appTmpPath = "{$tmpPath}/{$appName}";
$archiveTmpPath = "{$appTmpPath}/archive";
$buildTmpPath = "{$tmpPath}/build/{$appName}/{$buildType}";
Benchmark::mark("created tmp: {$tmpPath}");
// precache and write workspace config
$cachedFiles = Emergence_FS::cacheTree($workspaceConfigPath);
Benchmark::mark("precached {$cachedFiles} files in {$workspaceConfigPath}");
$exportResult = Emergence_FS::exportTree($workspaceConfigPath, $workspaceConfigTmpPath);
Benchmark::mark("exported {$workspaceConfigPath} to {$workspaceConfigTmpPath}: " . http_build_query($exportResult));
// ... packages
if (!($requiredPackages = $App->getRequiredPackages()) || !is_array($requiredPackages)) {
    $requiredPackages = array();
}
Benchmark::mark("aggregating classpaths from packages");
$classPaths = array_merge($classPaths, Sencha::aggregateClassPathsForPackages($requiredPackages));
foreach ($requiredPackages as $packageName) {
    $cachedFiles = Emergence_FS::cacheTree("{$packagesPath}/{$packageName}");
    Benchmark::mark("precached {$cachedFiles} files in {$packagesPath}/{$packageName}");
    $exportResult = Emergence_FS::exportTree("{$packagesPath}/{$packageName}", "{$packagesTmpPath}/{$packageName}");
    Benchmark::mark("exported {$packagesPath}/{$packageName} to {$packagesTmpPath}/{$packageName}: " . http_build_query($exportResult));
    // append package-level classpaths
    $packageBuildConfigPath = "{$packagesTmpPath}/{$packageName}/.sencha/package/sencha.cfg";
    if (file_exists($packageBuildConfigPath)) {
        $packageBuildConfig = Sencha::loadProperties($packageBuildConfigPath);
        $classPaths = array_merge($classPaths, explode(',', $packageBuildConfig['package.classpath']));
    }