Skip to content

Commit

Permalink
Prepare for release 0.23.2.
Browse files Browse the repository at this point in the history
  • Loading branch information
ZacSweers committed Dec 11, 2024
1 parent 8e6b6ef commit 69df270
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ Changelog
**Unreleased**
--------------

0.23.2
------

_2024-12-11_

- Add `foundry.android.test.targetApkArch` property to specify a target architecture for androidTest APKs. This allows us to exclude jni libs from unmatched architectures to shrink APK size.

0.23.1
------

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ POM_DEVELOPER_ID=slackhq
POM_DEVELOPER_NAME=Slack Technologies, Inc.
POM_DEVELOPER_URL=https://github.com/slackhq
POM_INCEPTION_YEAR=2022
VERSION_NAME=1.0.0-SNAPSHOT
VERSION_NAME=0.23.2
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package foundry.gradle

import foundry.common.FoundryKeys
import foundry.gradle.android.AndroidArchitecture
import foundry.gradle.anvil.AnvilMode
import foundry.gradle.artifacts.FoundryArtifact
import foundry.gradle.properties.PropertyResolver
Expand Down Expand Up @@ -496,6 +497,17 @@ internal constructor(
public val compressAndroidTestApksWithLegacyPackaging: Provider<Boolean>
get() = resolver.booleanProvider("foundry.android.test.compressWithLegacyPackaging", false)

/**
* Option to specify which architecture to target for androidTest APKs. These are universal by
* default, which can be quite bloated. This allows for targeting a subset of arches by excluding
* jni libs from other ones.
*/
public val targetAndroidTestApksArch: Provider<AndroidArchitecture>
get() =
resolver.optionalStringProvider("foundry.android.test.targetApkArch").map {
AndroidArchitecture.valueOf(it)
}

/** Flag for minifying androidTest APks with R8. This just tree shakes. */
public val minifyAndroidTestApks: Provider<Boolean>
get() = resolver.booleanProvider("foundry.android.test.minifyEnabled", false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import com.android.build.gradle.tasks.JavaPreCompileTask
import com.autonomousapps.DependencyAnalysisSubExtension
import com.bugsnag.android.gradle.BugsnagPluginExtension
import foundry.gradle.Configurations.isPlatformConfigurationName
import foundry.gradle.android.AndroidArchitecture
import foundry.gradle.artifacts.FoundryArtifact
import foundry.gradle.artifacts.Publisher
import foundry.gradle.dependencies.FoundryDependencies
Expand Down Expand Up @@ -523,6 +524,14 @@ internal class StandardProjectConfigurations(
packaging.jniLibs.useLegacyPackagingFromBundle.set(
foundryProperties.compressAndroidTestApksWithLegacyPackaging
)
foundryProperties.targetAndroidTestApksArch.orNull?.let { targetArch ->
packaging.jniLibs.excludes.addAll(
// Exclude out non-targeted architectures
AndroidArchitecture.entries
.filterNot { it == targetArch }
.map { "**/${it.jniLibsPath}/*.so" }
)
}
}
}
if (foundryProperties.enableEmulatorWtfForAndroidTest) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright (C) 2024 Slack Technologies, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package foundry.gradle.android

/** Represents possible Android architectures. */
public enum class AndroidArchitecture(public val jniLibsPath: String) {
ARM64_V8A("arm64-v8a"),
ARMEABI_V7A("armeabi-v7a"),
X86("x86"),
X86_64("x86_64"),
}

0 comments on commit 69df270

Please sign in to comment.