diff --git a/scripts/celerity_mapper.php b/scripts/celerity_mapper.php index d281da41ce..7fa40e2d87 100755 --- a/scripts/celerity_mapper.php +++ b/scripts/celerity_mapper.php @@ -111,12 +111,24 @@ foreach ($file_map as $path => $info) { $package_map = array(); foreach ($package_spec as $name => $package) { $hashes = array(); + $type = null; foreach ($package as $symbol) { if (empty($hash_map[$symbol])) { throw new Exception( "Package specification for '{$name}' includes '{$symbol}', but that ". "symbol is not defined anywhere."); } + if ($type === null) { + $type = $runtime_map[$symbol]['type']; + } else { + $ntype = $runtime_map[$symbol]['type']; + if ($type !== $ntype) { + throw new Exception( + "Package specification for '{$name}' mixes resources of type ". + "'{$type}' with resources of type '{$ntype}'. Each package may only ". + "contain one type of resource."); + } + } $hashes[] = $symbol.':'.$hash_map[$symbol]; } $key = substr(md5(implode("\n", $hashes)), 0, 8); @@ -124,7 +136,7 @@ foreach ($package_spec as $name => $package) { 'name' => $name, 'symbols' => $package, 'uri' => '/res/pkg/'.$key.'/'.$name, - 'type' => 'css', // TODO LOL + 'type' => $type, ); foreach ($package as $symbol) { $package_map['reverse'][$symbol] = $key;