Release the library on MavenCentral
Delete stuff added for Jitpack
This commit is contained in:
parent
1c3af112c8
commit
23380ca331
6 changed files with 49 additions and 49 deletions
|
@ -167,6 +167,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.8"
|
||||
```
|
||||
|
||||
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.4'
|
||||
|
||||
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) {
|
||||
|
|
|
@ -22,6 +22,28 @@
|
|||
android.useAndroidX=true
|
||||
org.gradle.configureondemand=false
|
||||
|
||||
# Maven publication
|
||||
# Ref: https://github.com/vanniktech/gradle-maven-publish-plugin
|
||||
GROUP=org.matrix.android
|
||||
ARTIFACT_ID=olm
|
||||
POM_ARTIFACT_ID=olm
|
||||
VERSION_NAME=3.2.8
|
||||
|
||||
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
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
install:
|
||||
- ./gradlew :olm-sdk:build :olm-sdk:publishToMavenLocal -x :olm-sdk:test
|
||||
- find . -name "*.aar"
|
|
@ -1,8 +1,7 @@
|
|||
import org.apache.tools.ant.taskdefs.condition.Os
|
||||
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'maven-publish'
|
||||
apply plugin: 'signing'
|
||||
apply plugin: "com.vanniktech.maven.publish"
|
||||
|
||||
android {
|
||||
compileSdk 31
|
||||
|
@ -12,6 +11,8 @@ android {
|
|||
targetSdk 31
|
||||
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.
|
||||
|
@ -158,35 +159,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
|
||||
artifact androidJavadocsJar
|
||||
artifact androidSourcesJar
|
||||
groupId = project.getProperties().getOrDefault("GROUP", "org.matrix.android")
|
||||
artifactId = project.getProperties().getOrDefault("ARTIFACT_ID", "olm")
|
||||
version = project.getProperties().getOrDefault("VERSION_NAME", "0.0.0")
|
||||
}
|
||||
}
|
||||
repositories {
|
||||
maven {
|
||||
url "https://gitlab.matrix.org/api/v4/projects/27/packages/maven"
|
||||
credentials(HttpHeaderCredentials) {
|
||||
name = System.getenv("REPO_TOKEN_TYPE")
|
||||
value = System.getenv("REPO_TOKEN")
|
||||
}
|
||||
authentication {
|
||||
header(HttpHeaderAuthentication)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
signing {
|
||||
useGpgCmd()
|
||||
sign publishing.publications.release
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue