build.gradle 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. apply plugin: 'com.android.library'
  2. apply plugin: 'com.github.dcendents.android-maven'
  3. apply plugin: 'com.jfrog.bintray'
  4. android {
  5. compileSdkVersion 26
  6. defaultConfig {
  7. minSdkVersion 19
  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:26.1.0'
  26. }
  27. def siteUrl = 'https://github.com/zhpanvip/CircleViewPager' // 项目的主页
  28. def gitUrl = 'https://github.com/zhpanvip/CircleViewPager.git' // Git仓库的url
  29. group = "com.zhpan.library" // Maven Group ID for the artifact,一般填你唯一的包名
  30. install {
  31. repositories.mavenInstaller {
  32. // This generates POM.xml with proper parameters
  33. pom {
  34. project {
  35. packaging 'aar'
  36. // Add your description here
  37. description 'my utils for test'
  38. name 'Android Commonly used utils' //项目描述
  39. url siteUrl
  40. // Set your license
  41. licenses {
  42. license {
  43. name 'The Apache Software License, Version 2.0'
  44. url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
  45. }
  46. }
  47. developers {
  48. developer { // 开发者信息
  49. id 'zhpan'
  50. name 'zhangpan'
  51. email 'zhpanvip@outlook.com'
  52. }
  53. }
  54. scm {
  55. connection gitUrl
  56. developerConnection gitUrl
  57. url siteUrl
  58. }
  59. }
  60. }
  61. }
  62. }
  63. task sourcesJar(type: Jar) {
  64. from android.sourceSets.main.java.srcDirs
  65. classifier = 'sources'
  66. }
  67. task javadoc(type: Javadoc) {
  68. failOnError false
  69. }
  70. task javadocJar(type: Jar, dependsOn: javadoc) {
  71. classifier = 'javadoc'
  72. from javadoc.destinationDir
  73. }
  74. artifacts {
  75. archives javadocJar
  76. archives sourcesJar
  77. }
  78. Properties properties = new Properties()
  79. // 加载本地配置
  80. properties.load(project.rootProject.file('local.properties').newDataInputStream())
  81. bintray {
  82. user = properties.getProperty("bintray.user")
  83. key = properties.getProperty("bintray.apikey")
  84. configurations = ['archives']
  85. pkg {
  86. repo = "CircleViewPager" //发布到Bintray的那个仓库里,默认账户有四个库,我们这里上传到maven库
  87. name = "circleviewpager" //发布到Bintray上的项目名字
  88. websiteUrl = siteUrl
  89. vcsUrl = gitUrl
  90. licenses = ["Apache-2.0"]
  91. publish = true
  92. }
  93. }
  94. //提交命令:gradlew bintrayUpload