Skip to content

Commit 5f0fd11

Browse files
committed
fix #47: updated Gradle to 6.5 and AGP to 4.1.3. Implemented maven central publishing support. Dropped Bintray.
1 parent e495c38 commit 5f0fd11

9 files changed

Lines changed: 50 additions & 130 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Android Speech [ ![Download](https://api.bintray.com/packages/gotev/maven/android-speech/images/download.svg) ](https://bintray.com/gotev/maven/android-speech/_latestVersion) [ ![Maven Central](https://maven-badges.herokuapp.com/maven-central/net.gotev/speech/badge.svg) ](https://search.maven.org/search?q=g:net.gotev)
1+
# Android Speech [ ![Maven Central](https://maven-badges.herokuapp.com/maven-central/net.gotev/speech/badge.svg) ](https://search.maven.org/search?q=g:net.gotev)
22

33
Android speech recognition and text to speech made easy.
44

@@ -7,7 +7,7 @@ Android speech recognition and text to speech made easy.
77
```groovy
88
implementation 'net.gotev:speech:x.y.z'
99
```
10-
Replace `x.y.z` with [![Download](https://api.bintray.com/packages/gotev/maven/android-speech/images/download.svg) ](https://bintray.com/gotev/maven/android-speech/_latestVersion)
10+
Replace `x.y.z` with [ ![Maven Central](https://maven-badges.herokuapp.com/maven-central/net.gotev/speech/badge.svg) ](https://search.maven.org/search?q=g:net.gotev)
1111

1212
## Initialization
1313
To start using the library, you have to initialize it in your Activity

build.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ buildscript {
1212
dependencies {
1313
classpath "com.android.tools.build:gradle:$gradle_version"
1414
classpath "com.github.ben-manes:gradle-versions-plugin:$gradle_versions_plugin_version"
15-
classpath "com.github.dcendents:android-maven-gradle-plugin:$maven_gradle_version"
16-
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$bintray_plugin_version"
1715

1816
// NOTE: Do not place your application dependencies here; they belong
1917
// in the individual module build.gradle files

examples/demoapp/build.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ buildscript {
1515

1616
//classpath dependencies to import library project
1717
classpath "com.github.ben-manes:gradle-versions-plugin:$gradle_versions_plugin_version"
18-
classpath "com.github.dcendents:android-maven-gradle-plugin:$maven_gradle_version"
19-
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$bintray_plugin_version"
2018

2119
// NOTE: Do not place your application dependencies here; they belong
2220
// in the individual module build.gradle files

examples/demoapp/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip

manifest.gradle

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
11
ext {
2+
mavRepoInternalUrl = System.getenv('LOCAL_MAVEN_URL')
3+
24
github_username = 'gotev'
35
github_repository_name = 'android-speech'
46

57
maintainer = 'Aleksandar Gotev'
68

7-
library_description = 'Android speech recognition and text to speech made easy'
8-
library_keywords = ['android', 'speech', 'library', 'text', 'voice', 'recognition', 'text to speech']
99
library_licenses = ["Apache-2.0"]
1010
library_licenses_url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
1111
library_project_group = 'net.gotev'
12-
library_version = '1.6.1'
13-
version_code = 1
12+
library_version = '1.6.2'
13+
version_code = 2
1414
min_sdk = 18
1515
target_sdk = 30
1616
demo_app_id = 'net.gotev.speechdemo'
1717

1818
// Gradle classpath dependencies versions
19-
kotlin_version = '1.3.10'
20-
gradle_version = '4.0.0'
21-
maven_gradle_version = '2.1'
22-
gradle_versions_plugin_version = '0.20.0'
23-
bintray_plugin_version = '1.7'
19+
kotlin_version = '1.4.10'
20+
gradle_version = '4.1.3'
21+
gradle_versions_plugin_version = '0.28.0'
2422

2523
// Library and app testing dependencies versions
2624
junit_version = '4.12'

release

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,28 @@
11
#!/bin/bash -e
22

3-
cd examples/demoapp
4-
./gradlew clean assembleDebug
5-
cp app/build/outputs/apk/debug/app-debug.apk ../../speech-demo-debug.apk
6-
cd ../..
3+
if [ "x$1" == "xlocal" ]
4+
then
5+
echo "Local release..."
6+
export LOCAL_MAVEN_URL="file://$(pwd)/releases"
7+
mkdir -p releases
8+
./gradlew clean test publish -PmavPublishToInternalRepo=true
9+
version=$(cat manifest.gradle | grep library_version | awk '{print $3}' | tr "'" "\n" | head -n 2 | tail -n 1)
10+
echo "released local version $version"
11+
else
12+
echo "Releasing on Maven Central ..."
13+
./gradlew clean test publish -PmavSigning=true -PmavPublishToRemoteRepo=true --max-workers 1
714

8-
./gradlew :speech:clean :speech:bintrayUpload
15+
echo "Generating Demo Apk ..."
16+
cd examples/demoapp
17+
./gradlew clean assembleDebug
18+
cp app/build/outputs/apk/debug/app-debug.apk ../../speech-demo-debug.apk
19+
cd ../..
920

10-
version=$(cat manifest.gradle | grep "library_version" | tr "'" '\n' | head -n 2 | tail -n 1)
11-
hub release create -a speech-demo-debug.apk -m "$version" "$version"
21+
echo "Creating GitHub Release ..."
22+
version=$(cat manifest.gradle | grep "library_version" | tr "'" '\n' | head -n 2 | tail -n 1)
23+
hub release create -a speech-demo-debug.apk -m "$version" "$version"
24+
25+
echo
26+
echo "Done!"
27+
echo "Visit https://oss.sonatype.org/#stagingRepositories and confirm the release"
28+
fi

speech/build.gradle

Lines changed: 11 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
apply plugin: 'com.android.library'
2-
apply plugin: 'com.github.dcendents.android-maven'
3-
apply plugin: 'com.jfrog.bintray'
42
apply plugin: 'com.github.ben-manes.versions'
53

64
// start - do not modify this if your project is on github
7-
def siteUrl = "https://github.com/${github_username}/${github_repository_name}"
8-
def gitUrl = siteUrl + '.git'
9-
def bugTrackerUrl = siteUrl + '/issues/'
10-
def projectName = github_repository_name
5+
project.ext {
6+
mavDevelopers = [(github_username): (maintainer)]
7+
mavSiteUrl = "https://github.com/${github_username}/${github_repository_name}"
8+
mavGitUrl = mavSiteUrl + '.git'
9+
bugTrackerUrl = mavSiteUrl + '/issues/'
10+
mavProjectName = "speech"
11+
mavLibraryLicenses = ["Apache-2.0": 'http://www.apache.org/licenses/LICENSE-2.0.txt']
12+
mavLibraryDescription = "Android speech recognition and text to speech made easy"
13+
mavVersion = library_version
14+
}
1115
// end - do not modify this if your project is on github
1216

1317
group = library_project_group
@@ -61,99 +65,4 @@ dependencies {
6165
androidTestImplementation "androidx.test.espresso:espresso-core:$androidx_test_espresso_version"
6266
}
6367

64-
// add the following information to the file: local.properties situated in the parent directory of
65-
// where this file is:
66-
//
67-
// bintray.user=gotev
68-
// bintray.apikey=api key got from the bintray profile
69-
//
70-
// be sure to add local.properties to the .gitignore!
71-
72-
Properties properties = new Properties()
73-
if (project.rootProject.file("local.properties").exists()) {
74-
properties.load(project.rootProject.file('local.properties').newDataInputStream())
75-
}
76-
77-
install {
78-
repositories.mavenInstaller {
79-
pom.project {
80-
name projectName
81-
description library_description
82-
packaging 'aar'
83-
groupId library_project_group
84-
version version
85-
url siteUrl
86-
licenses {
87-
license {
88-
name library_licenses[0]
89-
url library_licenses_url
90-
}
91-
}
92-
developers {
93-
developer {
94-
id properties.getProperty("bintray.user")
95-
name maintainer
96-
}
97-
}
98-
scm {
99-
connection gitUrl
100-
developerConnection gitUrl
101-
url siteUrl
102-
103-
}
104-
}
105-
}
106-
}
107-
108-
bintray {
109-
user = properties.getProperty("bintray.user")
110-
key = properties.getProperty("bintray.apikey")
111-
configurations = ['archives']
112-
pkg {
113-
repo = "maven"
114-
name = projectName
115-
desc = library_description
116-
websiteUrl = siteUrl
117-
vcsUrl = gitUrl
118-
issueTrackerUrl = bugTrackerUrl
119-
licenses = library_licenses
120-
labels = library_keywords
121-
publicDownloadNumbers = true
122-
publish = true
123-
}
124-
}
125-
126-
task sourcesJar(type: Jar) {
127-
from android.sourceSets.main.java.srcDirs
128-
classifier = 'sources'
129-
}
130-
131-
task javadoc(type: Javadoc) {
132-
excludes = ['**/*.kt'] // < ---- Exclude all kotlin files from javadoc file.
133-
134-
title = "$projectName $project.version API"
135-
description "Generates Javadoc"
136-
source = android.sourceSets.main.java.srcDirs
137-
classpath += files(android.bootClasspath)
138-
exclude '**/BuildConfig.java', '**/R.java'
139-
options {
140-
windowTitle("$projectName $project.version Reference")
141-
locale = 'en_US'
142-
encoding = 'UTF-8'
143-
charSet = 'UTF-8'
144-
links("http://docs.oracle.com/javase/7/docs/api/");
145-
linksOffline("http://d.android.com/reference", "${android.sdkDirectory}/docs/reference");
146-
setMemberLevel(JavadocMemberLevel.PUBLIC)
147-
addStringOption('Xdoclint:none', '-quiet')
148-
}
149-
}
150-
151-
task javadocJar(type: Jar, dependsOn: javadoc) {
152-
classifier = 'javadoc'
153-
from javadoc.destinationDir
154-
}
155-
156-
artifacts {
157-
archives javadocJar
158-
archives sourcesJar
159-
}
68+
apply from: 'https://raw.githubusercontent.com/sky-uk/gradle-maven-plugin/master/gradle-mavenizer.gradle'

speech/src/main/java/net/gotev/speech/Speech.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,8 @@ public void onReceive(Context context, Intent intent) {
378378

379379
/**
380380
* Gets the list of the supported Text to Speech languages on this device
381-
* @return list of locales on android API >= 23 and empty list on lower Android, because native
382-
* TTS engine does not support querying voices on API < 23. Officially it's declared that
381+
* @return list of locales on android API 23 and newer and empty list on lower Android, because native
382+
* TTS engine does not support querying voices on API lower than 23. Officially it's declared that
383383
* query voices support started on API 21, but in reality it started from 23.
384384
* If still skeptic about this, search the web and try on your own.
385385
*/
@@ -397,8 +397,8 @@ public Locale getSpeechToTextLanguage() {
397397

398398
/**
399399
* Gets the current voice used for text to speech.
400-
* @return current voice on android API >= 23 and null on lower Android, because native
401-
* TTS engine does not support querying voices on API < 23. Officially it's declared that
400+
* @return current voice on android API 23 or newer and null on lower Android, because native
401+
* TTS engine does not support querying voices on API lower than 23. Officially it's declared that
402402
* query voices support started on API 21, but in reality it started from 23.
403403
* If still skeptic about this, search the web and try on your own.
404404
*/

0 commit comments

Comments
 (0)