|
1 | 1 | plugins {
|
2 | 2 | id 'com.android.library'
|
3 | 3 | id 'maven-publish'
|
| 4 | + id 'signing' |
4 | 5 | }
|
5 | 6 |
|
6 | 7 | android {
|
7 | 8 | namespace 'com.oasisfeng.condom'
|
8 | 9 | compileSdk 34
|
9 | 10 | defaultConfig {
|
| 11 | + versionName '3.0.0' |
10 | 12 | minSdk 14
|
11 | 13 |
|
12 | 14 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
@@ -51,29 +53,65 @@ android.libraryVariants.configureEach { variant ->
|
51 | 53 | variant.processJavaResources.dependsOn(taskName)
|
52 | 54 | }
|
53 | 55 |
|
| 56 | +dependencies { |
| 57 | + compileOnly 'com.google.code.findbugs:jsr305:3.0.2' |
| 58 | + compileOnly 'androidx.annotation:annotation:1.7.0' |
| 59 | + |
| 60 | + androidTestImplementation 'androidx.test:runner:1.5.2' |
| 61 | + androidTestImplementation 'androidx.test.ext:junit:1.1.5' |
| 62 | + |
| 63 | + testImplementation 'junit:junit:4.13.2' |
| 64 | +} |
| 65 | + |
54 | 66 | publishing {
|
55 | 67 | publications {
|
56 | 68 | maven(MavenPublication) {
|
57 | 69 | groupId = 'com.oasisfeng.condom'
|
58 | 70 | artifactId = 'library'
|
59 |
| - version = '2.5.0' |
| 71 | + version = android.defaultConfig.versionName |
60 | 72 |
|
61 | 73 | afterEvaluate {
|
62 | 74 | from components.release
|
63 | 75 | }
|
| 76 | + |
| 77 | + pom { |
| 78 | + name = 'Project Condom' |
| 79 | + description = 'A thin library to wrap the naked Context in your Android project before passing it to the 3rd-party SDK. It is designed to prevent the 3rd-party SDK from common unwanted behaviors which may harm the user experience of your app.' |
| 80 | + url = 'https://github.com/oasisfeng/condom' |
| 81 | + licenses { |
| 82 | + license { |
| 83 | + name = 'The Apache License, Version 2.0' |
| 84 | + url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' |
| 85 | + } |
| 86 | + } |
| 87 | + developers { |
| 88 | + developer { |
| 89 | + id = 'oasisfeng' |
| 90 | + name = 'Oasis Feng' |
| 91 | + email = 'oss@oasisfeng.com' |
| 92 | + } |
| 93 | + } |
| 94 | + scm { |
| 95 | + connection = 'scm:git:git://github.com/oasisfeng/condom.git' |
| 96 | + developerConnection = 'scm:git:ssh://github.com/oasisfeng/condom.git' |
| 97 | + url = 'https://github.com/oasisfeng/condom' |
| 98 | + } |
| 99 | + } |
64 | 100 | }
|
65 | 101 | }
|
66 | 102 | repositories {
|
| 103 | + maven { |
| 104 | + url = android.defaultConfig.versionName.endsWith("-SNAPSHOT") ? "https://oss.sonatype.org/content/repositories/snapshots/" |
| 105 | + : "https://oss.sonatype.org/service/local/staging/deploy/maven2/" |
| 106 | + credentials { |
| 107 | + username = ossrhUsername |
| 108 | + password = ossrhPassword |
| 109 | + } |
| 110 | + } |
67 | 111 | mavenLocal()
|
68 | 112 | }
|
69 | 113 | }
|
70 | 114 |
|
71 |
| -dependencies { |
72 |
| - compileOnly 'com.google.code.findbugs:jsr305:3.0.2' |
73 |
| - compileOnly 'androidx.annotation:annotation:1.7.0' |
74 |
| - |
75 |
| - androidTestImplementation 'androidx.test:runner:1.5.2' |
76 |
| - androidTestImplementation 'androidx.test.ext:junit:1.1.5' |
77 |
| - |
78 |
| - testImplementation 'junit:junit:4.13.2' |
| 115 | +signing { |
| 116 | + sign publishing.publications.maven |
79 | 117 | }
|
0 commit comments