Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions lib/gradle.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use babel';
'use strict';

import { existsSync, stat, watch } from 'fs';
import { existsSync, stat, watch, readdirSync } from 'fs';
import os from 'os';
import path from 'path';
import Promise from 'bluebird';
Expand Down Expand Up @@ -61,8 +61,15 @@ export function provideBuilder() {
}

isEligible() {
this.file = path.join(this.cwd, 'build.gradle');
return existsSync(this.file);
let buildFiles = ['build.gradle', 'build.gradle.kts'];
let cwdFiles = readdirSync(this.cwd);
for (let buildFile of buildFiles) {
if (cwdFiles.includes(buildFile)) {
this.file = path.join(this.cwd, buildFile);
return existsSync(this.file);
}
}
return false;
}

settings() {
Expand Down