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