import au.com.coherentsoftware.gradle.mercurial.task.* import org.apache.tools.ant.filters.ReplaceTokens buildscript { repositories { mavenCentral() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:0.9.+' classpath 'au.com.coherentsoftware.gradle:Gradle-MercurialMqPlugin:1.1.0+' } } allprojects { repositories { mavenCentral() } } apply plugin: 'mercurial-mq' task cloneIcsOpenVPN( type: HgClone ) { ext.srcFile = file('build.gradle') ext.destDir = new File('.', 'ics-openvpn') inputs.file srcFile outputs.dir destDir sourceUrl = 'https://code.google.com/p/ics-openvpn/' } task updateIcsOpenVPN( type: HgUpdate, dependsOn: 'pullIcsOpenVPN' ) { workingDir = 'ics-openvpn' branch = 'default' } task pullIcsOpenVPN( type: HgPull ) { sourceUrl = 'https://code.google.com/p/ics-openvpn/' workingDir = 'ics-openvpn' } task copyIcsOpenVPNClasses( type: Copy ) { from ('ics-openvpn/main') { include '**/*.java' include '**/*.aidl' filter { line -> line.replaceAll('de.blinkt.openvpn.R', 'se.leap.bitmaskclient.R') } filter { line -> line.replaceAll('de.blinkt.openvpn.BuildConfig', 'se.leap.bitmaskclient.BuildConfig') } } into 'app' }