Skip to content

Commit eb31ba1

Browse files
committed
Add release script
1 parent e886145 commit eb31ba1

File tree

4 files changed

+73
-31
lines changed

4 files changed

+73
-31
lines changed

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ buildscript {
1010
classpath 'com.android.tools.build:gradle:3.3.0-alpha11'
1111
classpath "com.github.ben-manes:gradle-versions-plugin:$benManes"
1212
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlins"
13+
classpath "org.jetbrains.dokka:dokka-android-gradle-plugin:$dokka"
1314
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$bintray"
1415
classpath "com.github.dcendents:android-maven-gradle-plugin:$maven"
1516
}

dependency.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ ext.with {
1515
espresso = '3.0.2'
1616

1717
kotlins = '1.2.70'
18+
dokka = '0.9.17'
1819

1920
bintray = '1.8.4'
2021
maven = '2.1'

ui/build.gradle

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,28 @@
11
apply plugin: 'com.android.library'
22
apply plugin: 'kotlin-android'
33
apply plugin: 'kotlin-android-extensions'
4+
apply plugin: 'maven'
5+
apply plugin: 'maven-publish'
6+
apply plugin: 'com.github.dcendents.android-maven'
7+
apply plugin: 'org.jetbrains.dokka-android'
8+
9+
ext {
10+
GROUP = 'com.algolia.instantsearch'
11+
BASENAME = 'voice-ui'
12+
CODENAME = "$GROUP:$BASENAME"
13+
NAME = 'InstantSearch Android Voice UI'
14+
DESC = "An overlay that gets your user’s voice permission and input as text in a customisable UI."
15+
LABELS = ["voice search", "voice input", "permissions", "voice UI"]
16+
17+
GITHUB = "algolia/voice-overlay-android"
18+
WEBSITE = "https://github.com/$GITHUB"
19+
REPO = WEBSITE + ".git"
20+
LICENSE = 'MIT'
21+
LICENSE_URL = "http://www.opensource.org/licenses/mit-license.php"
22+
23+
VERSION = '1.0.0-beta01'
24+
VERSION_DESC = "$NAME - v$VERSION"
25+
}
426

527
android {
628
compileSdkVersion sdkCompile
@@ -43,4 +65,36 @@ dependencies {
4365

4466
testImplementation dependency_jvm.kotlin_test
4567
testImplementation dependency_jvm.kotlin_test_junit
46-
}
68+
}
69+
70+
dokka {
71+
reportUndocumented = false
72+
outputFormat = 'html'
73+
outputDirectory = "$buildDir/javadoc"
74+
}
75+
76+
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
77+
kotlinOptions.freeCompilerArgs += ['-module-name', GROUP + "." + BASENAME]
78+
}
79+
80+
task sourcesJar(type: Jar) {
81+
dependsOn "assembleRelease"
82+
classifier "sources"
83+
from android.sourceSets.main.java.srcDirs
84+
}
85+
86+
task javadocJar(type: Jar, dependsOn: dokka) {
87+
classifier "javadoc"
88+
from "$buildDir/javadoc"
89+
}
90+
91+
// add sources jar tasks as artifacts
92+
artifacts {
93+
archives sourcesJar
94+
archives javadocJar
95+
archives file: new File("${project.buildDir}/outputs/aar/${project.name}-release.aar"),
96+
name: "${project.name}-release.aar",
97+
type: "aar"
98+
}
99+
100+
apply from: "https://raw.githubusercontent.com/algolia/instantsearch-mobile-tools/7b9e6e1cc28f12497b88b6868ab99d5884f7c86b/gradle/bintrayv.gradle"

voice/build.gradle

Lines changed: 16 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,23 @@ apply plugin: 'kotlin-android-extensions'
44
apply plugin: 'maven'
55
apply plugin: 'maven-publish'
66
apply plugin: 'com.github.dcendents.android-maven'
7+
apply plugin: 'org.jetbrains.dokka-android'
78

89
ext {
9-
GROUP = 'com.algolia.instantsearch-android'
10+
GROUP = 'com.algolia.instantsearch'
1011
BASENAME = 'voice'
1112
CODENAME = "$GROUP:$BASENAME"
1213
NAME = 'InstantSearch Android Voice'
13-
DESC = "Easily add Voice search to your Android apps"
14-
LABELS = ["voice search", "voice input", "permissions", "voice UI"]
14+
DESC = "A library that gets your user’s voice permission and input as text."
15+
LABELS = ["voice search", "voice input", "permissions"]
1516

1617
GITHUB = "algolia/voice-overlay-android"
1718
WEBSITE = "https://github.com/$GITHUB"
1819
REPO = WEBSITE + ".git"
1920
LICENSE = 'MIT'
2021
LICENSE_URL = "http://www.opensource.org/licenses/mit-license.php"
2122

22-
VERSION = '1.0.1'
23+
VERSION = '1.0.0-beta01'
2324
VERSION_DESC = "$NAME - v$VERSION"
2425
}
2526

@@ -49,12 +50,6 @@ android {
4950
}
5051
}
5152

52-
kotlin {
53-
experimental {
54-
coroutines 'enable'
55-
}
56-
}
57-
5853
dependencies {
5954
implementation dependency_jvm.kotlin_stdlib
6055

@@ -66,34 +61,25 @@ dependencies {
6661
testImplementation dependency_jvm.kotlin_test_junit
6762
}
6863

69-
apply plugin: 'maven'
70-
apply plugin: 'maven-publish'
71-
apply plugin: 'com.github.dcendents.android-maven'
64+
dokka {
65+
reportUndocumented = false
66+
outputFormat = 'html'
67+
outputDirectory = "$buildDir/javadoc"
68+
}
69+
70+
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
71+
kotlinOptions.freeCompilerArgs += ['-module-name', GROUP + "." + BASENAME]
72+
}
7273

7374
task sourcesJar(type: Jar) {
7475
dependsOn "assembleRelease"
7576
classifier "sources"
7677
from android.sourceSets.main.java.srcDirs
7778
}
7879

79-
task javadoc(type: Javadoc) {
80-
source = android.sourceSets.main.java.sourceFiles
81-
classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) // dependencies
82-
options.links("http://docs.oracle.com/javase/8/docs/api")
83-
options.linksOffline("http://d.android.com/reference", "$System.env.ANDROID_HOME/docs/reference")
84-
options.memberLevel = JavadocMemberLevel.PROTECTED
85-
}
86-
87-
afterEvaluate {
88-
// we need this as javadoc task's body is called before android.libraryVariants is filled. http://stackoverflow.com/a/34572606/3109189
89-
javadoc.classpath += files(android.libraryVariants.collect { variant ->
90-
variant.getJavaCompiler().classpath.files
91-
})
92-
}
93-
94-
task javadocJar(type: Jar, dependsOn: javadoc) {
95-
from javadoc.destinationDir
80+
task javadocJar(type: Jar, dependsOn: dokka) {
9681
classifier "javadoc"
82+
from "$buildDir/javadoc"
9783
}
9884

9985
// add sources jar tasks as artifacts

0 commit comments

Comments
 (0)