Skip to content

Commit

Permalink
MBX-3117: Upgrade gradle to 8.7
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeysozinov authored Oct 22, 2024
1 parent 7851bf6 commit b0b9a3c
Show file tree
Hide file tree
Showing 17 changed files with 57 additions and 42 deletions.
3 changes: 0 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
Expand All @@ -8,8 +7,6 @@ buildscript {
}
dependencies {
classpath libs.bundles.buildscript.plugins
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

Expand Down
10 changes: 7 additions & 3 deletions example/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ android {
targetSdk 34
versionCode 1
versionName "1.0"
multiDexEnabled true
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '1.8'
jvmTarget = '17'
}
viewBinding {
enabled = true
Expand Down Expand Up @@ -63,4 +64,7 @@ dependencies {
implementation 'com.github.bumptech.glide:glide:4.15.1'
implementation 'androidx.activity:activity-ktx:1.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.15.1'

// Multidex
implementation "androidx.multidex:multidex:2.0.1"
}
6 changes: 3 additions & 3 deletions example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ buildscript {
maven { url 'https://developer.huawei.com/repo/' }
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.0'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.30'
classpath 'com.android.tools.build:gradle:8.6.0'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.22'
classpath 'com.google.gms:google-services:4.4.0'
classpath 'com.huawei.agconnect:agcp:1.9.1.300'
}
}


plugins {
id 'com.android.application' version '8.2.1' apply false
id 'com.android.application' version '8.6.0' apply false
id 'org.jetbrains.kotlin.android' version '1.9.22' apply false
id 'com.google.gms.google-services' version '4.4.0' apply false
}
2 changes: 1 addition & 1 deletion example/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Jan 19 10:44:26 MSK 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
# SDK version property
SDK_VERSION_NAME=2.11.1
SDK_VERSION_NAME=2.11.1
android.nonTransitiveRClass = false
16 changes: 8 additions & 8 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ target_sdk = "34"

firebase_bom = "32.7.2"
hms_push = "6.11.0.300"
room = "2.5.1"
kotlin = "1.8.21"
gradle_plugin = "7.4.2"
room = "2.6.1"
kotlin = "1.9.22"
gradle_plugin = "8.6.0"
gms_play_services_basement = "18.1.0"
gms_play_services_base = "18.0.1"
gms_play_services_ads_identifier = "18.0.1"
Expand All @@ -34,17 +34,17 @@ test_core = "1.5.0"
turbine = "0.12.1"

agcp = "1.6.0.300"
maven_plugin = "2.1"
ktlint-plugin = "12.1.1"
ksp = "1.9.22-1.0.17"

[bundles]
buildscript-plugins = [
"android_tools_build_gradle",
"kotlin_gradle_plugin",
"google_services",
"maven_plugin",
"agcp",
"ktlint_gradle_plugin"
"ktlint_gradle_plugin",
"ksp_gradle_plugin"
]

test = [
Expand Down Expand Up @@ -103,6 +103,6 @@ kotlinx_coroutines_test = { group = "org.jetbrains.kotlinx", name = "kotlinx-cor
android_tools_build_gradle = { module = "com.android.tools.build:gradle", version.ref = "gradle_plugin" }
kotlin_gradle_plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
google_services = { module = "com.google.gms:google-services", version.ref = "google_services" }
maven_plugin = { module = "com.github.dcendents:android-maven-gradle-plugin", version.ref = "maven_plugin" }
agcp = { module = "com.huawei.agconnect:agcp", version.ref = "agcp" }
ktlint_gradle_plugin = { module = "org.jlleitschuh.gradle:ktlint-gradle", version.ref = "ktlint-plugin" }
ktlint_gradle_plugin = { module = "org.jlleitschuh.gradle:ktlint-gradle", version.ref = "ktlint-plugin" }
ksp_gradle_plugin = { module = "com.google.devtools.ksp:symbol-processing-gradle-plugin", version.ref = "ksp" }
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Nov 07 16:21:11 YEKT 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
6 changes: 6 additions & 0 deletions mindbox-firebase/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
apply from: "../modulesCommon.gradle"

android {
namespace 'cloud.mindbox.mindbox_firebase'

buildFeatures {
buildConfig = true
}

defaultConfig {
consumerProguardFiles "consumer-rules.pro",
"${rootProject.projectDir}/proguard/proguard-gson.pro",
Expand Down
3 changes: 1 addition & 2 deletions mindbox-firebase/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="cloud.mindbox.mindbox_firebase">

<manifest>
</manifest>
6 changes: 6 additions & 0 deletions mindbox-huawei/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
apply from: "../modulesCommon.gradle"

android {
namespace 'cloud.mindbox.mindbox_hms'

buildFeatures {
buildConfig = true
}

defaultConfig {
consumerProguardFiles "consumer-rules.pro",
"${rootProject.projectDir}/proguard/proguard-gson.pro",
Expand Down
3 changes: 1 addition & 2 deletions mindbox-huawei/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="cloud.mindbox.mindbox_hms">

<manifest>
</manifest>
14 changes: 6 additions & 8 deletions modulesCommon.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'signing'
apply plugin: 'maven-publish'
apply plugin: 'org.jlleitschuh.gradle.ktlint'
Expand Down Expand Up @@ -35,7 +34,6 @@ android {
}

compileOptions {

sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
Expand All @@ -44,20 +42,18 @@ android {
jvmTarget = '1.8'
}

task androidSourcesJar(type: Jar) {
archiveClassifier.set('sources')
from android.sourceSets.main.java.srcDirs
publishing {
singleVariant("release") {
withSourcesJar()
}
}

}

afterEvaluate {
apply plugin: 'maven-publish'
publishing {
publications {
release(MavenPublication) {
from components.release
artifact androidSourcesJar
groupId = 'cloud.mindbox'
artifactId = ARTIFACT_ID
version = SDK_VERSION_NAME
Expand All @@ -71,13 +67,15 @@ afterEvaluate {
url = 'https://github.com/mindbox-cloud/android-sdk/blob/master/LICENSE.md'
}
}

developers {
developer {
id = 'Mindbox'
name = 'Mindbox'
email = '[email protected]'
}
}

scm {
connection = 'scm:https://github.com/mindbox-cloud/android-sdk.git'
developerConnection = 'scm:git://github.com/mindbox-cloud/android-sdk.git'
Expand Down
11 changes: 9 additions & 2 deletions sdk/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
apply plugin: "java-platform"
apply from: "../modulesCommon.gradle"
apply plugin: 'com.google.devtools.ksp'


javaPlatform {
Expand All @@ -12,6 +13,12 @@ dependencies {
}
}
android {
namespace 'cloud.mindbox.mobile_sdk'

buildFeatures {
buildConfig = true
}

defaultConfig {
consumerProguardFiles "consumer-rules.pro",
"${rootProject.projectDir}/proguard/proguard-gson.pro",
Expand Down Expand Up @@ -53,7 +60,7 @@ dependencies {
// Database
implementation libs.room.runtime
implementation libs.room.ktx
kapt libs.room.compiler
ksp libs.room.compiler

// Work Manager
implementation libs.work.manager
Expand All @@ -64,7 +71,7 @@ dependencies {

// Glide
implementation libs.glide
kapt libs.glide.compiler
ksp libs.glide.compiler

// Test dependencies
testImplementation libs.bundles.test
Expand Down
3 changes: 1 addition & 2 deletions sdk/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="cloud.mindbox.mobile_sdk">
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ internal abstract class MonitoringDatabase : RoomDatabase() {

companion object {
val MIGRATION_1_2 = object : Migration(1, 2) {
override fun migrate(database: SupportSQLiteDatabase) {
database.execSQL("DELETE FROM monitoring")
database.execSQL("ALTER TABLE monitoring RENAME TO mb_monitoring")
override fun migrate(db: SupportSQLiteDatabase) {
db.execSQL("DELETE FROM monitoring")
db.execSQL("ALTER TABLE monitoring RENAME TO mb_monitoring")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ internal abstract class MindboxDatabase : RoomDatabase() {

private val MIGRATION_1_2 = object : Migration(1, 2) {

override fun migrate(database: SupportSQLiteDatabase) {
override fun migrate(db: SupportSQLiteDatabase) {
val query = "ALTER TABLE $CONFIGURATION_TABLE_NAME " +
"ADD COLUMN shouldCreateCustomer INTEGER NOT NULL DEFAULT 1"
database.execSQL(query)
db.execSQL(query)
}
}

Expand Down
1 change: 0 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
include ':sdk'
include ':mindbox-huawei'
include ':mindbox-firebase'
include ':app'
rootProject.name = "AndroidSdk"

0 comments on commit b0b9a3c

Please sign in to comment.