build.gradle 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. * Copyright 2017 Zhihu Inc.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. apply plugin: 'com.android.library'
  17. //apply plugin: 'com.novoda.bintray-release'
  18. apply plugin: 'checkstyle'
  19. android {
  20. compileSdkVersion build_versions.target_sdk
  21. defaultConfig {
  22. minSdkVersion build_versions.min_sdk
  23. targetSdkVersion build_versions.target_sdk
  24. }
  25. compileOptions {
  26. sourceCompatibility JavaVersion.VERSION_1_8
  27. targetCompatibility JavaVersion.VERSION_1_8
  28. }
  29. lintOptions {
  30. abortOnError false
  31. }
  32. }
  33. dependencies {
  34. implementation fileTree(dir: 'libs', include: ['*.jar'])
  35. implementation "androidx.appcompat:appcompat:1.2.0"
  36. implementation "androidx.annotation:annotation:1.1.0"
  37. implementation "androidx.recyclerview:recyclerview:1.1.0"
  38. implementation 'it.sephiroth.android.library.imagezoom:library:1.0.4'
  39. compileOnly 'com.github.bumptech.glide:glide:4.11.0'
  40. compileOnly 'com.squareup.picasso:picasso:2.5.2'
  41. }
  42. // jcenter configuration for novoda's bintray-release
  43. // $ ./gradlew clean build bintrayUpload -PbintrayUser=BINTRAY_USERNAME -PbintrayKey=BINTRAY_KEY -PdryRun=false
  44. //publish {
  45. // userOrg = 'zhihu'
  46. // groupId = 'com.zhihu.android'
  47. // artifactId = 'matisse'
  48. // publishVersion = '0.5.3-beta3'
  49. // desc = 'A well-designed local image selector for Android'
  50. // website = 'https://www.zhihu.com/'
  51. //}
  52. task javadoc(type: Javadoc) {
  53. options.encoding = "utf-8"
  54. }
  55. checkstyle {
  56. toolVersion = '7.6.1'
  57. }
  58. tasks.withType(Javadoc) {
  59. options.addStringOption('Xdoclint:none', '-quiet')
  60. options.addStringOption('encoding', 'UTF-8')
  61. }
  62. task checkstyle(type:Checkstyle) {
  63. description 'Runs Checkstyle inspection against matisse sourcesets.'
  64. group = 'Code Quality'
  65. configFile rootProject.file('checkstyle.xml')
  66. ignoreFailures = false
  67. showViolations true
  68. classpath = files()
  69. source 'src/main/java'
  70. }