Update gradle wrapper and build tools

BuildConfig.VERSION_NAME is not available anymore when building library
Also replace JCenter by MavenCentral
This commit is contained in:
Benoit Marty 2021-04-16 17:43:30 +02:00 committed by Benoit Marty
parent dbbf467075
commit 4d2522a65c
8 changed files with 26 additions and 38 deletions

View file

@ -120,8 +120,7 @@ endorsed by the Matrix.org Foundation C.I.C.
First: bump version numbers in ``common.mk``, ``CMakeLists.txt``,
``javascript/package.json``, ``python/olm/__version__.py``, ``OLMKit.podspec``, ``Package.swift``,
and ``android/olm-sdk/build.gradle`` (``versionCode``, ``versionName`` and
``version``).
and ``android/olm-sdk/java/org/matrix/olm/OlmManager.java`` in function ``getVersion()```.
Also, ensure the changelog is up to date, and that everything is committed to
git.

View file

@ -24,6 +24,6 @@ Development
-----------
import the project from the ``android/`` path.
The project contains some JNI files and some Java wraper files.
The project contains some JNI files and some Java wrapper files.
The project contains some tests under AndroidTests package.

View file

@ -2,11 +2,11 @@
buildscript {
repositories {
jcenter()
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.android.tools.build:gradle:4.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
@ -15,7 +15,7 @@ buildscript {
allprojects {
repositories {
jcenter()
mavenCentral()
google()
}
}

View file

@ -1,6 +1,7 @@
#Thu Oct 13 09:38:01 CEST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-all.zip
distributionSha256Sum=81003f83b0056d20eedf48cddd4f52a9813163d4ba185bcf8abd34b8eeea4cbd
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip

View file

@ -3,14 +3,11 @@ import org.apache.tools.ant.taskdefs.condition.Os
apply plugin: 'com.android.library'
android {
compileSdkVersion 28
compileSdkVersion 30
defaultConfig {
minSdkVersion 11
targetSdkVersion 28
versionCode 322
versionName "3.2.2"
version "3.2.2"
targetSdkVersion 30
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
@ -34,7 +31,7 @@ android {
jni.srcDirs = []
}
task buildJavaDoc(type: Javadoc) {
task buildJavaDoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
destinationDir = file("./doc/")
@ -60,14 +57,15 @@ android {
}
tasks.withType(JavaCompile) {
compileTask -> if (compileTask.name.startsWith('compileDebugJava')) {
println 'test compile: Debug'
compileTask.dependsOn ndkBuildNativeDebug
} else if (compileTask.name.startsWith('compileReleaseJava')) {
println 'test compile: Release'
compileTask.dependsOn ndkBuildNativeRelease
}
compileTask.dependsOn buildJavaDoc
compileTask ->
if (compileTask.name.startsWith('compileDebugJava')) {
println 'test compile: Debug'
compileTask.dependsOn ndkBuildNativeDebug
} else if (compileTask.name.startsWith('compileReleaseJava')) {
println 'test compile: Release'
compileTask.dependsOn ndkBuildNativeRelease
}
compileTask.dependsOn buildJavaDoc
}
clean.dependsOn cleanNative
@ -117,9 +115,9 @@ def gitRevisionDate() {
}
dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support:support-annotations:28.0.0'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test:rules:1.0.2'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test:rules:1.3.0'
}

View file

@ -1,8 +1 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.matrix.olm">
<application
android:allowBackup="true"
android:label="@string/app_name">
</application>
</manifest>
<manifest package="org.matrix.olm" />

View file

@ -46,7 +46,7 @@ public class OlmManager {
* @return the library version
*/
public String getVersion() {
return BuildConfig.VERSION_NAME;
return "3.2.2";
}
/**

View file

@ -1,3 +0,0 @@
<resources>
<string name="app_name">OlmSdk</string>
</resources>