Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f273470a authored by Cole Faust's avatar Cole Faust Committed by Gerrit Code Review
Browse files

Merge "Skip errorprone on protobuf/aidl-only modules"

parents d3ae6af3 2d516dfa
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -1195,12 +1195,21 @@ func (j *Module) compile(ctx android.ModuleContext, aaptSrcJar android.Path) {
		}
	}
	if len(uniqueSrcFiles) > 0 || len(srcJars) > 0 {
		hasErrorproneableFiles := false
		for _, ext := range j.sourceExtensions {
			if ext != ".proto" && ext != ".aidl" {
				// Skip running errorprone on pure proto or pure aidl modules. Some modules take a long time to
				// compile, and it's not useful to have warnings on these generated sources.
				hasErrorproneableFiles = true
				break
			}
		}
		var extraJarDeps android.Paths
		if Bool(j.properties.Errorprone.Enabled) {
			// If error-prone is enabled, enable errorprone flags on the regular
			// build.
			flags = enableErrorproneFlags(flags)
		} else if ctx.Config().RunErrorProne() && j.properties.Errorprone.Enabled == nil {
		} else if hasErrorproneableFiles && ctx.Config().RunErrorProne() && j.properties.Errorprone.Enabled == nil {
			// Otherwise, if the RUN_ERROR_PRONE environment variable is set, create
			// a new jar file just for compiling with the errorprone compiler to.
			// This is because we don't want to cause the java files to get completely