From b65de6b0d7c78f38fa2ddbcd1709c699132c99cb Mon Sep 17 00:00:00 2001 From: Daniel Stonier <d.stonier@gmail.com> Date: Mon, 23 Sep 2013 17:30:31 +0900 Subject: [PATCH] centralise last code snippets from android build.gradle's. --- .../org/ros/gradle_plugins/RosAndroid.groovy | 38 +++++++++++++++++-- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/gradle_plugins/src/main/groovy/org/ros/gradle_plugins/RosAndroid.groovy b/gradle_plugins/src/main/groovy/org/ros/gradle_plugins/RosAndroid.groovy index 09bf7c5..f407187 100644 --- a/gradle_plugins/src/main/groovy/org/ros/gradle_plugins/RosAndroid.groovy +++ b/gradle_plugins/src/main/groovy/org/ros/gradle_plugins/RosAndroid.groovy @@ -16,18 +16,48 @@ class RosAndroidPlugin implements Plugin<Project> { if (!project.plugins.findPlugin('ros')) { project.apply(plugin: 'ros') } - project.apply(plugin: 'android') project.extensions.create("rosandroid", RosAndroidPluginExtension) project.rosandroid.buildToolsVersion = "17" - project.configurations.create('compile') - /* + /********************************************************************* + * Find the android plugin + *********************************************************************/ + project.buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:0.5.6' + } + } + /********************************************************************** + * Publishing - not we're using old style here. Upgrade to maven-publish + * once they have support: + * https://github.com/rosjava/rosjava_bootstrap/issues/1 + **********************************************************************/ + project.uploadArchives { + repositories.mavenDeployer { + repository(url: 'file://' + project.ros.mavenDeploymentRepository) + } + } + /********************************************************************** * Our maven repo 3rd parties are currently incompatible with android * junit especially could use a look at - find a compatible version! - */ + **********************************************************************/ + project.configurations.create('compile') def excludes = new HashMap<String, String>() excludes.put('group', 'junit') excludes.put('group', 'xml-apis') project.configurations['compile'].exclude(excludes) + /********************************************************************** + * Delay android plugin configuration because that will depend on + * the subproject's late loading of android or android-library plugin. + **********************************************************************/ + project.afterEvaluate { + project.android { + buildToolsVersion project.rosandroid.buildToolsVersion + } + } + } } -- GitLab