Fri, 13 Feb 2015 23:45:37 +0100
Give up after a longwinded and unfruitful attempt to patch ical4j,
made difficult by the neverending graph of method calls leading up
to the NPE caused in getResource*() of the ResourceLoader class.
1 buildscript {
2 repositories {
3 jcenter()
4 }
5 dependencies {
6 classpath 'com.android.tools.build:gradle:1.0.+'
7 }
8 }
10 apply plugin: 'android'
12 android {
13 compileSdkVersion 21
14 buildToolsVersion "21.1.2"
15 defaultConfig {
16 applicationId 'com.europalab.caldavsyncadapter'
17 minSdkVersion 14
18 targetSdkVersion 21
19 }
20 sourceSets {
21 main {
22 manifest.srcFile 'AndroidManifest.xml'
23 java.srcDirs = ['src']
24 resources.srcDirs = ['src']
25 aidl.srcDirs = ['src']
26 renderscript.srcDirs = ['src']
27 res.srcDirs = ['res']
28 assets.srcDirs = ['assets']
29 }
30 }
31 buildTypes {
32 release {
33 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
34 }
35 }
36 packagingOptions {
37 exclude 'META-INF/LICENSE.txt'
38 exclude 'META-INF/NOTICE.txt'
39 }
40 productFlavors {
41 }
42 //dexOptions {
43 // preDexLibraries = false
44 //}
45 }
47 // Kludgy attempt to patch ical4j
48 //task fixDeps(type: zip) {
49 // zip -d $cache/ical4j-*.jar net/fortuna/ical4j/model/TimeZoneRegistryImpl.class
50 // zip -d $cache/ical4j-*.jar net/fortuna/ical4j/util/ResourceLoader.class
51 //}
52 // Hack contains patched ical4j files
53 task patchIcal(type: Copy) {
54 from 'hack'
55 include 'model/'
56 include 'util/'
57 into 'src/net/fortuna/ical4j'
58 }
59 configure(patchIcal) {
60 group = BasePlugin.ASSEMBLE_TASK_NAME // Or BUILD_GROUP
61 description = 'Patch embedded ical4j dependency in a kludgy way'
62 }
63 task patchWipe(type: Delete) {
64 delete 'src/net'
65 }
66 configure(patchWipe) {
67 group = BasePlugin.ASSEMBLE_TASK_NAME // Or BUILD_GROUP
68 description = 'Deletes patched dependencies in a kludgy way'
69 }
70 project.afterEvaluate{
71 clean.dependsOn(patchWipe)
72 compileDebugJava.dependsOn(patchIcal)
73 compileReleaseJava.dependsOn(patchIcal)
74 }
76 dependencies {
77 compile 'com.android.support:support-v4:19.1.0'
78 compile 'org.mnode.ical4j:ical4j:1.0.6'
79 }
81 allprojects {
82 repositories {
83 jcenter()
84 }
85 }