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

Commit 48ec5b30 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Add lint test property"

parents 79845f9c d57e8b2c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1064,7 +1064,7 @@ func AndroidTestFactory() android.Module {
	module.appProperties.Use_embedded_native_libs = proptools.BoolPtr(true)
	module.appProperties.AlwaysPackageNativeLibs = true
	module.Module.dexpreopter.isTest = true
	module.Module.linter.test = true
	module.Module.linter.properties.Lint.Test = proptools.BoolPtr(true)

	module.addHostAndDeviceProperties()
	module.AddProperties(
@@ -1117,7 +1117,7 @@ func AndroidTestHelperAppFactory() android.Module {
	module.appProperties.Use_embedded_native_libs = proptools.BoolPtr(true)
	module.appProperties.AlwaysPackageNativeLibs = true
	module.Module.dexpreopter.isTest = true
	module.Module.linter.test = true
	module.Module.linter.properties.Lint.Test = proptools.BoolPtr(true)

	module.addHostAndDeviceProperties()
	module.AddProperties(
+2 −2
Original line number Diff line number Diff line
@@ -1262,7 +1262,7 @@ func TestFactory() android.Module {

	module.Module.properties.Installable = proptools.BoolPtr(true)
	module.Module.dexpreopter.isTest = true
	module.Module.linter.test = true
	module.Module.linter.properties.Lint.Test = proptools.BoolPtr(true)

	android.InitSdkAwareModule(module)
	InitJavaModule(module, android.HostAndDeviceSupported)
@@ -1278,7 +1278,7 @@ func TestHelperLibraryFactory() android.Module {

	module.Module.properties.Installable = proptools.BoolPtr(true)
	module.Module.dexpreopter.isTest = true
	module.Module.linter.test = true
	module.Module.linter.properties.Lint.Test = proptools.BoolPtr(true)

	InitJavaModule(module, android.HostAndDeviceSupported)
	return module
+6 −2
Original line number Diff line number Diff line
@@ -61,6 +61,11 @@ type LintProperties struct {

		// If true, baselining updatability lint checks (e.g. NewApi) is prohibited. Defaults to false.
		Strict_updatability_linting *bool

		// Treat the code in this module as test code for @VisibleForTesting enforcement.
		// This will be true by default for test module types, false otherwise.
		// If soong gets support for testonly, this flag should be replaced with that.
		Test *bool
	}
}

@@ -74,7 +79,6 @@ type linter struct {
	classpath               android.Paths
	classes                 android.Path
	extraLintCheckJars      android.Paths
	test                    bool
	library                 bool
	minSdkVersion           int
	targetSdkVersion        int
@@ -229,7 +233,7 @@ func (l *linter) writeLintProjectXML(ctx android.ModuleContext, rule *android.Ru
	if l.library {
		cmd.Flag("--library")
	}
	if l.test {
	if proptools.BoolDefault(l.properties.Lint.Test, false) {
		cmd.Flag("--test")
	}
	if l.manifest != nil {
+2 −1
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import (
	"android/soong/android"
	"android/soong/java/config"
	"android/soong/tradefed"
	"github.com/google/blueprint/proptools"
)

func init() {
@@ -344,7 +345,7 @@ func RobolectricTestFactory() android.Module {
		&module.testProperties)

	module.Module.dexpreopter.isTest = true
	module.Module.linter.test = true
	module.Module.linter.properties.Lint.Test = proptools.BoolPtr(true)

	module.testProperties.Test_suites = []string{"robolectric-tests"}