build.gradle 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. apply plugin: 'com.android.application'
  2. android {
  3. compileSdkVersion 24
  4. buildToolsVersion "24.0.0"
  5. defaultConfig {
  6. //FIXME: Change application name as your requirement
  7. manifestPlaceholders = [applicationName: "Odoo by Eiru"]
  8. //FIXME: Please change the application id as your requirement
  9. applicationId "com.eiru.odoo"
  10. minSdkVersion 14
  11. targetSdkVersion 24
  12. versionCode 6
  13. versionName "2.2.0"
  14. multiDexEnabled true
  15. }
  16. dexOptions {
  17. javaMaxHeapSize "2g"
  18. }
  19. buildTypes {
  20. release {
  21. minifyEnabled false
  22. shrinkResources true
  23. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  24. }
  25. }
  26. }
  27. dependencies {
  28. compile fileTree(include: ['*.jar'], dir: 'libs')
  29. compile 'com.android.support:appcompat-v7:24.0.0'
  30. compile 'com.android.support:cardview-v7:24.0.0'
  31. compile 'com.google.android.gms:play-services:9.0.2'
  32. compile 'com.android.support:design:24.0.0'
  33. compile project(':intro-slider-lib')
  34. compile project(':odoo-rpc-v3')
  35. }
  36. /**
  37. * Application Package checker.
  38. * Required to change application Id 'com.odoo' and application name 'Odoo'
  39. */
  40. task compilePreCheck(dependsOn: build) {
  41. if (project.getProperty("checkForPackageName") == "true") {
  42. def testId = project.getProperty("appId")
  43. def testName = project.getProperty("appName")
  44. def packageWarning = "Application name and Application id must be different than '$testId' and '$testName'.\n\n " +
  45. "Please change your Application Id and Application name in app/build.gradle\n" +
  46. "Thank You.\n Odoo Mobile Team"
  47. def applicationId = android.defaultConfig.getProperty("applicationId")
  48. def applicationName = android.defaultConfig.manifestPlaceholders.get("applicationName")
  49. println "Odoo Mobile : Pre checking package and application name"
  50. print "Current Application Id : $applicationId"
  51. print "Current Application Name : $applicationName"
  52. if (applicationId == testId || applicationName == testName) {
  53. throw new StopExecutionException(packageWarning)
  54. }
  55. }
  56. }