Guest User

Untitled

a guest
Jul 19th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. apply plugin: 'maven'
  2. //apply plugin: 'com.github.dcendents.android-maven'
  3. repositories {
  4. mavenCentral()
  5. }
  6.  
  7. //for project dependency
  8. project.group = GROUP_ID
  9. project.version = COMPONENT_VERSION
  10. task deploy {
  11. }
  12. deploy.dependsOn uploadArchives
  13.  
  14. uploadArchives {
  15. def typePattern = ~"[0-9]\\.[0-9]\\.[0-9]\$"
  16. def depolyTypeUrl
  17. if(typePattern.matcher(COMPONENT_VERSION)){
  18. println "warn ! find release version! will deploy release aar! version is $COMPONENT_VERSION "
  19. depolyTypeUrl= deployUrl.replace("snapshots","releases")
  20. }else {
  21. depolyTypeUrl = deployUrl
  22. }
  23. // depolyTypeUrl= deployUrl.replace("snapshots","releases")
  24. //println "depolyTypeUrl " + depolyTypeUrl
  25.  
  26. repositories.mavenDeployer {
  27. repository(url: depolyTypeUrl) {
  28. authentication(userName: deployUserName, password: deployPassword)
  29. }
  30. pom.project {
  31. groupId GROUP_ID
  32. artifactId POM_ARTIFACT_ID
  33. packaging PACKAGE_FORMAT
  34. version COMPONENT_VERSION
  35.  
  36. }
  37. }
  38. }
  39. //上传源代码
  40. //task androidSourcesJar(type: Jar) {
  41. // classifier = 'sources'
  42. // from android.sourceSets.main.java.sourceFiles
  43. //}
  44.  
  45. //artifacts {
  46. // archives androidSourcesJar
  47. //}
Add Comment
Please, Sign In to add comment