diff --git a/build.gradle b/build.gradle index 3407b82a0..0bb26ada2 100644 --- a/build.gradle +++ b/build.gradle @@ -28,6 +28,4 @@ allprojects { } } -task clean(type: Delete) { - delete rootProject.buildDir -} +apply from: "dependencies.gradle" diff --git a/dependencies.gradle b/dependencies.gradle new file mode 100644 index 000000000..4a2518536 --- /dev/null +++ b/dependencies.gradle @@ -0,0 +1,38 @@ +def support_lib_version = '25.4.0' +def jems_version = '1.15' +def contentpal_version = '9b087b2' // 9b087b2 -> 2017-12-12 +def support_test_runner_version = '0.5' + +ext.deps = [ + // Support & Google libraries + support_appcompat : "com.android.support:appcompat-v7:$support_lib_version", + support_annotations: "com.android.support:support-annotations:$support_lib_version", + support_design : "com.android.support:design:$support_lib_version", + android_dashclock : 'com.google.android.apps.dashclock:dashclock-api:2.0.0', + + // dmfs + jems : "org.dmfs:jems:$jems_version", + datetime : 'org.dmfs:rfc5545-datetime:0.2.4', + lib_recur : 'org.dmfs:lib-recur:0.10.1', + xml_magic : 'org.dmfs:android-xml-magic:0.1.1', + color_picker : 'com.github.dmfs.color-picker:colorpicker-activity:1.1', + android_carrot : 'com.github.dmfs.androidcarrot:androidcarrot:13edc04', + bolts_color : 'com.github.dmfs.bolts:color-bolts:27f34f7', // 27f34f7 -> 2017-12-04 + contentpal : "com.github.dmfs.contentpal:contentpal:$contentpal_version", + + // 3rd party + codeka_carrot : 'au.com.codeka:carrot:2.4.0', + + // Testing + junit : 'junit:junit:4.12', + hamcrest : 'org.hamcrest:hamcrest-all:1.3', + mockito : 'org.mockito:mockito-core:2.10.0', + robolectric : 'org.robolectric:robolectric:3.5.1', + support_test_runner: "com.android.support.test:runner:$support_test_runner_version", + support_test_rules : "com.android.support.test:rules:$support_test_runner_version", + + // dmfs testing + jems_testing : "org.dmfs:jems-testing:$jems_version", + contenttestpal : "com.github.dmfs.contentpal:contenttestpal:$contentpal_version", + contentpal_testing : "com.github.dmfs.contentpal:contentpal-testing:$contentpal_version" +] \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 060148b88..b9f79766b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,15 +1,4 @@ COMPILE_SDK_VERSION=25 BUILD_TOOLS_VERSION=27.0.1 MIN_SDK_VERSION=15 -TARGET_SDK_VERSION=25 -# dependency versions -SUPPORT_LIBRARY_VERSION=25.4.0 -# contentpal 9b087b2 -> 2017-12-12 -CONTENTPAL_VERSION=9b087b2 -ROBOLECTRIC_VERSION=3.1.4 -JEMS_VERSION=1.15 -LIB_RECUR_VERSION=0.10.1 -ANDROID_TEST_RUNNER_VERSION=0.5 -RFC5545_DATETIME_VERSION=0.2.4 -# bolts 27f34f7 -> 2017-12-04 -BOLTS_VERSION=27f34f7 +TARGET_SDK_VERSION=25 \ No newline at end of file diff --git a/opentasks-provider/build.gradle b/opentasks-provider/build.gradle index c96e40055..a5d4c88c4 100644 --- a/opentasks-provider/build.gradle +++ b/opentasks-provider/build.gradle @@ -30,20 +30,21 @@ android { dependencies { api project(':opentasks-contract') - implementation 'org.dmfs:rfc5545-datetime:' + RFC5545_DATETIME_VERSION - implementation 'org.dmfs:lib-recur:' + LIB_RECUR_VERSION - implementation 'org.dmfs:jems:' + JEMS_VERSION + implementation deps.datetime + implementation deps.lib_recur + implementation deps.jems + + testImplementation deps.robolectric + testImplementation deps.junit + testImplementation deps.mockito + testImplementation deps.jems_testing + testImplementation deps.hamcrest androidTestImplementation project(':opentaskspal') - androidTestImplementation('com.github.dmfs.contentpal:contenttestpal:' + CONTENTPAL_VERSION) { + androidTestImplementation(deps.contenttestpal) { exclude module: 'jems' } - androidTestImplementation 'com.android.support:support-annotations:' + SUPPORT_LIBRARY_VERSION - androidTestImplementation 'com.android.support.test:runner:0.5' - androidTestImplementation 'com.android.support.test:rules:0.5' - testImplementation 'org.robolectric:robolectric:' + ROBOLECTRIC_VERSION - testImplementation 'junit:junit:4.12' - testImplementation 'org.mockito:mockito-core:2.10.0' - testImplementation 'org.dmfs:jems-testing:' + JEMS_VERSION - testImplementation 'org.hamcrest:hamcrest-all:1.3' + androidTestImplementation deps.support_annotations + androidTestImplementation deps.support_test_runner + androidTestImplementation deps.support_test_rules } diff --git a/opentasks/build.gradle b/opentasks/build.gradle index 9b5884782..77f848911 100644 --- a/opentasks/build.gradle +++ b/opentasks/build.gradle @@ -46,34 +46,34 @@ android { dependencies { implementation project(':opentasks-provider') - implementation 'com.android.support:appcompat-v7:' + SUPPORT_LIBRARY_VERSION - implementation 'com.android.support:design:' + SUPPORT_LIBRARY_VERSION - implementation('org.dmfs:android-xml-magic:0.1.1') { + implementation deps.support_appcompat + implementation deps.support_design + implementation(deps.xml_magic) { // xmlpull is part of the runtime, so don't pull it in here exclude group: 'xmlpull', module: 'xmlpull' } - implementation 'com.google.android.apps.dashclock:dashclock-api:2.0.0' - implementation 'com.github.dmfs.color-picker:colorpicker-activity:1.1' - implementation('au.com.codeka:carrot:2.4.0') { + implementation deps.android_dashclock + implementation deps.color_picker + implementation(deps.codeka_carrot) { exclude module: 'iterators' // TODO Remove when iterators have been removed from codeka:carrot } - implementation('com.github.dmfs.androidcarrot:androidcarrot:13edc04') { + implementation(deps.android_carrot) { exclude module: 'carrot' exclude group: 'com.android.support' exclude module: 'iterators' exclude module: 'jems' } - implementation 'org.dmfs:jems:' + JEMS_VERSION - implementation 'org.dmfs:rfc5545-datetime:' + RFC5545_DATETIME_VERSION - implementation 'com.github.dmfs.bolts:color-bolts:' + BOLTS_VERSION + implementation deps.jems + implementation deps.datetime + implementation deps.bolts_color - testImplementation 'junit:junit:4.12' - testImplementation 'org.robolectric:robolectric:3.5.1' + testImplementation deps.junit + testImplementation deps.robolectric - androidTestImplementation('com.android.support.test:runner:' + ANDROID_TEST_RUNNER_VERSION) { + androidTestImplementation(deps.support_test_runner) { exclude group: 'com.android.support', module: 'support-annotations' } - androidTestImplementation('com.android.support.test:rules:' + ANDROID_TEST_RUNNER_VERSION) { + androidTestImplementation(deps.support_test_rules) { exclude group: 'com.android.support', module: 'support-annotations' } } diff --git a/opentaskspal/build.gradle b/opentaskspal/build.gradle index faa3e5ca5..47592c3f8 100644 --- a/opentaskspal/build.gradle +++ b/opentaskspal/build.gradle @@ -20,18 +20,18 @@ android { dependencies { implementation project(':opentasks-contract') - implementation('com.github.dmfs.contentpal:contentpal:' + CONTENTPAL_VERSION) { + implementation(deps.contentpal) { exclude module: 'jems' } - implementation 'org.dmfs:rfc5545-datetime:' + RFC5545_DATETIME_VERSION - implementation 'org.dmfs:lib-recur:' + LIB_RECUR_VERSION - implementation 'org.dmfs:jems:' + JEMS_VERSION - implementation 'com.github.dmfs.bolts:color-bolts:' + BOLTS_VERSION + implementation deps.datetime + implementation deps.lib_recur + implementation deps.jems + implementation deps.bolts_color - testImplementation('com.github.dmfs.contentpal:contentpal-testing:' + CONTENTPAL_VERSION) { + testImplementation(deps.contentpal_testing) { exclude module: 'jems' } - testImplementation 'org.robolectric:robolectric:' + ROBOLECTRIC_VERSION - testImplementation 'junit:junit:4.12' - testImplementation 'org.mockito:mockito-core:2.10.0' + testImplementation deps.robolectric + testImplementation deps.junit + testImplementation deps.mockito } \ No newline at end of file