[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 { } finally {
val taskInfo = TaskExecutionInfo( val taskInfo = TaskExecutionInfo(
changedFiles = incrementalCompilationEnvironment?.changedFiles, changedFiles = incrementalCompilationEnvironment?.changedFiles,
compilerArguments = compilerArgs, compilerArguments = if (reportingSettings.includeCompilerArguments) compilerArgs else emptyArray(),
withAbiSnapshot = incrementalCompilationEnvironment?.withAbiSnapshot, withAbiSnapshot = incrementalCompilationEnvironment?.withAbiSnapshot,
withArtifactTransform = incrementalCompilationEnvironment?.classpathChanges is ClasspathChanges.ClasspathSnapshotEnabled withArtifactTransform = incrementalCompilationEnvironment?.classpathChanges is ClasspathChanges.ClasspathSnapshotEnabled
) )
@@ -105,6 +105,9 @@ internal class PropertiesProvider private constructor(private val project: Proje
val buildReportHttpIncludeGitBranchName: Boolean val buildReportHttpIncludeGitBranchName: Boolean
get() = property("kotlin.build.report.http.include_git_branch.name")?.toBoolean() ?: false 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 val buildReportBuildScanCustomValuesLimit: Int
get() = property("kotlin.build.report.build_scan.custom_values_limit")?.toInt() ?: 1000 get() = property("kotlin.build.report.build_scan.custom_values_limit")?.toInt() ?: 1000
@@ -15,7 +15,8 @@ data class ReportingSettings(
val fileReportSettings: FileReportSettings? = null, val fileReportSettings: FileReportSettings? = null,
val httpReportSettings: HttpReportSettings? = null, val httpReportSettings: HttpReportSettings? = null,
val buildScanReportSettings: BuildScanSettings? = null, val buildScanReportSettings: BuildScanSettings? = null,
val singleOutputFile: File? = null val singleOutputFile: File? = null,
val includeCompilerArguments: Boolean = false,
) : Serializable { ) : Serializable {
companion object { companion object {
const val serialVersionUID: Long = 1 const val serialVersionUID: Long = 1
@@ -70,6 +70,7 @@ internal fun reportingSettings(project: Project): ReportingSettings {
buildScanReportSettings = buildScanSettings, buildScanReportSettings = buildScanSettings,
buildReportOutputs = buildReportOutputTypes, buildReportOutputs = buildReportOutputTypes,
singleOutputFile = singleOutputFile ?: oldSingleBuildMetric, singleOutputFile = singleOutputFile ?: oldSingleBuildMetric,
includeCompilerArguments = properties.buildReportIncludeCompilerArguments,
) )
} }