Panagiotis Triantafyllou

new gradle fixes

......@@ -32,13 +32,12 @@ afterEvaluate {
// Two artifacts, the `aar` (or `jar`) and the sources
if (project.plugins.findPlugin("com.android.library")) {
// from components.release
from components.findByName('release')
from(project.components.findByName("release"))
} else {
from components.java
}
artifact androidSourcesJar
// Sources are now handled by the android block's singleVariant
// artifact javadocJar
// Mostly self-explanatory metadata
......
apply plugin: 'com.android.library'
apply plugin: 'maven-publish'
android.buildFeatures.buildConfig = true
ext {
PUBLISH_GROUP_ID = 'ly.warp'
PUBLISH_VERSION = '4.5.5.4r45'
PUBLISH_VERSION = '4.5.5.4r46'
PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
}
......@@ -14,6 +17,14 @@ android {
useLibrary 'org.apache.http.legacy'
publishing {
// Configure all components to be published
singleVariant('release') {
// Publish the release variant with sources
withSourcesJar()
}
}
defaultConfig {
minSdkVersion 23
targetSdkVersion 34
......@@ -102,12 +113,17 @@ dependencies {
}
// In every export please update the version number
task deleteJarLibrary(type: Delete) {
tasks.register('deleteJarLibrary', Delete) {
delete 'jar/warply_android_sdk_v4.5.0.jar'
}
task createJarLibrary(type: Jar, dependsOn: 'assembleRelease') {
from fileTree('build/intermediates/bundles/release/')
tasks.register('createJarLibrary', Jar) {
dependsOn('assembleRelease')
from(fileTree('build/intermediates/aar/release/'))
destinationDirectory = file('jar')
archiveFileName = "warply_android_sdk_v${PUBLISH_VERSION}.jar"
}
createJarLibrary.dependsOn(deleteJarLibrary, build)
tasks.named('createJarLibrary') {
dependsOn('deleteJarLibrary', 'build')
}
......