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 09bf7c50f2e6b4905e09f840e3906c42ebb6396a..f407187b36fb44c5c3e680a7619243afc1aeee79 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 + } + } + } }