Merge remote-tracking branch 'origin/master' into release/1.2

# Conflicts:
#	compose/frameworks/support
#	web/gradle.properties
This commit is contained in:
Igor Demin
2022-10-08 15:57:27 +02:00
27 changed files with 262 additions and 163 deletions

View File

@@ -447,7 +447,7 @@ The following platform-specific options are available
for details;
* `appStore = true` — build and sign for the Apple App Store. Requires at least JDK 17;
* `appCategory` — category of the app for the Apple App Store.
Default value is `utilities` when building for the App Store, `Unknown` otherwise.
Default value is `public.app-category.utilities` when building for the App Store, `Unknown` otherwise.
See [LSApplicationCategoryType](https://developer.apple.com/documentation/bundleresources/information_property_list/lsapplicationcategorytype) for a list of valid categories;
* `entitlementsFile.set(File("PATH_TO_ENTITLEMENTS"))` — a path to file containing entitlements to use when signing.
When a custom file is provided, make sure to add the entitlements that are required for Java apps.

View File

@@ -70,7 +70,7 @@ fun maybeFail(tutorial: String, message: String) {
}
@OptIn(ExperimentalStdlibApi::class)
fun checkDirs(dirs: List<String>, template: String, buildCmd: String = "build") {
fun checkDirs(dirs: List<String>, template: String, buildCmd: String, kotlinVersion: String?) {
val snippets = findSnippets(dirs)
snippets.forEachIndexed { index, snippet ->
println("process snippet $index at ${snippet.file}:${snippet.lineNumber} with $template")
@@ -86,7 +86,7 @@ fun checkDirs(dirs: List<String>, template: String, buildCmd: String = "build")
add(buildCmd)
project.findProperty("kotlin.version")?.also {
kotlinVersion?.also {
add("-Pkotlin.version=$it")
}
project.findProperty("compose.version")?.also {
@@ -110,7 +110,7 @@ fun checkDirs(dirs: List<String>, template: String, buildCmd: String = "build")
// NOTICE: currently we use a bit hacky approach, when "```kotlin" marks code that shall be checked, while "``` kotlin"
// with whitespace marks code that shall not be checked.
tasks.register("check") {
val checks = CheckSpec.createCheckSpecs(
val checks = createCheckSpecs(
checkTargets = (project.property("CHECK_TARGET")?.toString() ?: "all").toLowerCase()
)
@@ -129,29 +129,36 @@ tasks.register("check") {
checkDirs(
dirs = subdirs.map { "${check.dir}/$it" },
template = check.template,
buildCmd = check.gradleCmd
buildCmd = check.gradleCmd,
kotlinVersion = check.kotlinVersion
)
}
}
}
fun createCheckSpecs(checkTargets: String = "all"): List<CheckSpec> {
fun desktop() = CheckSpec(
gradleCmd = "build", dir = ".", template = "desktop-template",
kotlinVersion = project.findProperty("kotlin.version")?.toString()
)
fun web() = CheckSpec(
gradleCmd = "compileKotlinJs", dir = "Web", template = "web-template",
kotlinVersion = project.findProperty("kotlin.js.version")?.toString() ?:
project.findProperty("kotlin.version")?.toString()
)
fun all() = listOf(desktop(), web())
return when (checkTargets) {
"web" -> listOf(web())
"desktop" -> listOf(desktop())
else -> all()
}
}
data class CheckSpec(
val gradleCmd: String,
val dir: String,
val template: String
) {
companion object {
fun desktop() = CheckSpec(gradleCmd = "build", dir = ".", template = "desktop-template")
fun web() = CheckSpec(gradleCmd = "compileKotlinJs", dir = "Web", template = "web-template")
fun all() = listOf(desktop(), web())
fun createCheckSpecs(checkTargets: String = "all"): List<CheckSpec> {
return when (checkTargets) {
"web" -> listOf(web())
"desktop" -> listOf(desktop())
else -> all()
}
}
}
}
val template: String,
val kotlinVersion: String?
)