Panagiotis Triantafyllou

migrate to maven central, db fixes for android 15

1 apply plugin: 'com.android.library' 1 apply plugin: 'com.android.library'
2 +apply plugin: 'maven-publish'
3 +
4 +android.buildFeatures.buildConfig = true
2 5
3 ext { 6 ext {
4 PUBLISH_GROUP_ID = 'ly.warp' 7 PUBLISH_GROUP_ID = 'ly.warp'
5 - PUBLISH_VERSION = '4.5.5.4' 8 + PUBLISH_VERSION = '4.5.5.5'
6 PUBLISH_ARTIFACT_ID = 'warply-android-sdk' 9 PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
7 } 10 }
8 11
9 apply from: "${rootProject.projectDir}/scripts/publish-module.gradle" 12 apply from: "${rootProject.projectDir}/scripts/publish-module.gradle"
10 13
11 android { 14 android {
15 + compileSdkVersion 35
16 + buildToolsVersion "35.0.0"
17 +
18 + useLibrary 'org.apache.http.legacy'
12 19
13 - compileSdkVersion 33 20 + publishing {
14 - buildToolsVersion "33.0.2" 21 + // Configure all components to be published
22 + singleVariant('release') {
23 + // Publish the release variant with sources
24 + withSourcesJar()
25 + }
26 + }
15 27
16 defaultConfig { 28 defaultConfig {
17 minSdkVersion 23 29 minSdkVersion 23
18 - targetSdkVersion 33 30 + targetSdkVersion 35
19 consumerProguardFiles 'proguard-rules.pro' 31 consumerProguardFiles 'proguard-rules.pro'
32 + vectorDrawables.useSupportLibrary = true
20 } 33 }
21 splits { 34 splits {
22 abi { 35 abi {
...@@ -29,11 +42,13 @@ android { ...@@ -29,11 +42,13 @@ android {
29 lintOptions { 42 lintOptions {
30 abortOnError false 43 abortOnError false
31 } 44 }
45 +
32 sourceSets { 46 sourceSets {
33 main { 47 main {
34 jniLibs.srcDirs = ['src/main/jniLibs'] 48 jniLibs.srcDirs = ['src/main/jniLibs']
35 } 49 }
36 } 50 }
51 +
37 buildTypes { 52 buildTypes {
38 release { 53 release {
39 minifyEnabled false 54 minifyEnabled false
...@@ -41,7 +56,7 @@ android { ...@@ -41,7 +56,7 @@ android {
41 } 56 }
42 } 57 }
43 58
44 - useLibrary 'org.apache.http.legacy' 59 + namespace "ly.warp.sdk"
45 } 60 }
46 61
47 dependencies { 62 dependencies {
...@@ -75,39 +90,22 @@ dependencies { ...@@ -75,39 +90,22 @@ dependencies {
75 api 'com.huawei.hms:push:6.10.0.300' 90 api 'com.huawei.hms:push:6.10.0.300'
76 api 'com.huawei.hms:ads-identifier:3.4.62.300' 91 api 'com.huawei.hms:ads-identifier:3.4.62.300'
77 92
78 - //------------------------------ SQLCipher -----------------------------// 93 + //------------------------------ SQLite (Standard Android) -----------------------------//
79 - api 'net.zetetic:android-database-sqlcipher:4.5.2' 94 + api 'androidx.sqlite:sqlite:2.5.2'
80 - api 'androidx.sqlite:sqlite:2.3.1'
81 } 95 }
82 96
83 // In every export please update the version number 97 // In every export please update the version number
84 -task deleteJarLibrary(type: Delete) { 98 +tasks.register('deleteJarLibrary', Delete) {
85 delete 'jar/warply_android_sdk_v4.5.0.jar' 99 delete 'jar/warply_android_sdk_v4.5.0.jar'
86 } 100 }
87 101
88 -//from('build/intermediates/compile_library_classes/release/') 102 +tasks.register('createJarLibrary', Jar) {
89 - 103 + dependsOn('assembleRelease')
90 -//Old version 104 + from(fileTree('build/intermediates/aar/release/'))
91 -// Gradle Tasks -> warply_android_sdk -> Tasks -> other -> createJarLibrary 105 + destinationDirectory = file('jar')
92 -//task createJarLibrary(type: Copy) { 106 + archiveFileName = "warply_android_sdk_v${PUBLISH_VERSION}.jar"
93 -// from fileTree('build/intermediates/bundles/release/')
94 -// into('jar/')
95 -// include('classes.jar')
96 -// rename('classes.jar', 'warply_android_sdk_v4.4.2.jar')
97 -//}
98 -
99 -// New version
100 -// Gradle -> warplyDemo -> libraries -> warply_android_sdk -> Run Configurations -> assembleRelease
101 -// When finished it copies the .jar into
102 -// warply_android_sdk -> build -> intermediates -> full_jar -> release/debug -> full.jar
103 -
104 -// 24 - Jan - 2022
105 -// Gradle -> warplyDemo -> libraries -> warply_android_sdk -> Tasks -> build -> build
106 -// When finished it copies the .aar into
107 -// warply_android_sdk -> build -> outputs -> aar -> warply_android_sdk-release.aar
108 -
109 -task createJarLibrary(type: Jar, dependsOn: 'assembleRelease') {
110 - from fileTree('build/intermediates/bundles/release/')
111 } 107 }
112 108
113 -createJarLibrary.dependsOn(deleteJarLibrary, build) 109 +tasks.named('createJarLibrary') {
110 + dependsOn('deleteJarLibrary', 'build')
111 +}
......