[Gradle] Add ability to opt-out from reporting compiler arguments

#KT-55323 Fixed
This commit is contained in:
Alexander.Likhachev
2023-01-10 02:56:05 +01:00
committed by Space Team
parent ebaa09a710
commit 4f9adf894a
4 changed files with 7 additions and 2 deletions
@@ -139,7 +139,7 @@ internal class GradleKotlinCompilerWork @Inject constructor(
} finally {
val taskInfo = TaskExecutionInfo(
changedFiles = incrementalCompilationEnvironment?.changedFiles,
compilerArguments = compilerArgs,
compilerArguments = if (reportingSettings.includeCompilerArguments) compilerArgs else emptyArray(),
withAbiSnapshot = incrementalCompilationEnvironment?.withAbiSnapshot,
withArtifactTransform = incrementalCompilationEnvironment?.classpathChanges is ClasspathChanges.ClasspathSnapshotEnabled
)
@@ -105,6 +105,9 @@ internal class PropertiesProvider private constructor(private val project: Proje
val buildReportHttpIncludeGitBranchName: Boolean
get() = property("kotlin.build.report.http.include_git_branch.name")?.toBoolean() ?: false
val buildReportIncludeCompilerArguments: Boolean
get() = booleanProperty("kotlin.build.report.include_compiler_arguments") ?: true
val buildReportBuildScanCustomValuesLimit: Int
get() = property("kotlin.build.report.build_scan.custom_values_limit")?.toInt() ?: 1000
@@ -15,7 +15,8 @@ data class ReportingSettings(
val fileReportSettings: FileReportSettings? = null,
val httpReportSettings: HttpReportSettings? = null,
val buildScanReportSettings: BuildScanSettings? = null,
val singleOutputFile: File? = null
val singleOutputFile: File? = null,
val includeCompilerArguments: Boolean = false,
) : Serializable {
companion object {
const val serialVersionUID: Long = 1
@@ -70,6 +70,7 @@ internal fun reportingSettings(project: Project): ReportingSettings {
buildScanReportSettings = buildScanSettings,
buildReportOutputs = buildReportOutputTypes,
singleOutputFile = singleOutputFile ?: oldSingleBuildMetric,
includeCompilerArguments = properties.buildReportIncludeCompilerArguments,
)
}