com.autonomousapps.kit.android.AndroidManifest.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gradle-testkit-support Show documentation
Show all versions of gradle-testkit-support Show documentation
A DSL for building test fixtures with Gradle TestKit
The newest version!
// Copyright (c) 2024. Tony Robalik.
// SPDX-License-Identifier: Apache-2.0
package com.autonomousapps.kit.android
public class AndroidManifest(public val content: String) {
override fun toString(): String = content
public companion object {
@JvmStatic
public fun of(content: String): AndroidManifest = AndroidManifest(content)
@JvmStatic
public fun simpleApp(): AndroidManifest = AndroidManifest(
"""
|
|
|
|
|
|
""".trimMargin()
)
@JvmStatic
public fun app(
application: String? = null,
activities: List = emptyList(),
): AndroidManifest = AndroidManifest(
"""
|
|
|
|
| ${activities.joinToString(separator = "\n") { activityBlock(it) }}
|
|
""".trimMargin()
)
@JvmStatic
public fun appWithoutPackage(application: String? = null): AndroidManifest {
return AndroidManifest(
"""
|
|
|
|
| ${activityBlock()}
|
|
""".trimMargin()
)
}
@JvmStatic
public fun app(application: String? = null): AndroidManifest {
return AndroidManifest(
"""
|
|
|
|
| ${activityBlock()}
|
|
""".trimMargin()
)
}
private fun activityBlock(activityName: String = "MainActivity"): String =
"""
|
|
|
|
|
| """
@JvmField
public val DEFAULT_APP: AndroidManifest = app(null)
@JvmStatic
public fun defaultLib(packageName: String): AndroidManifest = AndroidManifest(
"""
|
|
""".trimMargin()
)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy