Skip to content

Commit

Permalink
CB-13289: Fixing build problems with Studio Three, but keeping Window…
Browse files Browse the repository at this point in the history
…s Gradle fix for now, will be deprecated
  • Loading branch information
infil00p committed Oct 30, 2017
1 parent d73108c commit 9fdb126
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 17 deletions.
6 changes: 2 additions & 4 deletions bin/templates/cordova/lib/builders/GradleBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,7 @@ GradleBuilder.prototype.prepBuildFiles = function () {
subProjects.forEach(function (p) {
console.log('Subproject Path: ' + p);
var libName = p.replace(/[/\\]/g, ':').replace(name + '-', '');
depsList += ' debugCompile(project(path: "' + libName + '", configuration: "debug"))';
insertExclude(p);
depsList += ' releaseCompile(project(path: "' + libName + '", configuration: "release"))';
depsList += ' implementation(project(path: "' + libName + '"))';
insertExclude(p);
});
// For why we do this mapping: https://issues.apache.org/jira/browse/CB-8390
Expand Down Expand Up @@ -198,7 +196,7 @@ GradleBuilder.prototype.prepEnv = function (opts) {
// For some reason, using ^ and $ don't work. This does the job, though.
var distributionUrlRegex = /distributionUrl.*zip/;
/* jshint -W069 */
var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'https\\://services.gradle.org/distributions/gradle-3.3-all.zip';
var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'https\\://services.gradle.org/distributions/gradle-4.1-all.zip';
/* jshint +W069 */
var gradleWrapperPropertiesPath = path.join(self.root, 'gradle', 'wrapper', 'gradle-wrapper.properties');
shell.chmod('u+w', gradleWrapperPropertiesPath);
Expand Down
12 changes: 2 additions & 10 deletions bin/templates/cordova/lib/check_reqs.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,8 @@ module.exports.get_gradle_wrapper = function () {
var i = 0;
var foundStudio = false;
var program_dir;
if (module.exports.isDarwin()) {
program_dir = fs.readdirSync('/Applications');
while (i < program_dir.length && !foundStudio) {
if (program_dir[i].startsWith('Android Studio')) {
// TODO: Check for a specific Android Studio version, make sure it's not Canary
androidStudioPath = path.join('/Applications', program_dir[i], 'Contents', 'gradle');
foundStudio = true;
} else { ++i; }
}
} else if (module.exports.isWindows()) {
//OK, This hack only works on Windows, not on Mac OS or Linux. We will be deleting this eventually!
if (module.exports.isWindows()) {

var result = child_process.spawnSync(path.join(__dirname, 'getASPath.bat'));
// console.log('result.stdout =' + result.stdout.toString());
Expand Down
6 changes: 3 additions & 3 deletions bin/templates/project/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ buildscript {
// http://tools.android.com/tech-docs/new-build-system/version-compatibility
// and https://issues.apache.org/jira/browse/CB-8143
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.android.tools.build:gradle:3.0.0'
}
}

Expand All @@ -47,7 +47,7 @@ allprojects {
}

task wrapper(type: Wrapper) {
gradleVersion = '2.14.1'
gradleVersion = '4.1.0'
}

// Configuration properties. Set these via environment variables, build-extras.gradle, or gradle.properties.
Expand Down Expand Up @@ -249,7 +249,7 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
implementation fileTree(dir: 'libs', include: '*.jar')
// SUB-PROJECT DEPENDENCIES START
// SUB-PROJECT DEPENDENCIES END
}
Expand Down

0 comments on commit 9fdb126

Please sign in to comment.