Clean up libsignal Gradle file

This commit is contained in:
Niels Andriesse 2021-05-18 13:13:25 +10:00
parent e75de841c9
commit caa1c77ed4

View File

@ -1,16 +1,8 @@
apply plugin: 'com.android.library' apply plugin: 'com.android.library'
apply plugin: 'maven' apply plugin: 'maven'
apply plugin: 'signing'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
archivesBaseName = "signal-service-android"
version = "1.0.0"
group = "org.session"
repositories { repositories {
mavenLocal()
google()
jcenter()
mavenCentral() mavenCentral()
} }
@ -18,31 +10,6 @@ configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds' resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
} }
android {
compileSdkVersion 30
buildToolsVersion '29.0.3'
defaultConfig {
minSdkVersion androidMinSdkVersion
targetSdkVersion androidCompileSdkVersion
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
libraryVariants.all { variant ->
variant.outputs.each { output ->
def outputFile = output.outputFile
if (outputFile != null && outputFile.name.endsWith('.aar')) {
def fileName = "${archivesBaseName}-${version}.aar"
output.outputFileName = fileName
}
}
}
}
dependencies { dependencies {
implementation "androidx.annotation:annotation:1.2.0" implementation "androidx.annotation:annotation:1.2.0"
implementation "com.google.protobuf:protobuf-java:$protobufVersion" implementation "com.google.protobuf:protobuf-java:$protobufVersion"
@ -57,78 +24,3 @@ dependencies {
testImplementation "org.assertj:assertj-core:1.7.1" testImplementation "org.assertj:assertj-core:1.7.1"
testImplementation "org.conscrypt:conscrypt-openjdk-uber:2.0.0" testImplementation "org.conscrypt:conscrypt-openjdk-uber:2.0.0"
} }
tasks.whenTaskAdded { task ->
if (task.name.equals("lint")) {
task.enabled = false
}
}
def isReleaseBuild() {
return version.contains("SNAPSHOT") == false
}
def getReleaseRepositoryUrl() {
return ""
}
def getRepositoryUsername() {
return ""
}
def getRepositoryPassword() {
return ""
}
signing {
required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
uploadArchives {
configuration = configurations.archives
repositories.mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: getReleaseRepositoryUrl()) {
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
}
pom.project {
name 'signal-service-android'
packaging 'aar'
description 'Signal service communication library for Android'
url 'https://github.com/loki-project/session-android-service'
scm {
url 'scm:git@github.com:loki-project/session-android-service.git'
connection 'scm:git@github.com:loki-project/session-android-service.git'
developerConnection 'scm:git@github.com:loki-project/session-android-service.git'
}
licenses {
license {
name 'GPLv3'
url 'https://www.gnu.org/licenses/gpl-3.0.txt'
distribution 'repo'
}
}
developers {
developer {
name 'Niels Andriesse'
}
}
}
}
}
task installArchives(type: Upload) {
description "Installs the artifacts to the local Maven repository."
configuration = configurations['archives']
repositories {
mavenDeployer {
repository url: "file://${System.properties['user.home']}/.m2/repository"
}
}
}