Commit 934c658eed7674a0a65c2f37e1a57bdbacc680ca
1 parent
e76116ff
Ar提交2
Showing
3 changed files
with
50 additions
and
0 deletions
settings.gradle
syar/build.gradle
| 1 | 1 | apply plugin: 'com.android.library' |
| 2 | +apply from: './maven_push.gradle' | |
| 2 | 3 | |
| 3 | 4 | android { |
| 4 | 5 | compileSdkVersion 27 |
| ... | ... | @@ -33,3 +34,8 @@ dependencies { |
| 33 | 34 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' |
| 34 | 35 | compile files('libs/SyAR.jar') |
| 35 | 36 | } |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | ... | ... |
syar/maven_push.gradle
0 → 100644
| 1 | +apply plugin: 'maven' | |
| 2 | + | |
| 3 | +uploadArchives() { | |
| 4 | + repositories { | |
| 5 | + mavenDeployer { | |
| 6 | + def debug = true | |
| 7 | + | |
| 8 | + android.defaultPublishConfig debug ? "debug" : "release" | |
| 9 | + | |
| 10 | + repository(url: gradle.mavenUrl) { | |
| 11 | + authentication(userName: gradle.mavenUserName, password: gradle.mavenPwd) | |
| 12 | + } | |
| 13 | + | |
| 14 | + pom.project { | |
| 15 | + groupId 'cn.syar.demo' //包名 | |
| 16 | + artifactId 'syar' //库名 | |
| 17 | + version = "1.0.2" | |
| 18 | + } | |
| 19 | + | |
| 20 | + pom.whenConfigured { pom -> | |
| 21 | + //TODO POM文件目前无法区分 compile 和 implementation | |
| 22 | + List list = new ArrayList() | |
| 23 | + | |
| 24 | + pom.dependencies.findAll { | |
| 25 | + dep -> | |
| 26 | + dep.groupId == rootProject.name || | |
| 27 | + dep.groupId == "com.android.support" || | |
| 28 | + dep.groupId == "com.android.databinding" || | |
| 29 | + dep.groupId == "com.android.support.constraint" | |
| 30 | + }.collect { dep -> list.add(dep) } | |
| 31 | + | |
| 32 | + pom.dependencies.removeAll(list) | |
| 33 | + } | |
| 34 | + | |
| 35 | + } | |
| 36 | + } | |
| 37 | +} | |
| 0 | 38 | \ No newline at end of file | ... | ... |