Skip to content

Commit

Permalink
Update gradle plugin and improve gradle scan speed (#252)
Browse files Browse the repository at this point in the history
* Update gradle plugin

* Improve gradle scan speed

* Update github workflow

* Run dependencyGuardBaseline

* Fix lint errors

* Fix R8 issues temporarily

* Try to fix OOM error
  • Loading branch information
fornewid committed Dec 9, 2023
1 parent 3306969 commit 42f11cf
Show file tree
Hide file tree
Showing 14 changed files with 161 additions and 133 deletions.
1 change: 0 additions & 1 deletion .github/ci-gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

org.gradle.daemon=false
org.gradle.parallel=true
org.gradle.jvmargs=-Xmx6g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError
org.gradle.workers.max=2

kotlin.compiler.execution.strategy=in-process
9 changes: 5 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@ jobs:
timeout-minutes: 40

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties

- name: Set up JDK
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: 11
distribution: temurin
java-version: 17

- name: Build, lint and spotless
run: ./gradlew spotlessCheck dependencyGuard assemble lintDebug --scan
run: ./gradlew spotlessCheck dependencyGuard lintDebug assemble --scan
3 changes: 0 additions & 3 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@
-dontwarn org.jetbrains.annotations.**
-keep class kotlin.Metadata { *; }

# For dynamic-features module
-keep class soup.movie.theatermap.** { *; }

# For kotlinx.serialization
-keepattributes *Annotation*, InnerClasses
-dontnote kotlinx.serialization.SerializationKt
Expand Down
4 changes: 2 additions & 2 deletions build-logic/convention/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ plugins {
group = "soup.movie.buildlogic"

java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ fun Project.configureAndroid() {
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
fun Project.configureKotlin() {
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
jvmTarget = JavaVersion.VERSION_11.toString()

freeCompilerArgs = freeCompilerArgs + listOf(
"-opt-in=kotlin.RequiresOptIn",
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",

// https://github.com/Kotlin/kotlinx.serialization/issues/2145#issuecomment-1653091753
"-Xstring-concat=inline",
)
}
}
Expand Down
20 changes: 0 additions & 20 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
buildscript {
repositories {
google()
mavenCentral()

maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url "https://jitpack.io" }
}
dependencies {
classpath libs.android.pluginGradle
classpath libs.kotlin.pluginGradle
Expand All @@ -26,19 +19,6 @@ plugins {

apply from: "$rootDir/gradle/version.gradle"

allprojects {
repositories {
google()
mavenCentral()

maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url "https://jitpack.io" }
maven { url 'https://maven.google.com/' }
maven { url 'https://devrepo.kakao.com/nexus/content/groups/public/' }
maven { url 'https://naver.jfrog.io/artifactory/maven/' }
}
}

subprojects {
apply plugin: 'com.diffplug.spotless'
spotless {
Expand Down
139 changes: 71 additions & 68 deletions dependencies/classpath.txt
Original file line number Diff line number Diff line change
@@ -1,43 +1,46 @@
androidx.databinding:databinding-common:7.4.2
androidx.databinding:databinding-compiler-common:7.4.2
com.android.databinding:baseLibrary:7.4.2
com.android.tools.analytics-library:crash:30.4.2
com.android.tools.analytics-library:protos:30.4.2
com.android.tools.analytics-library:shared:30.4.2
com.android.tools.analytics-library:tracker:30.4.2
androidx.databinding:databinding-common:8.1.4
androidx.databinding:databinding-compiler-common:8.1.4
com.android.databinding:baseLibrary:8.1.4
com.android.tools.analytics-library:crash:31.1.4
com.android.tools.analytics-library:protos:31.1.4
com.android.tools.analytics-library:shared:31.1.4
com.android.tools.analytics-library:tracker:31.1.4
com.android.tools.build.jetifier:jetifier-core:1.0.0-beta10
com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta10
com.android.tools.build:aapt2-proto:7.4.2-8841542
com.android.tools.build:aaptcompiler:7.4.2
com.android.tools.build:apksig:7.4.2
com.android.tools.build:apkzlib:7.4.2
com.android.tools.build:builder-model:7.4.2
com.android.tools.build:builder-test-api:7.4.2
com.android.tools.build:builder:7.4.2
com.android.tools.build:bundletool:1.11.4
com.android.tools.build:gradle-api:7.4.2
com.android.tools.build:gradle-settings-api:7.4.2
com.android.tools.build:gradle:7.4.2
com.android.tools.build:manifest-merger:30.4.2
com.android.tools.build:aapt2-proto:8.1.4-10154469
com.android.tools.build:aaptcompiler:8.1.4
com.android.tools.build:apksig:8.1.4
com.android.tools.build:apkzlib:8.1.4
com.android.tools.build:builder-model:8.1.4
com.android.tools.build:builder-test-api:8.1.4
com.android.tools.build:builder:8.1.4
com.android.tools.build:bundletool:1.14.0
com.android.tools.build:gradle-api:8.1.4
com.android.tools.build:gradle-settings-api:8.1.4
com.android.tools.build:gradle:8.1.4
com.android.tools.build:manifest-merger:31.1.4
com.android.tools.build:transform-api:2.0.0-deprecated-use-gradle-api
com.android.tools.ddms:ddmlib:30.4.2
com.android.tools.layoutlib:layoutlib-api:30.4.2
com.android.tools.lint:lint-model:30.4.2
com.android.tools.lint:lint-typedef-remover:30.4.2
com.android.tools.utp:android-device-provider-ddmlib-proto:30.4.2
com.android.tools.utp:android-device-provider-gradle-proto:30.4.2
com.android.tools.utp:android-test-plugin-host-additional-test-output-proto:30.4.2
com.android.tools.utp:android-test-plugin-host-coverage-proto:30.4.2
com.android.tools.utp:android-test-plugin-host-retention-proto:30.4.2
com.android.tools.utp:android-test-plugin-result-listener-gradle-proto:30.4.2
com.android.tools:annotations:30.4.2
com.android.tools:common:30.4.2
com.android.tools:dvlib:30.4.2
com.android.tools:repository:30.4.2
com.android.tools:sdk-common:30.4.2
com.android.tools:sdklib:30.4.2
com.android:signflinger:7.4.2
com.android:zipflinger:7.4.2
com.android.tools.ddms:ddmlib:31.1.4
com.android.tools.layoutlib:layoutlib-api:31.1.4
com.android.tools.lint:lint-model:31.1.4
com.android.tools.lint:lint-typedef-remover:31.1.4
com.android.tools.utp:android-device-provider-ddmlib-proto:31.1.4
com.android.tools.utp:android-device-provider-gradle-proto:31.1.4
com.android.tools.utp:android-test-plugin-host-additional-test-output-proto:31.1.4
com.android.tools.utp:android-test-plugin-host-apk-installer-proto:31.1.4
com.android.tools.utp:android-test-plugin-host-coverage-proto:31.1.4
com.android.tools.utp:android-test-plugin-host-emulator-control-proto:31.1.4
com.android.tools.utp:android-test-plugin-host-logcat-proto:31.1.4
com.android.tools.utp:android-test-plugin-host-retention-proto:31.1.4
com.android.tools.utp:android-test-plugin-result-listener-gradle-proto:31.1.4
com.android.tools:annotations:31.1.4
com.android.tools:common:31.1.4
com.android.tools:dvlib:31.1.4
com.android.tools:repository:31.1.4
com.android.tools:sdk-common:31.1.4
com.android.tools:sdklib:31.1.4
com.android:signflinger:8.1.4
com.android:zipflinger:8.1.4
com.diffplug.durian:durian-collect:1.2.0
com.diffplug.durian:durian-core:1.2.0
com.diffplug.durian:durian-io:1.2.0
Expand All @@ -53,24 +56,24 @@ com.google.api.grpc:proto-google-common-protos:2.0.1
com.google.auto.value:auto-value-annotations:1.6.2
com.google.code.findbugs:jsr305:3.0.2
com.google.code.gson:gson:2.8.9
com.google.crypto.tink:tink:1.3.0-rc2
com.google.crypto.tink:tink:1.7.0
com.google.dagger:dagger:2.28.3
com.google.dagger:hilt-android-gradle-plugin:2.45
com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin:1.8.10-1.0.9
com.google.devtools.ksp:symbol-processing-gradle-plugin:1.8.10-1.0.9
com.google.errorprone:error_prone_annotations:2.4.0
com.google.errorprone:error_prone_annotations:2.11.0
com.google.firebase:firebase-crashlytics-buildtools:2.9.2
com.google.firebase:firebase-crashlytics-gradle:2.9.2
com.google.firebase:perf-plugin:1.4.2
com.google.flatbuffers:flatbuffers-java:1.12.0
com.google.gms:google-services:4.3.14
com.google.guava:failureaccess:1.0.1
com.google.guava:guava:30.1-jre
com.google.guava:guava:31.1-jre
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
com.google.j2objc:j2objc-annotations:1.3
com.google.jimfs:jimfs:1.1
com.google.protobuf:protobuf-java-util:3.17.2
com.google.protobuf:protobuf-java:3.17.2
com.google.protobuf:protobuf-java-util:3.19.3
com.google.protobuf:protobuf-java:3.19.3
com.google.testing.platform:core-proto:0.0.8-alpha08
com.googlecode.concurrent-trees:concurrent-trees:2.6.1
com.googlecode.javaewah:JavaEWAH:1.1.13
Expand All @@ -83,23 +86,24 @@ com.sun.xml.fastinfoset:FastInfoset:1.2.16
commons-codec:commons-codec:1.11
commons-io:commons-io:2.4
commons-logging:commons-logging:1.2
io.grpc:grpc-api:1.39.0
io.grpc:grpc-context:1.39.0
io.grpc:grpc-core:1.39.0
io.grpc:grpc-netty:1.39.0
io.grpc:grpc-protobuf-lite:1.39.0
io.grpc:grpc-protobuf:1.39.0
io.grpc:grpc-stub:1.39.0
io.netty:netty-buffer:4.1.52.Final
io.netty:netty-codec-http2:4.1.52.Final
io.netty:netty-codec-http:4.1.52.Final
io.netty:netty-codec-socks:4.1.52.Final
io.netty:netty-codec:4.1.52.Final
io.netty:netty-common:4.1.52.Final
io.netty:netty-handler-proxy:4.1.52.Final
io.netty:netty-handler:4.1.52.Final
io.netty:netty-resolver:4.1.52.Final
io.netty:netty-transport:4.1.52.Final
io.grpc:grpc-api:1.45.1
io.grpc:grpc-context:1.45.1
io.grpc:grpc-core:1.45.1
io.grpc:grpc-netty:1.45.1
io.grpc:grpc-protobuf-lite:1.45.1
io.grpc:grpc-protobuf:1.45.1
io.grpc:grpc-stub:1.45.1
io.netty:netty-buffer:4.1.72.Final
io.netty:netty-codec-http2:4.1.72.Final
io.netty:netty-codec-http:4.1.72.Final
io.netty:netty-codec-socks:4.1.72.Final
io.netty:netty-codec:4.1.72.Final
io.netty:netty-common:4.1.72.Final
io.netty:netty-handler-proxy:4.1.72.Final
io.netty:netty-handler:4.1.72.Final
io.netty:netty-resolver:4.1.72.Final
io.netty:netty-tcnative-classes:2.0.46.Final
io.netty:netty-transport:4.1.72.Final
io.perfmark:perfmark-api:0.23.0
jakarta.activation:jakarta.activation-api:1.2.1
jakarta.xml.bind:jakarta.xml.bind-api:2.3.2
Expand All @@ -109,14 +113,14 @@ net.java.dev.jna:jna-platform:5.6.0
net.java.dev.jna:jna:5.6.0
net.sf.jopt-simple:jopt-simple:4.9
net.sf.kxml:kxml2:2.3.0
org.apache.commons:commons-compress:1.20
org.apache.commons:commons-compress:1.21
org.apache.httpcomponents:httpclient:4.5.13
org.apache.httpcomponents:httpcore:4.4.13
org.apache.httpcomponents:httpcore:4.4.15
org.apache.httpcomponents:httpmime:4.5.6
org.bitbucket.b_c:jose4j:0.7.0
org.bouncycastle:bcpkix-jdk15on:1.67
org.bouncycastle:bcprov-jdk15on:1.67
org.checkerframework:checker-qual:3.5.0
org.checkerframework:checker-qual:3.12.0
org.codehaus.groovy:groovy-xml:3.0.10
org.codehaus.groovy:groovy:3.0.10
org.codehaus.mojo:animal-sniffer-annotations:1.19
Expand All @@ -141,22 +145,21 @@ org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.10
org.jetbrains.kotlin:kotlin-klib-commonizer-api:1.8.10
org.jetbrains.kotlin:kotlin-native-utils:1.8.10
org.jetbrains.kotlin:kotlin-project-model:1.8.10
org.jetbrains.kotlin:kotlin-reflect:1.7.10
org.jetbrains.kotlin:kotlin-reflect:1.8.20-RC2
org.jetbrains.kotlin:kotlin-scripting-common:1.8.10
org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.8.10
org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.8.10
org.jetbrains.kotlin:kotlin-scripting-jvm:1.8.10
org.jetbrains.kotlin:kotlin-serialization:1.8.10
org.jetbrains.kotlin:kotlin-stdlib-common:1.8.0
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.0
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0
org.jetbrains.kotlin:kotlin-stdlib:1.8.0
org.jetbrains.kotlin:kotlin-stdlib-common:1.8.20-RC2
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.20-RC2
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.20-RC2
org.jetbrains.kotlin:kotlin-stdlib:1.8.20-RC2
org.jetbrains.kotlin:kotlin-tooling-core:1.8.10
org.jetbrains.kotlin:kotlin-util-io:1.8.10
org.jetbrains.kotlin:kotlin-util-klib:1.8.10
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.5.0
org.jetbrains:annotations:13.0
org.json:json:20180813
org.jvnet.staxex:stax-ex:1.8.1
org.ow2.asm:asm-analysis:9.2
org.ow2.asm:asm-commons:9.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package soup.movie.feature.notification.impl

import android.app.PendingIntent
import android.content.Context
import android.os.Build
import dagger.hilt.android.qualifiers.ApplicationContext
import soup.movie.feature.navigator.AppNavigator
import soup.movie.feature.notification.ShowPushNotificationUseCase
Expand Down Expand Up @@ -64,7 +65,12 @@ class ShowPushNotificationUseCaseImpl @Inject constructor(

private fun createLauncherIntent(): PendingIntent {
val intent = navigator.createIntentToMain()
return PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_ONE_SHOT)
val flags = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
PendingIntent.FLAG_ONE_SHOT or PendingIntent.FLAG_MUTABLE
} else {
PendingIntent.FLAG_ONE_SHOT
}
return PendingIntent.getActivity(context, 0, intent, flags)
}

companion object {
Expand Down
12 changes: 8 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx3072m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC
# Ensure important default jvmargs aren't overwritten. See https://github.com/gradle/gradle/issues/19750
org.gradle.jvmargs=-Xmx6g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g

org.gradle.parallel=true
org.gradle.caching=true
org.gradle.configureondemand=true
Expand All @@ -21,16 +23,18 @@ org.gradle.configureondemand=true
android.useAndroidX=true
android.enableJetifier=true

# Allow data binding to be incremental
android.databinding.incremental=true

# Allow kapt to use workers, incremental processing
kapt.incremental.apt=true
kapt.include.compile.classpath=false

# Non-transitive R classes is recommended and is faster/smaller
android.nonTransitiveRClass=true

# Default values changed on AGP 8.0
# https://developer.android.com/build/releases/past-releases/agp-8-0-0-release-notes#default-changes
android.nonFinalResIds=false
android.enableR8.fullMode=false

# Default build features
android.defaults.buildfeatures.buildconfig=false
android.defaults.buildfeatures.aidl=false
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ dependencyGuard = "0.3.2"

[libraries]

android-pluginGradle = "com.android.tools.build:gradle:7.4.2"
android-pluginGradle = "com.android.tools.build:gradle:8.1.4"
android-desugar-jdk = "com.android.tools:desugar_jdk_libs:1.1.5"

# Kotlin
Expand Down
6 changes: 3 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Feb 03 22:21:10 KST 2023
#Sat Dec 09 01:37:26 KST 2023
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 42f11cf

Please sign in to comment.