<commit_before>/*
 *  This is a simple routine that checks if project is an Android Studio Project
 *
 *  @param {String} root Root folder of the project
 */

/*jshint esnext: false */

var path = require('path');
var fs = require('fs');
var CordovaError = require('cordova-common').CordovaError;

module.exports.isAndroidStudioProject = function isAndroidStudioProject(root) {
    var eclipseFiles = ['AndroidManifest.xml', 'libs', 'res', 'project.properties', 'platform_www'];
    var androidStudioFiles = ['app', 'gradle', 'build', 'app/src/main/res'];

    // assume it is an AS project and not an Eclipse project
    var isEclipse = false;
    var isAS = true;

    if(!fs.existsSync(root)) {
        throw new CordovaError('AndroidStudio.js:inAndroidStudioProject root does not exist: ' + root);
    }

    // if any of the following exists, then we are not an ASProj
    eclipseFiles.forEach(function(file) {
        if(fs.existsSync(path.join(root, file))) {
            isEclipse = true;
        }
    });

    // if it is NOT an eclipse project, check that all required files exist
    if(!isEclipse) {
        androidStudioFiles.forEach(function(file){
            if(!fs.existsSync(path.join(root, file))) {
                isAS = false;
            }
        });
    }
    return (!isEclipse && isAS);
};
<commit_msg>Do not test for non-existent build folder<commit_after>/*
 *  This is a simple routine that checks if project is an Android Studio Project
 *
 *  @param {String} root Root folder of the project
 */

/*jshint esnext: false */

var path = require('path');
var fs = require('fs');
var CordovaError = require('cordova-common').CordovaError;

module.exports.isAndroidStudioProject = function isAndroidStudioProject(root) {
    var eclipseFiles = ['AndroidManifest.xml', 'libs', 'res', 'project.properties', 'platform_www'];
    var androidStudioFiles = ['app', 'gradle', 'app/src/main/res'];

    // assume it is an AS project and not an Eclipse project
    var isEclipse = false;
    var isAS = true;

    if(!fs.existsSync(root)) {
        throw new CordovaError('AndroidStudio.js:inAndroidStudioProject root does not exist: ' + root);
    }

    // if any of the following exists, then we are not an ASProj
    eclipseFiles.forEach(function(file) {
        if(fs.existsSync(path.join(root, file))) {
            isEclipse = true;
        }
    });

    // if it is NOT an eclipse project, check that all required files exist
    if(!isEclipse) {
        androidStudioFiles.forEach(function(file){
            if(!fs.existsSync(path.join(root, file))) {
                console.log('missing file :: ' + file);
                isAS = false;
            }
        });
    }
    return (!isEclipse && isAS);
};

{'fraction_non_alphanumeric': 0.1246800731261426, 'fraction_numerical': 0.0, 'mean_word_length': 2.8753541076487252, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3005520', 'n_tokens_mistral': 821, 'n_tokens_neox': 786, 'n_words': 240}