mirror of
https://github.com/kiwix/java-libkiwix.git
synced 2025-08-03 11:06:15 -04:00

* Upgraded the gradle to support the Android 14. * Made the changes in code to adapt the new gradle. * Rectify the deprecated code that are not working in new version of gradle.
83 lines
2.2 KiB
Groovy
83 lines
2.2 KiB
Groovy
apply plugin: 'maven-publish'
|
|
apply plugin: 'signing'
|
|
|
|
tasks.register('androidSourcesJar', Jar) {
|
|
archiveClassifier.set('sources')
|
|
if (project.plugins.findPlugin("com.android.library")) {
|
|
// For Android libraries
|
|
from android.sourceSets.main.java.srcDirs
|
|
from android.sourceSets.main.kotlin.srcDirs
|
|
} else {
|
|
// For pure Kotlin libraries, in case you have them
|
|
from sourceSets.main.java.srcDirs
|
|
from sourceSets.main.kotlin.srcDirs
|
|
}
|
|
}
|
|
|
|
artifacts {
|
|
archives androidSourcesJar
|
|
}
|
|
|
|
def siteUrl = 'https://www.kiwix.org/en/'
|
|
def gitUrl = 'https://github.com/kiwix/libkiwix.git'
|
|
|
|
group = GROUP_ID
|
|
version = VERSION
|
|
|
|
afterEvaluate {
|
|
publishing {
|
|
publications {
|
|
release(MavenPublication) {
|
|
|
|
groupId GROUP_ID
|
|
artifactId ARTIFACT_ID
|
|
version VERSION
|
|
|
|
from components.release
|
|
|
|
artifact androidSourcesJar
|
|
pom {
|
|
name = ARTIFACT_ID
|
|
description = 'LibKiwix Android library'
|
|
url = siteUrl
|
|
licenses {
|
|
license {
|
|
name = 'GPLv3'
|
|
url = 'https://www.gnu.org/licenses/gpl-3.0.en.html'
|
|
}
|
|
}
|
|
developers {
|
|
developer {
|
|
id = 'kiwix'
|
|
name = 'kiwix'
|
|
email = 'contact@kiwix.org'
|
|
}
|
|
}
|
|
scm {
|
|
connection = gitUrl
|
|
developerConnection = gitUrl
|
|
url = siteUrl
|
|
}
|
|
}
|
|
}
|
|
}
|
|
repositories {
|
|
maven {
|
|
url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
|
|
credentials {
|
|
username = ossrhUsername
|
|
password = ossrhPassword
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
signing {
|
|
useInMemoryPgpKeys(
|
|
keyId,
|
|
key,
|
|
password,
|
|
)
|
|
sign publishing.publications
|
|
} |