Commit 6fd03706c468f6353e927f6166df345828131f52
1 parent
c1d7d48c
ver 1.1
Showing
3 changed files
with
34 additions
and
1 deletions
config.gradle
publish/build.gradle
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 |