Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish source and Javadoc JARs #679

Merged
merged 1 commit into from
Jul 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@ Changes that are currently in development and have not been released yet.

_Code:_

- **Android**

- AndroidThemis is now available on JCenter ([#679](https://github.com/cossacklabs/themis/pull/679)).

- **Go**

- Fixed panics on 32-bit systems when processing corrupted data ([#677](https://github.com/cossacklabs/themis/pull/677)).

_Infrastructure:_

- Improved package split making `libthemis` thinner ([#678](https://github.com/cossacklabs/themis/pull/678)).
- AndroidThemis is now available on JCenter ([#679](https://github.com/cossacklabs/themis/pull/679)).

## [0.13.0](https://github.com/cossacklabs/themis/releases/tag/0.13.0), July 8th 2020

Expand Down
43 changes: 41 additions & 2 deletions src/wrappers/themis/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,15 @@ android {

// publishing and bitray upload tasks should not run for ':boringssl' project
tasks.whenTaskAdded { task ->
println "executing $task ..."
if (task.name != 'bintrayUpload' && task.name != 'publishProductionPublicationToMavenLocal' && task.name != 'generatePomFileForProductionPublication') {
def excludeBoringSSL = [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is smart! 👍

'bintrayUpload',
'publishProductionPublicationToMavenLocal',
'generatePomFileForProductionPublication',
'generateSourceJar',
'generateJavadoc',
'generateJavadocJar',
]
if (!excludeBoringSSL.contains(task.name)) {
task.dependsOn(':boringssl:' + task.name)
}
}
Expand All @@ -94,6 +101,36 @@ android {
}
}

// Publishing on JCenter requires packages with Java source code and Javadocs.
// Note that "archiveClassifier" values are important for JCenter.

task generateSourceJar(type: Jar) {
description = 'Assembles a JAR with Java source code'
archiveClassifier = 'sources'
from android.sourceSets.main.java.srcDirs
}

task generateJavadoc(type: Javadoc) {
description = 'Generates Javadocs from the source code'
source = android.sourceSets.main.java.srcDirs
title = 'Themis API Reference'
// Javadoc chokes on non-Java files so exclude non-sources from the source dir.
excludes = ['build', 'build.gradle']
// Add Android core system and all dependencies to classpath so that Javadoc
// finds their classes and links to them correctly.
classpath += files(android.bootClasspath)
android.libraryVariants.all { variant ->
classpath += variant.javaCompile.classpath
}
}

task generateJavadocJar(type: Jar) {
description = 'Assembles a JAR with Javadocs'
archiveClassifier = 'javadoc'
from generateJavadoc.destinationDir
dependsOn 'generateJavadoc'
}

// distribution

apply plugin: 'com.jfrog.bintray'
Expand All @@ -103,6 +140,8 @@ publishing {
publications {
Production(MavenPublication) {
artifact("build/outputs/aar/android.aar")
artifact generateSourceJar
artifact generateJavadocJar
groupId 'com.cossacklabs.com'
artifactId 'themis'
version androidThemisVersion
Expand Down