build.gradle 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. apply plugin: 'com.android.library'
  2. apply plugin: 'com.github.dcendents.android-maven'
  3. apply plugin: 'com.jfrog.bintray'
  4. android {
  5. compileSdkVersion 27
  6. defaultConfig {
  7. minSdkVersion 16
  8. targetSdkVersion 26
  9. versionCode 1
  10. versionName "1.0"
  11. testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  12. }
  13. buildTypes {
  14. release {
  15. minifyEnabled false
  16. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  17. }
  18. }
  19. }
  20. dependencies {
  21. implementation fileTree(dir: 'libs', include: ['*.jar'])
  22. testImplementation 'junit:junit:4.12'
  23. androidTestImplementation 'com.android.support.test:runner:1.0.2'
  24. androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
  25. implementation 'com.android.support:appcompat-v7:27.1.1'
  26. }
  27. version = "2.7.3"
  28. def siteUrl = 'https://github.com/zhpanvip/BannerViewPager' // 项目的主页
  29. def gitUrl = 'https://github.com/zhpanvip/BannerViewPager.git' // Git仓库的url
  30. group = "com.zhpan.library" // Maven Group ID for the artifact,一般填你唯一的包名
  31. install {
  32. repositories.mavenInstaller {
  33. // This generates POM.xml with proper parameters
  34. pom {
  35. project {
  36. packaging 'aar'
  37. // Add your description here
  38. description 'Banner ViewPager for Android'
  39. name 'Banner ViewPager for Android' //项目描述
  40. url siteUrl
  41. // Set your license
  42. licenses {
  43. license {
  44. name 'The Apache Software License, Version 2.0'
  45. url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
  46. }
  47. }
  48. developers {
  49. developer { // 开发者信息
  50. id 'zhpan'
  51. name 'zhangpan'
  52. email 'zhpanvip@outlook.com'
  53. }
  54. }
  55. scm {
  56. connection gitUrl
  57. developerConnection gitUrl
  58. url siteUrl
  59. }
  60. }
  61. }
  62. }
  63. }
  64. task sourcesJar(type: Jar) {
  65. from android.sourceSets.main.java.srcDirs
  66. classifier = 'sources'
  67. }
  68. task javadoc(type: Javadoc) {
  69. failOnError false
  70. }
  71. task javadocJar(type: Jar, dependsOn: javadoc) {
  72. classifier = 'javadoc'
  73. from javadoc.destinationDir
  74. }
  75. artifacts {
  76. archives javadocJar
  77. archives sourcesJar
  78. }
  79. Properties properties = new Properties()
  80. // 加载本地配置
  81. properties.load(project.rootProject.file('local.properties').newDataInputStream())
  82. bintray {
  83. user = properties.getProperty("bintray.user")
  84. key = properties.getProperty("bintray.apikey")
  85. configurations = ['archives']
  86. pkg {
  87. repo = "CircleViewPager" //发布到Bintray的那个仓库里,默认账户有四个库,我们这里上传到maven库
  88. name = "bannerview" //发布到Bintray上的项目名字
  89. websiteUrl = siteUrl
  90. vcsUrl = gitUrl
  91. licenses = ["Apache-2.0"]
  92. publish = true
  93. }
  94. }
  95. //提交命令:gradlew bintrayUpload
  96. // mac ./gradlew bintrayUpload 没有权限使用申请 chmod +x gradlew