Commit 4cb825a2 authored by Benoit Marty's avatar Benoit Marty Committed by Benoît Marty
Browse files

Release the library on MavenCentral

Delete stuff added for Jitpack
parent a0759b61
Pipeline #10904 failed with stages
in 3 minutes
......@@ -120,8 +120,7 @@ endorsed by the Matrix.org Foundation C.I.C.
## Release process
First: bump version numbers in ``common.mk``, ``CMakeLists.txt``,
``javascript/package.json``, ``python/olm/__version__.py``, ``OLMKit.podspec``, ``Package.swift``,
and ``android/olm-sdk/src/main/java/org/matrix/olm/OlmManager.java`` in function ``getVersion()```.
``javascript/package.json``, ``python/olm/__version__.py``, ``OLMKit.podspec``, ``Package.swift`` and ``android/gradle.properties``.
Also, ensure the changelog is up to date, and that everything is committed to
git.
......@@ -161,6 +160,14 @@ Python and JavaScript packages are published to the registry at
documentation contains instructions on how to set up twine (Python) and npm
(JavaScript) to upload to the registry.
To publish the Android library to MavenCentral (you will need some secrets), in the /android folder:
- Run the command `./gradlew clean publish --no-daemon --no-parallel --stacktrace`.
- Connect to https://s01.oss.sonatype.org
- Click on Staging Repositories and check the the files have been uploaded
- Click on close
- Wait (check Activity tab until step "Repository closed" is displayed)
- Click on release. The staging repository will disappear
- Check that the release is available in https://repo1.maven.org/maven2/org/matrix/android/olm/ (it can take a few minutes)
## Design
......
......@@ -5,20 +5,16 @@ OlmLibSdk exposes an android wrapper to libolm.
Installation
------------
Create a libs directory in your project directory
Copy the olm-sdk.aar into it.
In your build.gradle file, add in the android section::
Android Olm library is released on MavenCentral.
repositories {
flatDir {
dir 'libs'
}
}
Add this dependency to your project:
Add in the dependencies category::
```groovy
implementation "org.matrix.android:olm:3.2.4"
```
compile(name: 'olm-sdk', ext: 'aar')
Latest version: ![Latest version](https://img.shields.io/maven-central/v/org.matrix.android/olm)
Development
-----------
......
......@@ -9,7 +9,7 @@ buildscript {
// Release notes of Android Gradle Plugin (AGP):
// https://developer.android.com/studio/releases/gradle-plugin
classpath 'com.android.tools.build:gradle:7.0.2'
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.17.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
......@@ -20,6 +20,14 @@ allprojects {
mavenCentral()
google()
}
plugins.withId("com.vanniktech.maven.publish") {
// Publish on s01.oss.sonatype.org
//https://github.com/vanniktech/gradle-maven-publish-plugin#where-to-upload-to
mavenPublish {
sonatypeHost = "S01"
}
}
}
task clean(type: Delete) {
......
......@@ -21,3 +21,29 @@
android.useAndroidX=true
org.gradle.configureondemand=false
# Maven publication
# Ref: https://github.com/vanniktech/gradle-maven-publish-plugin
GROUP=org.matrix.android
POM_ARTIFACT_ID=olm
VERSION_NAME=3.2.4
POM_PACKAGING=aar
POM_NAME=Olm Android wrapper
POM_DESCRIPTION=An Android wrapper to libolm.
POM_INCEPTION_YEAR=2021
POM_URL=https://gitlab.matrix.org/matrix-org/olm
POM_LICENSE_NAME=The Apache Software License, Version 2.0
POM_LICENCE_URL=https://www.apache.org/licenses/LICENSE-2.0.txt
POM_LICENCE_DIST=repo
POM_SCM_URL=https://gitlab.matrix.org/matrix-org/olm
POM_SCM_CONNECTION=scm:git:git://gitlab.matrix.org/matrix-org/olm.git
POM_SCM_DEV_CONNECTION=scm:git:ssh://git@gitlab.matrix.org/matrix-org/olm.git
POM_DEVELOPER_ID=matrixdev
POM_DEVELOPER_NAME=matrixdev
POM_DEVELOPER_URL=https://gitlab.matrix.org/matrix-org
POM_DEVELOPER_EMAIL=android@element.io
install:
- ./gradlew :olm-sdk:build :olm-sdk:publishToMavenLocal -x :olm-sdk:test
- find . -name "*.aar"
\ No newline at end of file
import org.apache.tools.ant.taskdefs.condition.Os
apply plugin: 'com.android.library'
apply plugin: 'maven-publish'
apply plugin: "com.vanniktech.maven.publish"
android {
compileSdk 30
......@@ -11,6 +11,8 @@ android {
targetSdk 30
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
buildConfigField "String", "OLM_VERSION", "\"${project.getProperties().getOrDefault("VERSION_NAME", "0.0.0")}\""
// The following argument makes the Android Test Orchestrator run its
// "pm clear" command after each test invocation. This command ensures
// that the app's state is completely cleared between tests.
......@@ -134,13 +136,3 @@ dependencies {
androidTestImplementation 'androidx.test:rules:1.4.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
}
project.afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.release
}
}
}
}
......@@ -46,7 +46,7 @@ public class OlmManager {
* @return the library version
*/
public String getVersion() {
return "3.2.4";
return BuildConfig.OLM_VERSION;
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment