Skip to content

Commit f54615e

Browse files
committed
Update metadata and scripts for Maven Central.
1 parent 1acc3a6 commit f54615e

File tree

4 files changed

+80
-25
lines changed

4 files changed

+80
-25
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ maven-repository
88
local.properties
99
mvn-clone
1010
*.keystore
11+
.project
12+
.settings
13+
.classpath

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ Add the following to your `build.gradle` file:
2323

2424
```groovy
2525
repositories {
26-
jcenter()
26+
mavenCentral()
2727
}
2828
2929
dependencies {
30-
implementation 'com.journeyapps:zxing-android-embedded:4.1.0'
30+
implementation 'com.journeyapps:zxing-android-embedded:4.2.0'
3131
implementation 'androidx.appcompat:appcompat:1.0.2'
3232
}
3333
@@ -43,11 +43,11 @@ For Android SDK versions < 24, you can downgrade `zxing:core` to 3.3.0 or earlie
4343

4444
```groovy
4545
repositories {
46-
jcenter()
46+
mavenCentral()
4747
}
4848
4949
dependencies {
50-
implementation('com.journeyapps:zxing-android-embedded:4.1.0') { transitive = false }
50+
implementation('com.journeyapps:zxing-android-embedded:4.2.0') { transitive = false }
5151
implementation 'androidx.appcompat:appcompat:1.0.2'
5252
implementation 'com.google.zxing:core:3.3.0'
5353
}

build.gradle

+15-4
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,34 @@
11
buildscript {
22
repositories {
33
google()
4-
jcenter()
4+
mavenCentral()
5+
jcenter {
6+
content {
7+
// https://youtrack.jetbrains.com/issue/IDEA-261387
8+
includeModule("org.jetbrains.trove4j", "trove4j")
9+
}
10+
}
511
}
612

713
dependencies {
814
classpath 'com.android.tools.build:gradle:3.5.3'
9-
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
1015
}
1116
}
1217

1318
subprojects {
1419
repositories {
1520
google()
16-
jcenter()
1721
mavenLocal()
22+
mavenCentral()
23+
jcenter {
24+
content {
25+
// https://youtrack.jetbrains.com/issue/IDEA-261387
26+
includeModule("org.jetbrains.trove4j", "trove4j")
27+
}
28+
}
1829
}
1930

20-
version = '4.1.1'
31+
version = '4.2.0'
2132
group = 'com.journeyapps'
2233

2334
ext.androidTargetSdk = 28

zxing-android-embedded/build.gradle

+58-17
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,35 @@
11
apply plugin: 'com.android.library'
22
apply plugin: 'maven-publish'
3-
apply plugin: 'com.jfrog.bintray'
4-
3+
apply plugin: 'signing'
54

65
ext.artifactId = 'zxing-android-embedded'
76

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+
833
dependencies {
934
api project.zxingCore
1035

@@ -74,12 +99,31 @@ project.afterEvaluate {
7499
artifact sourceJar
75100

76101
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+
77106
licenses {
78107
license {
79108
name = 'The Apache License, Version 2.0'
80109
url = 'https://github.com/journeyapps/zxing-android-embedded/blob/master/COPYING'
81110
}
82111
}
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+
}
83127
}
84128

85129

@@ -100,23 +144,20 @@ project.afterEvaluate {
100144
}
101145
}
102146
}
103-
}
104-
}
105147

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+
}
119157
}
120158
}
121159
}
122160

161+
signing {
162+
sign publishing.publications
163+
}

0 commit comments

Comments
 (0)