summaryrefslogtreecommitdiff
path: root/app/build.gradle
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2015-06-04 19:20:15 +0200
committerParménides GV <parmegv@sdf.org>2015-06-04 19:20:15 +0200
commit27594eeae6f40a402bc3110f06d57975168e74e3 (patch)
treecdabf6571e6f4ff07205fd6921d8095539a1fcdc /app/build.gradle
parent8dc4f58d96892fbfd83094fb85b1d17656035290 (diff)
ics-openvpn as a submodule! beautiful
ics-openvpn is now officially on GitHub, and they track openssl and openvpn as submodules, so it's easier to update everything. Just a git submodule update --recursive. I've also set up soft links to native modules from ics-openvpn in app, so that we don't copy files in Gradle (which was causing problems with the submodules .git* files, not being copied). That makes the repo cleaner.
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 ) {