Skip to content

Commit 59e3b90

Browse files
authored
Merge pull request #437 from jcesarmobile/CB-14038
CB-14038 (android): fix false positive detecting project type I agree @jcesarmobile, it can wait for a future release.
2 parents 76180d3 + fe7629e commit 59e3b90

File tree

8 files changed

+35
-244
lines changed

8 files changed

+35
-244
lines changed

bin/templates/cordova/lib/AndroidStudio.js

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,6 @@
66

77
/* jshint esnext: false */
88

9-
var path = require('path');
10-
var fs = require('fs');
11-
var CordovaError = require('cordova-common').CordovaError;
12-
139
module.exports.isAndroidStudioProject = function isAndroidStudioProject (root) {
14-
var eclipseFiles = ['AndroidManifest.xml', 'libs', 'res'];
15-
var androidStudioFiles = ['app', 'app/src/main'];
16-
17-
// assume it is an AS project and not an Eclipse project
18-
var isEclipse = false;
19-
var isAS = true;
20-
21-
if (!fs.existsSync(root)) {
22-
throw new CordovaError('AndroidStudio.js:inAndroidStudioProject root does not exist: ' + root);
23-
}
24-
25-
// if any of the following exists, then we are not an ASProj
26-
eclipseFiles.forEach(function (file) {
27-
if (fs.existsSync(path.join(root, file))) {
28-
isEclipse = true;
29-
}
30-
});
31-
32-
// if it is NOT an eclipse project, check that all required files exist
33-
if (!isEclipse) {
34-
androidStudioFiles.forEach(function (file) {
35-
if (!fs.existsSync(path.join(root, file))) {
36-
console.log('missing file :: ' + file);
37-
isAS = false;
38-
}
39-
});
40-
}
41-
return (!isEclipse && isAS);
10+
return true;
4211
};

spec/fixtures/android_project/AndroidManifest.xml

Lines changed: 0 additions & 69 deletions
This file was deleted.

spec/fixtures/android_project/assets/www/.gitkeep

Whitespace-only changes.

spec/fixtures/android_project/res/xml/config.xml

Lines changed: 0 additions & 54 deletions
This file was deleted.

spec/fixtures/android_project/src/.gitkeep

Whitespace-only changes.

spec/unit/AndroidProject.spec.js

Lines changed: 0 additions & 31 deletions
This file was deleted.

spec/unit/AndroidStudio.spec.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,4 @@ describe('AndroidStudio module', function () {
88
var isAndStud = AndroidStudio.isAndroidStudioProject(root);
99
expect(isAndStud).toBe(true);
1010
});
11-
it('should return false non Android Studio project', function () {
12-
var root = path.join(__dirname, '../fixtures/android_project/');
13-
var isAndStud = AndroidStudio.isAndroidStudioProject(root);
14-
expect(isAndStud).toBe(false);
15-
});
1611
});

0 commit comments

Comments
 (0)