Merge pull request #667 from SimonMarquis/cleanup/warnings

Cleanup warnings and replace deprecated methods
tj/update-sync-notification-sender
Don Turner 1 year ago committed by GitHub
commit 2fd1b716f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -47,7 +47,7 @@ android {
missingDimensionStrategy(FlavorDimension.contentType.name, NiaFlavor.demo.name)
}
packagingOptions {
packaging {
resources {
excludes.add("/META-INF/{AL2.0,LGPL2.1}")
}
@ -55,7 +55,7 @@ android {
namespace = "com.google.samples.apps.niacatalog"
buildTypes {
val release by getting {
release {
// To publish on the Play store a private signing key is required, but to allow anyone
// who clones the code to sign and run the release variant, use the debug signing key.
// TODO: Abstract the signing configuration to a separate file to avoid hardcoding this.

@ -39,7 +39,7 @@ android {
}
buildTypes {
val debug by getting {
debug {
applicationIdSuffix = NiaBuildType.DEBUG.applicationIdSuffix
}
val release by getting {
@ -52,7 +52,7 @@ android {
// TODO: Abstract the signing configuration to a separate file to avoid hardcoding this.
signingConfig = signingConfigs.getByName("debug")
}
val benchmark by creating {
create("benchmark") {
// Enable all the optimizations from release build through initWith(release).
initWith(release)
matchingFallbacks.add("release")
@ -65,7 +65,7 @@ android {
}
}
packagingOptions {
packaging {
resources {
excludes.add("/META-INF/{AL2.0,LGPL2.1}")
}

@ -39,7 +39,7 @@ android {
// This benchmark buildType is used for benchmarking, and should function like your
// release build (for example, with minification on). It's signed with a debug key
// for easy local/CI testing.
val benchmark by creating {
create("benchmark") {
// Keep the build type debuggable so we can attach a debugger if needed.
isDebuggable = true
signingConfig = signingConfigs.getByName("debug")

@ -20,7 +20,6 @@ import com.android.build.api.dsl.CommonExtension
import com.android.build.api.dsl.ManagedVirtualDevice
import org.gradle.api.Project
import org.gradle.kotlin.dsl.invoke
import java.util.Locale
/**
* Configure project for Gradle managed devices
@ -55,7 +54,7 @@ private data class DeviceConfig(
val systemImageSource: String,
) {
val taskName = buildString {
append(device.toLowerCase(Locale.ROOT).replace(" ", ""))
append(device.lowercase().replace(" ", ""))
append("api")
append(apiLevel.toString())
append(systemImageSource.replace("-", ""))

@ -27,6 +27,7 @@ import org.gradle.kotlin.dsl.withType
import org.gradle.testing.jacoco.plugins.JacocoPluginExtension
import org.gradle.testing.jacoco.plugins.JacocoTaskExtension
import org.gradle.testing.jacoco.tasks.JacocoReport
import java.util.Locale
private val coverageExclusions = listOf(
// Android
@ -36,6 +37,10 @@ private val coverageExclusions = listOf(
"**/Manifest*.*"
)
private fun String.capitalize() = replaceFirstChar {
if (it.isLowerCase()) it.titlecase(Locale.getDefault()) else it.toString()
}
internal fun Project.configureJacoco(
androidComponentsExtension: AndroidComponentsExtension<*, *, *>,
) {

@ -62,7 +62,6 @@ internal fun Project.configureKotlinAndroid(
// Enable experimental coroutines APIs, including Flow
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
"-opt-in=kotlinx.coroutines.FlowPreview",
"-opt-in=kotlin.Experimental",
)
}
}

@ -14,8 +14,6 @@
* limitations under the License.
*/
// TODO: Remove once https://youtrack.jetbrains.com/issue/KTIJ-19369 is fixed
@Suppress("DSL_SCOPE_VIOLATION")
plugins {
id("nowinandroid.android.library")
id("nowinandroid.android.library.jacoco")

@ -14,8 +14,6 @@
* limitations under the License.
*/
// TODO: Remove once https://youtrack.jetbrains.com/issue/KTIJ-19369 is fixed
@Suppress("DSL_SCOPE_VIOLATION")
plugins {
id("nowinandroid.android.library")
id("nowinandroid.android.library.jacoco")
@ -43,10 +41,10 @@ protobuf {
generateProtoTasks {
all().forEach { task ->
task.builtins {
val java by registering {
register("java") {
option("lite")
}
val kotlin by registering {
register("kotlin") {
option("lite")
}
}

@ -13,8 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// TODO: Remove once https://youtrack.jetbrains.com/issue/KTIJ-19369 is fixed
@Suppress("DSL_SCOPE_VIOLATION")
plugins {
id("kotlin")
}

Loading…
Cancel
Save