Skip to content

Commit 1d66138

Browse files
committed
Publish library to bintray maven
Signed-off-by: Fung Gwo <fython@163.com>
1 parent 6a4c2bd commit 1d66138

File tree

8 files changed

+140
-45
lines changed

8 files changed

+140
-45
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@ And we should realize that **in Android M there is only fingerprint sensor to be
3030

3131
## Samples
3232

33+
[![Download](https://api.bintray.com/packages/fython/BiometricPromptCompat/library/images/download.svg)](https://bintray.com/fython/BiometricPromptCompat/library/_latestVersion)
34+
35+
Include library in your app module:
36+
37+
```groovy
38+
dependencies {
39+
implementation 'moe.feng.support.biometricprompt:library:1.0.0'
40+
}
41+
```
42+
3343
We recommend to learn `FingerprintManager` or `BiometricPrompt` before using this library. All you need to know will be found.
3444

3545
```java

bintray.gradle

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
apply plugin: 'com.github.dcendents.android-maven'
2+
apply plugin: 'com.jfrog.bintray'
3+
4+
group = publishedGroupId
5+
6+
install {
7+
repositories.mavenInstaller {
8+
pom {
9+
project {
10+
packaging 'aar'
11+
groupId publishedGroupId
12+
artifactId artifact
13+
14+
name libraryName
15+
description libraryDescription
16+
url siteUrl
17+
18+
licenses {
19+
license {
20+
name licenseName
21+
url licenseUrl
22+
}
23+
}
24+
developers {
25+
developer {
26+
id developerId
27+
name developerName
28+
email developerEmail
29+
}
30+
}
31+
scm {
32+
connection gitUrl
33+
developerConnection gitUrl
34+
url siteUrl
35+
}
36+
}
37+
}
38+
}
39+
}
40+
41+
version = libraryVersion
42+
43+
if (project.hasProperty("android")) {
44+
task sourcesJar(type: Jar) {
45+
classifier = 'sources'
46+
from android.sourceSets.main.java.srcDirs
47+
}
48+
49+
task javadoc(type: Javadoc) {
50+
source = android.sourceSets.main.java.srcDirs
51+
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
52+
}
53+
} else {
54+
task sourcesJar(type: Jar, dependsOn: classes) {
55+
classifier = 'sources'
56+
from sourceSets.main.allSource
57+
}
58+
}
59+
60+
task javadocJar(type: Jar, dependsOn: javadoc) {
61+
classifier = 'javadoc'
62+
from javadoc.destinationDir
63+
javadoc.failOnError = false
64+
}
65+
66+
artifacts {
67+
archives javadocJar
68+
archives sourcesJar
69+
}
70+
71+
Properties properties = new Properties()
72+
properties.load(project.rootProject.file('local.properties').newDataInputStream())
73+
74+
bintray {
75+
user = properties.getProperty("bintray.user")
76+
key = properties.getProperty("bintray.apikey")
77+
78+
configurations = ['archives']
79+
pkg {
80+
repo = bintrayRepo
81+
name = bintrayName
82+
desc = libraryDescription
83+
websiteUrl = siteUrl
84+
vcsUrl = gitUrl
85+
licenses = allLicenses
86+
publish = true
87+
publicDownloadNumbers = true
88+
version {
89+
desc = libraryDescription
90+
}
91+
}
92+
}

build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1+
group 'moe.feng.support.biometricprompt'
2+
version '1.0.0'
3+
14
buildscript {
25
repositories {
36
google()
47
jcenter()
58
}
69
dependencies {
710
classpath 'com.android.tools.build:gradle:3.1.2'
11+
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
12+
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
813
}
914
}
1015

demo/src/androidTest/java/moe/feng/support/biometricprompt/ExampleInstrumentedTest.java

Lines changed: 0 additions & 26 deletions
This file was deleted.

demo/src/test/java/moe/feng/support/biometricprompt/ExampleUnitTest.java

Lines changed: 0 additions & 17 deletions
This file was deleted.

library/build.gradle

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
apply plugin: 'com.android.library'
22

3+
apply plugin: 'com.github.dcendents.android-maven'
4+
apply plugin: 'com.jfrog.bintray'
5+
36
android {
47
compileSdkVersion 28
58

69
defaultConfig {
710
minSdkVersion 21
811
targetSdkVersion 28
912
versionCode 2
10-
versionName "1.0.0"
13+
versionName project.rootProject.version
1114
vectorDrawables.useSupportLibrary = true
1215
}
1316

@@ -24,3 +27,30 @@ dependencies {
2427
//noinspection GradleCompatible
2528
implementation 'com.android.support:animated-vector-drawable:27.1.1'
2629
}
30+
31+
ext {
32+
publishedGroupId = 'moe.feng.support.biometricprompt'
33+
34+
bintrayRepo = 'BiometricPromptCompat'
35+
bintrayName = project.name
36+
37+
libraryName = 'BiometricPromptCompat'
38+
artifact = project.name
39+
40+
libraryDescription = 'Make BiometricPrompt (Android P feature) support all Android 6.0+ devices.'
41+
42+
siteUrl = 'https://github.com/fython/BiometricPromptCompat'
43+
gitUrl = 'https://github.com/fython/BiometricPromptCompat.git'
44+
45+
libraryVersion = project.rootProject.version
46+
47+
developerId = 'fython'
48+
developerName = 'Fung Gwo'
49+
developerEmail = 'fythonx@gmail.com'
50+
51+
licenseName = 'The Apache Software License, Version 2.0'
52+
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
53+
allLicenses = ["Apache-2.0"]
54+
}
55+
56+
apply from: project.rootProject.file('bintray.gradle')

library/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
package="moe.feng.support.biometricprompt">
33

44
<uses-permission android:name="android.permission.USE_FINGERPRINT"/>
5+
<uses-permission android:name="android.permission.USE_BIOMETRIC"/>
56

67
</manifest>

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
include ':demo', ':library'
1+
include ':demo', ':library'

0 commit comments

Comments
 (0)