callbacks/maoni-doorbell/build.gradle
/*
* Copyright (c) 2016-2022 Armel Soro
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
apply plugin: 'com.android.library'
//apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'maven-publish'
apply plugin: 'signing'
final VERSION_NAME = maoni_version
final VERSION_CODE = VERSION_NAME.replace('.', '').toInteger()
group = maoni_group
version = VERSION_NAME
android {
compileSdkVersion 32
defaultConfig {
minSdkVersion 19
targetSdkVersion 32
versionCode VERSION_CODE
versionName VERSION_NAME
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
// checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
api project(':maoni-common')
implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.13.2'
//Retrofit
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.squareup.okhttp3:logging-interceptor:4.9.1'
//Needle (for task execution)
implementation 'com.zsoltsafrany:needle:1.0.0'
}
task generateSourcesJar(type: Jar) {
classifier 'sources'
}
task generateJavadocs(type: Javadoc) {
failOnError false
}
task generateJavadocsJar(type: Jar) {
from generateJavadocs.destinationDir
classifier 'javadoc'
}
generateJavadocsJar.dependsOn generateJavadocs
artifacts {
archives generateJavadocsJar
archives generateSourcesJar
}
publishing {
publications {
release(MavenPublication) {
// The coordinates of the library, being set from variables that
// we'll set up later
groupId maoni_group
artifactId 'maoni-doorbell'
version maoni_version
// Two artifacts, the `aar` (or `jar`) and the sources
if (project.plugins.findPlugin("com.android.library")) {
artifact("$buildDir/outputs/aar/${project.getName()}-release.aar")
} else {
artifact("$buildDir/libs/${project.getName()}-${version}.jar")
}
artifact generateSourcesJar
artifact generateJavadocsJar
// Mostly self-explanatory metadata
pom {
name = 'maoni-doorbell'
description = 'Handler for Maoni that sends user feedback to Doorbell.io'
url = 'https://github.com/rm3l/maoni/tree/master/callbacks/maoni-doorbell'
licenses {
license {
name = 'MIT License'
url = 'https://github.com/rm3l/maoni/blob/master/LICENSE'
}
}
developers {
developer {
id = 'rm3l'
name = 'Armel Soro'
email = 'armel@rm3l.org'
}
// Add all other devs here...
}
// Version control info - if you're using GitHub, follow the format as seen here
scm {
connection = 'scm:git@github.com:rm3l/maoni.git'
developerConnection = 'scm:git:ssh://github.com/rm3l/maoni.git'
url = 'https://github.com/rm3l/maoni/tree/master/callbacks/maoni-doorbell'
}
// A slightly hacky fix so that your POM will include any transitive dependencies
// that your library builds upon
withXml {
def dependenciesNode = asNode().appendNode('dependencies')
project.configurations.implementation.allDependencies.each {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}
}
}
}
}
// The repository to publish to, Sonatype/MavenCentral
repositories {
maven {
// This is an arbitrary name, you may also use "mavencentral" or
// any other name that's descriptive for you
name = "sonatype"
url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials {
username rootProject.ext.has('ossrhUsername') ? rootProject.ext.ossrhUsername : ''
password rootProject.ext.has('ossrhPassword') ? rootProject.ext.ossrhPassword : ''
}
}
}
}
signing {
sign publishing.publications
}