Skip to content
Snippets Groups Projects
Commit b65de6b0 authored by Daniel Stonier's avatar Daniel Stonier
Browse files

centralise last code snippets from android build.gradle's.

parent 1b08a08d
No related branches found
No related tags found
No related merge requests found
...@@ -16,18 +16,48 @@ class RosAndroidPlugin implements Plugin<Project> { ...@@ -16,18 +16,48 @@ class RosAndroidPlugin implements Plugin<Project> {
if (!project.plugins.findPlugin('ros')) { if (!project.plugins.findPlugin('ros')) {
project.apply(plugin: 'ros') project.apply(plugin: 'ros')
} }
project.apply(plugin: 'android')
project.extensions.create("rosandroid", RosAndroidPluginExtension) project.extensions.create("rosandroid", RosAndroidPluginExtension)
project.rosandroid.buildToolsVersion = "17" 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 * Our maven repo 3rd parties are currently incompatible with android
* junit especially could use a look at - find a compatible version! * junit especially could use a look at - find a compatible version!
*/ **********************************************************************/
project.configurations.create('compile')
def excludes = new HashMap<String, String>() def excludes = new HashMap<String, String>()
excludes.put('group', 'junit') excludes.put('group', 'junit')
excludes.put('group', 'xml-apis') excludes.put('group', 'xml-apis')
project.configurations['compile'].exclude(excludes) 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
}
}
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment