Skip to content

Commit

Permalink
Update dependency com.android.tools.build:gradle from 7.4.2 to 8.0.0 …
Browse files Browse the repository at this point in the history
…(major v8) (#167)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Róbert Papp (TWiStErRob) <papp.robert.s@gmail.com>
  • Loading branch information
renovate[bot] and TWiStErRob committed Apr 14, 2023
1 parent eb41c13 commit 8db7c8d
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 16 deletions.
3 changes: 2 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ dependencies {

android {
defaultConfig {
applicationId 'net.twisterrob.colorfilters'
// Override autoNamespace to maintain the ID on the Google Play Store.
applicationId = "net.twisterrob.colorfilters"
}

/*
Expand Down
12 changes: 9 additions & 3 deletions config/lint/lint.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,16 @@
<issue id="InvalidPackage">

<!--
gradle/caches/modules-2/files-2.1/net.bytebuddy/byte-buddy/1.14.4/20498aaec9b00a5cfdb831e7bf68feafa833ce4b/byte-buddy-1.14.4.jar
Invalid package reference in library; not included in Android: `java.lang.instrument`. Referenced from `net.bytebuddy.agent.builder.AgentBuilder`.
gradle/caches/modules-2/files-2.1/net.bytebuddy/byte-buddy/1.14.4/20498aaec9b00a5cfdb831e7bf68feafa833ce4b/byte-buddy-1.14.4.jar:0 in project ':component:test-base-unit'/debug
Invalid package reference in library; not included in Android: `java.lang.instrument`. Referenced from `net.bytebuddy.agent.builder.AgentBuilder`.
-->
<ignore regexp="^Invalid package reference in library; not included in Android: `java.lang.instrument`\. Referenced from `net\.bytebuddy\.agent\.builder\.AgentBuilder`\.$" />
<ignore regexp="^Invalid package reference in library; not included in Android: `java\.lang\.instrument`\. Referenced from `net\.bytebuddy\.agent\.builder\.AgentBuilder`\.$" />

<!--
gradle/caches/modules-2/files-2.1/org.mockito/mockito-core/5.3.0/a8169e15cb4016bd35594134c84f62b773e3391d/mockito-core-5.3.0.jar:0 in project ':component:test-base-ui'/debug
Invalid package reference in org.mockito:mockito-core; not included in Android: `java.lang.instrument`. Referenced from `org.mockito.internal.creation.bytebuddy.InlineBytecodeGenerator`.
-->
<ignore regexp="^Invalid package reference in org\.mockito:mockito-core; not included in Android: `java\.lang\.instrument`\. Referenced from `org\.mockito\.internal\.creation\.bytebuddy\.InlineBytecodeGenerator`\.$" />

</issue>

Expand Down
4 changes: 0 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
# Gradle setup
org.gradle.daemon=true
org.gradle.parallel=true
# TODO https://github.com/gradle/gradle/issues/24408
#org.gradle.configureondemand=true
org.gradle.jvmargs=-Xmx2048M -Dorg.gradle.deprecation.trace=true
org.gradle.warning.mode=fail

# Android Gradle Plugin setup
android.nonTransitiveRClass=true
android.useAndroidX=true
android.enableJetifier=false

# Build setup
kapt.incremental.apt=true
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ junit5-androidtest = "1.3.0"

# TODEL https://issuetracker.google.com/issues/222730176 in root gradle when fixed.
# TODEL https://issuetracker.google.com/issues/170658134 in lint.xml/build.gradle when fixed.
agp = "7.4.2"
agp = "8.0.0"

# https://github.com/TWiStErRob/net.twisterrob.gradle/releases
twisterrob = "0.15.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ android {
lint {
checkDependencies = true
}
buildFeatures {
buildConfig = true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies {
androidTestImplementation(project(":component:test-base-ui"))
}

@Suppress("UnstableApiUsage")
android {
@Suppress("UnstableApiUsage")
buildFeatures.buildConfig = false
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies {
androidTestImplementation(project("test-fixtures"))
}

@Suppress("UnstableApiUsage")
android {
@Suppress("UnstableApiUsage")
buildFeatures.buildConfig = false
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ dependencies {
androidTestImplementation(project(":component:test-base-ui"))
}

@Suppress("UnstableApiUsage")
android {
namespace = "${owningModule.autoNamespace}.fixtures"
@Suppress("UnstableApiUsage")
buildFeatures.buildConfig = false
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import com.android.build.api.dsl.LibraryExtension
import net.twisterrob.colorfilters.build.dsl.android
import net.twisterrob.colorfilters.build.dsl.libs

@Suppress("UnstableApiUsage")
android {
defaultConfig {
dependencies {
Expand All @@ -24,7 +23,7 @@ android {
multiDexEnabled = true
}
}
packagingOptions {
packaging {
resources {
excludes.add("META-INF/LICENSE.md")
excludes.add("META-INF/LICENSE-notice.md")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ plugins {
id("net.twisterrob.colorfilters.build.android.unitTest")
}

@Suppress("UnstableApiUsage")
android {
namespace = project.autoNamespace

Expand All @@ -37,6 +36,7 @@ android {

// TODEL https://issuetracker.google.com/issues/170658134
androidComponents.finalizeDsl {
@Suppress("UnstableApiUsage")
if (buildFeatures.viewBinding == true || project.path == ":app") {
disable += "UnusedIds"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,22 @@ import com.android.build.gradle.internal.tasks.DexMergingTask
// > com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
// > Caused by: java.lang.OutOfMemoryError: Java heap space
// > Expiring Daemon because JVM heap space is exhausted

@Suppress("MagicNumber")
val instances = (Runtime.getRuntime().maxMemory() / 1e9 - 1).toInt().coerceAtLeast(1)

registerLimitTasksService("dexMergingTaskLimiter", instances)

afterEvaluate { // To get numberOfBuckets populated.
tasks.withType<DexMergingTask>().configureEach {
if (numberOfBuckets.get() == 1) { // Implies DexMergingAction.MERGE_ALL|MERGE_EXTERNAL_LIBS.
@Suppress("UnstableApiUsage")
usesService(gradle.sharedServices.registrations.getAt("dexMergingTaskLimiter").service)
}
}
}

fun Project.registerLimitTasksService(name: String, maxInstances: Int) {
@Suppress("UnnecessaryAbstractClass") // Gradle needs to decorate and implement this.
abstract class TaskLimiter : BuildService<BuildServiceParameters.None>
gradle.sharedServices.registerIfAbsent(name, TaskLimiter::class.java) {
project.logger.info("Registering task limiter '$name' for max $maxInstances instances.")
Expand Down

0 comments on commit 8db7c8d

Please sign in to comment.