Commit 6fd03706c468f6353e927f6166df345828131f52

Authored by 袁思汶
1 parent c1d7d48c

ver 1.1

config.gradle
@@ -17,7 +17,7 @@ ext { @@ -17,7 +17,7 @@ ext {
17 ] 17 ]
18 18
19 //Maven Base库配置 19 //Maven Base库配置
20 - out_shared = [ 20 + publishworks = [
21 //编译方式 21 //编译方式
22 debug : false, 22 debug : false,
23 //版本号 23 //版本号
publish/build.gradle
1 apply plugin: 'com.android.library' 1 apply plugin: 'com.android.library'
  2 +apply from: './maven_push.gradle'
2 3
3 android { 4 android {
4 compileSdkVersion = 29 5 compileSdkVersion = 29
publish/maven_push.gradle 0 → 100644
  1 +apply plugin: 'maven'
  2 +
  3 +uploadArchives() {
  4 + repositories {
  5 + mavenDeployer {
  6 + def lib = publishworks
  7 + //发布环境(正式/测试)
  8 + android.defaultPublishConfig lib.debug ? "debug" : "release"
  9 + //发布渠道(地址/账号)
  10 + repository(url: maven.mavenMixedUrl) {
  11 + authentication(userName: maven.mavenUserName, password: maven.mavenPwd)
  12 + }
  13 + //发布信息(包名/别名/版本)
  14 + pom.project {
  15 + groupId lib.packeg
  16 + artifactId lib.name
  17 + version = lib.debug ? lib.version.concat("-SNAPSHOT") : lib.version
  18 + }
  19 + pom.whenConfigured { pom ->
  20 + List list = new ArrayList()
  21 + //手动增加过滤项
  22 + pom.dependencies.findAll {
  23 + dep -> dep.groupId == "pub.devrel" || dep.groupId == "com.chensl.rotatephotoview"
  24 + }.collect { dep -> list.add(dep) }
  25 + //移除支持库
  26 + pom.dependencies.clear()
  27 + pom.dependencies.addAll(list)
  28 + }
  29 +
  30 + }
  31 + }
  32 +}
0 \ No newline at end of file 33 \ No newline at end of file