summaryrefslogtreecommitdiff
path: root/app/build.gradle
diff options
context:
space:
mode:
Diffstat (limited to 'app/build.gradle')
-rw-r--r--app/build.gradle81
1 files changed, 45 insertions, 36 deletions
diff --git a/app/build.gradle b/app/build.gradle
index 1d942584..dfcb2fbe 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -1,5 +1,5 @@
apply plugin: 'android'
-//import org.ajoberstar.grgit.*
+import org.ajoberstar.grgit.Grgit
android {
compileSdkVersion 21
@@ -54,20 +54,24 @@ def processFileInplace(file, Closure processText) {
file.write(processText(text))
}
-
-task checkoutStrippedIcsOpenVPN ( type: Copy ) {
- println "checkoutStrippedIcsOpenVPN"
- //FIXME Checkout ics-openvpn-stripped from branch "ics-openvpn-upstream"
- //grgit = Grgit.open(project.file('../'))
-
- from '../../bitmask_android_tmp/ics-openvpn-stripped'
- into '../ics-openvpn-stripped'
-}
-
task copyIcsOpenVPNClasses( type: Copy ) {
println "copyIcsOpenVPNClasses"
- from ('../ics-openvpn-stripped/main/') {
- include '**/*.java'
+ from ('../ics-openvpn/main/') {
+ include '**/LaunchVPN.java'
+ include '**/VpnProfile.java'
+ include '**/DisconnectVPN.java'
+ include '**/VpnProfile.java'
+ include '**/LogWindow.java'
+ include '**/LogFragment.java'
+ include '**/SeekBarTicks.java'
+ include '**/log_window.xml'
+ include '**/log_fragment.xml'
+ include '**/log_silders.xml'
+ include '**/vpnstatus.xml'
+ include '**/styles.xml'
+ include '**/dimens.xml'
+ include '**/logmenu.xml'
+ include '**/core/**.java'
includeEmptyDirs = false
@@ -85,7 +89,7 @@ task copyIcsOpenVPNClasses( type: Copy ) {
task copyIcsOpenVPNXml( type: Copy ) {
println "copyIcsOpenVPNXml"
- from ('../ics-openvpn-stripped/main/') {
+ from ('../ics-openvpn/main/') {
include '**/strings.xml'
include '**/log_*.xml'
include '**/vpnstatus.xml'
@@ -106,7 +110,7 @@ task copyIcsOpenVPNXml( type: Copy ) {
task copyIcsOpenVPNImages( type: Copy ) {
println "copyIcsOpenVPNImages"
- from ('../ics-openvpn-stripped/main/') {
+ from ('../ics-openvpn/main/') {
include '**/ic_filter*.png'
include '**/ic_delete*.png'
include '**/ic_share*.png'
@@ -118,15 +122,8 @@ task copyIcsOpenVPNImages( type: Copy ) {
} into '.'
}
-task copyIcsOpenVPNFiles( type: Copy, dependsOn: 'checkoutStrippedIcsOpenVPN' ) {
- println "copyIcsOpenVPNFiles"
- copyIcsOpenVPNClasses.execute()
- copyIcsOpenVPNXml.execute()
- copyIcsOpenVPNImages.execute()
-}
-
// thanks to http://pleac.sourceforge.net/pleac_groovy/fileaccess.html
-task removeDuplicatedStrings( dependsOn: 'copyIcsOpenVPNFiles' ) {
+task removeDuplicatedStrings() {
println "removeDuplicatedStrings"
new File('.').eachFileRecurse {
if(it.name.equals('strings.xml')) {
@@ -145,9 +142,9 @@ task removeDuplicatedStrings( dependsOn: 'copyIcsOpenVPNFiles' ) {
}
}
-task mergeUntranslatable( type: Copy, dependsOn: 'removeDuplicatedStrings') {
+task mergeUntranslatable( type: Copy ) {
println "mergeUntranslatable"
- from ('../ics-openvpn-stripped/main/') {
+ from ('../ics-openvpn/main/') {
include '**/untranslatable.xml'
rename 'untranslatable.xml', 'untranslatable-icsopenvpn.xml'
} into '.'
@@ -178,17 +175,29 @@ task mergeUntranslatable( type: Copy, dependsOn: 'removeDuplicatedStrings') {
delete ics_openvpn_untranslatable
}
-task updateIcsOpenVpn( type: Copy, dependsOn: 'mergeUntranslatable') {
- from('../ics-openvpn-stripped/') {
- include 'openvpn/**/*'
- include 'openssl/**/*'
- include 'lzo/**/**'
- include 'jni/**/*'
- include 'misc/**/*'
- include 'ovpn3/**/*'
- include 'snappy/**/*'
-
- } into './'
+task copyIcsOpenVPNFiles( type: Copy ) {
+ println "copyIcsOpenVPNFiles"
+ copyIcsOpenVPNClasses.execute()
+ copyIcsOpenVPNXml.execute()
+ copyIcsOpenVPNImages.execute()
+ //mergeUntranslatable.execute()
+ removeDuplicatedStrings.execute()
+}
+
+task updateIcsOpenVpn( type: Copy ) {
+ // Check out ics-openvpn bitmask branch
+ def ics_openvpn_path = project.relativePath('./ics-openvpn/')
+ def app_path = project.relativePath('./app/')
+ def grgit = Grgit.open(currentDir: ics_openvpn_path)
+ grgit.checkout(branch: 'bitmask')
+ // TODO Right now we can't do a git submodule init,
+ // DON'T FORGET TO DO IT FOR THE FIRST TIME
+
+ // from ics_openvpn_path
+ // into app_path
+ // include('**/openvpn/**', '**/openssl/**', '**/lzo/**', '**/jni/**', '**/misc/**', '**/ovpn3/**', '**/snappy/**')
+
+ copyIcsOpenVPNFiles.execute()
}
task buildNative ( type: Exec ) {