Skip to content

Commit 5e1521a

Browse files
committed
Upgrade build tools and target SDK 34
1 parent 6df2236 commit 5e1521a

File tree

6 files changed

+33
-24
lines changed

6 files changed

+33
-24
lines changed

app/build.gradle

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,21 @@ apply plugin: 'kotlin-kapt'
44

55
android {
66
namespace 'com.tughi.aggregator'
7-
8-
compileSdkVersion 33
7+
compileSdk 34
98

109
defaultConfig {
1110
applicationId 'com.tughi.aggregator'
1211

1312
minSdkVersion 21
14-
targetSdkVersion 33
13+
targetSdkVersion 34
1514

1615
versionName = 'Preview:034'
1716
versionCode = 299034
1817
}
1918

19+
buildFeatures {
20+
buildConfig true
21+
}
2022
buildTypes {
2123
debug {
2224
applicationIdSuffix ".debug"
@@ -30,19 +32,23 @@ android {
3032
}
3133
}
3234

33-
flavorDimensions 'store'
35+
flavorDimensions += 'store'
3436

3537
productFlavors {
36-
fdroid {
38+
create('fdroid') {
3739
dimension 'store'
3840
}
39-
google {
41+
create('google') {
4042
dimension 'store'
4143
applicationIdSuffix ".next"
4244
}
4345
}
44-
}
4546

47+
compileOptions {
48+
sourceCompatibility JavaVersion.VERSION_17
49+
targetCompatibility JavaVersion.VERSION_17
50+
}
51+
}
4652

4753
dependencies {
4854
implementation 'androidx.appcompat:appcompat:1.6.1'

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
xmlns:tools="http://schemas.android.com/tools"
44
tools:targetApi="m">
55

6+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
67
<uses-permission android:name="android.permission.INTERNET" />
78
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
89
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

app/src/main/java/com/tughi/aggregator/data/Database.kt

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,20 @@ object Database {
3030
db.enableWriteAheadLogging()
3131
}
3232

33-
override fun onCreate(database: SupportSQLiteDatabase) {
34-
executeScript(database, 0)
33+
override fun onCreate(db: SupportSQLiteDatabase) {
34+
executeScript(db, 0)
3535
}
3636

37-
override fun onUpgrade(database: SupportSQLiteDatabase, oldVersion: Int, newVersion: Int) {
38-
var databaseVersion = database.version
37+
override fun onUpgrade(db: SupportSQLiteDatabase, oldVersion: Int, newVersion: Int) {
38+
var databaseVersion = db.version
3939
while (databaseVersion != newVersion) {
40-
executeScript(database, databaseVersion)
40+
executeScript(db, databaseVersion)
4141

42-
databaseVersion = database.version
42+
databaseVersion = db.version
4343
}
4444
}
4545

46-
private fun executeScript(database: SupportSQLiteDatabase, version: Int) {
46+
private fun executeScript(db: SupportSQLiteDatabase, version: Int) {
4747
val scriptVersion = when {
4848
version > 99 -> version.toString()
4949
version > 9 -> "0$version"
@@ -78,23 +78,23 @@ object Database {
7878
}
7979
}
8080
} catch (exception: IOException) {
81-
dropDatabase(database, "Cannot upgrade database from version $version")
81+
dropDatabase(db, "Cannot upgrade database from version $version")
8282
}
8383

84-
database.transaction {
84+
db.transaction {
8585
for (statement in scriptStatements) {
86-
database.execSQL(statement)
86+
db.execSQL(statement)
8787
}
8888
}
8989
}
9090

91-
override fun onDowngrade(database: SupportSQLiteDatabase, oldVersion: Int, newVersion: Int) {
92-
dropDatabase(database, "Cannot downgrade from version $oldVersion to $newVersion")
91+
override fun onDowngrade(db: SupportSQLiteDatabase, oldVersion: Int, newVersion: Int) {
92+
dropDatabase(db, "Cannot downgrade from version $oldVersion to $newVersion")
9393
}
9494

95-
private fun dropDatabase(database: SupportSQLiteDatabase, message: String) {
95+
private fun dropDatabase(db: SupportSQLiteDatabase, message: String) {
9696
Log.e(javaClass.name, message)
97-
onCorruption(database)
97+
onCorruption(db)
9898
exitProcess(1)
9999
}
100100
})

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
}
88

99
dependencies {
10-
classpath 'com.android.tools.build:gradle:7.4.2'
10+
classpath 'com.android.tools.build:gradle:8.2.2'
1111
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.0"
1212

1313
// NOTE: Do not place your application dependencies here; they belong
@@ -22,6 +22,6 @@ allprojects {
2222
}
2323
}
2424

25-
task clean(type: Delete) {
25+
tasks.register('clean', Delete) {
2626
delete rootProject.buildDir
2727
}

gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ org.gradle.jvmargs=-Xmx1536m
1313
# org.gradle.parallel=true
1414

1515
android.useAndroidX=true
16+
android.nonTransitiveRClass=false
17+
android.nonFinalResIds=false
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Sat Aug 20 12:31:31 CEST 2022
22
distributionBase=GRADLE_USER_HOME
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
44
distributionPath=wrapper/dists
55
zipStorePath=wrapper/dists
66
zipStoreBase=GRADLE_USER_HOME

0 commit comments

Comments
 (0)