2026-08-04 23:28:10 +08:00
|
|
|
import org.gradle.api.tasks.Exec
|
|
|
|
|
|
|
|
|
|
plugins {
|
|
|
|
|
base
|
2026-08-07 18:00:38 +08:00
|
|
|
alias(libs.plugins.android.application) apply false
|
|
|
|
|
alias(libs.plugins.kotlin.android) apply false
|
|
|
|
|
alias(libs.plugins.kotlin.kapt) apply false
|
|
|
|
|
alias(libs.plugins.hilt) apply false
|
2026-08-04 23:28:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fun registerNodeVerificationTask(
|
|
|
|
|
name: String,
|
|
|
|
|
description: String,
|
|
|
|
|
script: String,
|
|
|
|
|
) = tasks.register<Exec>(name) {
|
|
|
|
|
group = LifecycleBasePlugin.VERIFICATION_GROUP
|
|
|
|
|
this.description = description
|
|
|
|
|
workingDir(rootDir)
|
|
|
|
|
commandLine("node", script)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val verifyDocs = registerNodeVerificationTask(
|
|
|
|
|
name = "verifyDocs",
|
|
|
|
|
description = "Checks local Markdown links and required harness documents.",
|
|
|
|
|
script = "scripts/verify-docs.mjs",
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
val scanSecrets = registerNodeVerificationTask(
|
|
|
|
|
name = "scanSecrets",
|
|
|
|
|
description = "Scans repository text files for high-confidence secret patterns.",
|
|
|
|
|
script = "scripts/scan-secrets.mjs",
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
val verifyDomainBoundaries = registerNodeVerificationTask(
|
|
|
|
|
name = "verifyDomainBoundaries",
|
|
|
|
|
description = "Prevents Android, persistence, and network imports in the domain core.",
|
|
|
|
|
script = "scripts/verify-domain-boundaries.mjs",
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
val verifyPrototype = registerNodeVerificationTask(
|
|
|
|
|
name = "verifyPrototype",
|
|
|
|
|
description = "Runs dependency-free syntax checks for the HTML prototype harness.",
|
|
|
|
|
script = "scripts/verify-prototype.mjs",
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
val verifyContentContract = registerNodeVerificationTask(
|
|
|
|
|
name = "verifyContentContract",
|
|
|
|
|
description = "Validates the versioned local-content contract and its negative fixtures.",
|
|
|
|
|
script = "scripts/verify-content-contract.mjs",
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
val spotlessCheck = registerNodeVerificationTask(
|
|
|
|
|
name = "spotlessCheck",
|
|
|
|
|
description = "Runs the dependency-free repository formatting gate.",
|
|
|
|
|
script = "scripts/verify-format.mjs",
|
|
|
|
|
)
|
|
|
|
|
|
2026-08-04 23:32:44 +08:00
|
|
|
val verifyDependencyLicenseManifest = registerNodeVerificationTask(
|
|
|
|
|
name = "verifyDependencyLicenseManifest",
|
|
|
|
|
description = "Checks the reviewed dependency-license manifest against pinned build versions.",
|
|
|
|
|
script = "scripts/verify-dependency-licenses.mjs",
|
|
|
|
|
)
|
|
|
|
|
|
2026-08-19 10:58:09 +08:00
|
|
|
val verifyLocalDataBoundary = registerNodeVerificationTask(
|
|
|
|
|
name = "verifyLocalDataBoundary",
|
|
|
|
|
description = "Locks down offline permissions and excludes local records from backup and transfer.",
|
|
|
|
|
script = "scripts/verify-local-data-boundary.mjs",
|
|
|
|
|
)
|
|
|
|
|
|
2026-08-04 23:28:10 +08:00
|
|
|
tasks.register("verifyLocal") {
|
|
|
|
|
group = LifecycleBasePlugin.VERIFICATION_GROUP
|
|
|
|
|
description = "Runs every environment-independent local quality gate."
|
|
|
|
|
dependsOn(
|
2026-08-07 18:00:38 +08:00
|
|
|
":app:lintDebug",
|
|
|
|
|
":app:testDebugUnitTest",
|
|
|
|
|
":app:assembleDebug",
|
2026-08-04 23:32:44 +08:00
|
|
|
":app:verifyDependencyLicenses",
|
2026-08-04 23:28:10 +08:00
|
|
|
verifyDocs,
|
|
|
|
|
scanSecrets,
|
|
|
|
|
verifyDomainBoundaries,
|
|
|
|
|
verifyPrototype,
|
|
|
|
|
verifyContentContract,
|
|
|
|
|
spotlessCheck,
|
2026-08-04 23:32:44 +08:00
|
|
|
verifyDependencyLicenseManifest,
|
2026-08-19 10:58:09 +08:00
|
|
|
verifyLocalDataBoundary,
|
2026-08-04 23:28:10 +08:00
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tasks.named("check") {
|
|
|
|
|
dependsOn("verifyLocal")
|
|
|
|
|
}
|