gradle如何预测目录是否包含文件

时间:2016-01-13 10:18:50

标签: android gradle

在gradle中,在android项目中,如果libs不包含 android-support-v13.jar ,我将复制 android-support-v4.jar 到目的地目录。但我不知道该怎么做。以下是代码:

$valid_formats = array("jpg", "png", "gif", "zip", "bmp");
$max_file_size = 1024*1000; 
$path = "upload/"; 
$count = 0;
if(isset($_POST) and $_SERVER['REQUEST_METHOD'] == "POST"){

    foreach ($_FILES['files']['name'] as $f => $name) {  
        if ($_FILES['files']['error'][$f] == 4) {
            continue; // Skip file if any error found}
            if ($_FILES['files']['error'][$f] == 0) {         
                if ($_FILES['files']['size'][$f] > $max_file_size) {
                    $message[] = "$name is too large!.";
                    continue; // Skip large files
                }
                elseif( ! in_array(pathinfo($name, PATHINFO_EXTENSION), $valid_formats) ) {
        $message[] = "$name is not a valid format";
        ...

libs 目录有一个android-support-v13.jar,但输出是else子句。我不知道为什么。

由于

修改

我犯了一个错误,文件(' android-support-v13.jar')应该是文件(' libs / android-support-v14的.jar&#39)

对不起噪音

0 个答案:

没有答案