1
1
apply plugin : ' com.android.library'
2
2
apply plugin : ' maven-publish'
3
- apply plugin : ' com.jfrog.bintray'
4
-
3
+ apply plugin : ' signing'
5
4
6
5
ext. artifactId = ' zxing-android-embedded'
7
6
7
+
8
+ // Publishing config from https://getstream.io/blog/publishing-libraries-to-mavencentral-2021/
9
+ ext[" signing.keyId" ] = ' '
10
+ ext[" signing.password" ] = ' '
11
+ ext[" signing.secretKeyRingFile" ] = ' '
12
+ ext[" ossrhUsername" ] = ' '
13
+ ext[" ossrhPassword" ] = ' '
14
+ ext[" sonatypeStagingProfileId" ] = ' '
15
+
16
+ File secretPropsFile = project. rootProject. file(' local.properties' )
17
+ if (secretPropsFile. exists()) {
18
+ Properties p = new Properties ()
19
+ p. load(new FileInputStream (secretPropsFile))
20
+ p. each { name , value ->
21
+ ext[name] = value
22
+ }
23
+ } else {
24
+ ext[" signing.keyId" ] = System . getenv(' SIGNING_KEY_ID' )
25
+ ext[" signing.password" ] = System . getenv(' SIGNING_PASSWORD' )
26
+ ext[" signing.secretKeyRingFile" ] = System . getenv(' SIGNING_SECRET_KEY_RING_FILE' )
27
+ ext[" ossrhUsername" ] = System . getenv(' OSSRH_USERNAME' )
28
+ ext[" ossrhPassword" ] = System . getenv(' OSSRH_PASSWORD' )
29
+ ext[" sonatypeStagingProfileId" ] = System . getenv(' SONATYPE_STAGING_PROFILE_ID' )
30
+ }
31
+
32
+
8
33
dependencies {
9
34
api project. zxingCore
10
35
@@ -74,12 +99,31 @@ project.afterEvaluate {
74
99
artifact sourceJar
75
100
76
101
pom {
102
+ name = project. artifactId
103
+ description = ' Barcode scanner library for Android, based on the ZXing decoder'
104
+ url = ' https://github.com/journeyapps/zxing-android-embedded'
105
+
77
106
licenses {
78
107
license {
79
108
name = ' The Apache License, Version 2.0'
80
109
url = ' https://github.com/journeyapps/zxing-android-embedded/blob/master/COPYING'
81
110
}
82
111
}
112
+
113
+ developers {
114
+ developer {
115
+ id = ' '
116
+ name = ' Ralf Kistner'
117
+
118
+ organization = ' Journey Mobile, Inc'
119
+ organizationUrl = ' https://journeyapps.com'
120
+ }
121
+ }
122
+ scm {
123
+ connection = ' scm:git:github.com/journeyapps/zxing-android-embedded.git'
124
+ developerConnection = ' scm:git:ssh://github.com/journeyapps/zxing-android-embedded.git'
125
+ url = ' https://github.com/journeyapps/zxing-android-embedded'
126
+ }
83
127
}
84
128
85
129
@@ -100,23 +144,20 @@ project.afterEvaluate {
100
144
}
101
145
}
102
146
}
103
- }
104
- }
105
147
106
- // To release, place bintray_user and bintray_key properties in ~/.gradle/gradle.properties,
107
- // and run ./gradlew clean assembleRelease bintrayUpload
108
-
109
- if (project. hasProperty(' bintray_user' ) && project. hasProperty(' bintray_key' )) {
110
- bintray {
111
- user = bintray_user
112
- key = bintray_key
113
- publications = [' maven' ]
114
- publish = true
115
- pkg {
116
- userOrg = ' journeyapps'
117
- repo = ' maven'
118
- name = ' zxing-android-embedded'
148
+ repositories {
149
+ maven {
150
+ name = " sonatype"
151
+ url = " https://oss.sonatype.org/service/local/staging/deploy/maven2/"
152
+ credentials {
153
+ username ossrhUsername
154
+ password ossrhPassword
155
+ }
156
+ }
119
157
}
120
158
}
121
159
}
122
160
161
+ signing {
162
+ sign publishing. publications
163
+ }
0 commit comments