func pathForModuleGen(ctx android.ModuleContext, paths ...string) android.WritablePath {
	prefix := []string{ctx.ModuleName()}
	return android.PathForModuleGen(ctx, append(prefix, paths...)...)
}
Soong's gen dirs are generally of the form `/path/to/module/gen`. However, the
Android.mk and Linux backends use the form `build/gen/module_name`. Normally this
doesn't matter, as everything is contained within the gen dir, except when chaining
multiple generated modules. In this case, bob_transform_source used on Android.mk or
Linux may expect the module name to be included when doing the regex replacement, and
be exporting include directories accordingly. We therefore need to add a subdirectory
named after the module inside Soong's gen dir for compatibility.
package genrulebob
import (
	"fmt"
	"path/filepath"
	"regexp"
	"strings"
	"android/soong/android"
	"android/soong/cc"
	"android/soong/genrule"
	"github.com/ARM-software/bob-build/internal/soong_compat"
	"github.com/ARM-software/bob-build/internal/utils"
	"github.com/google/blueprint"
)
type commonProps struct {
	Srcs                    []string
	Export_gen_include_dirs []string
	Cmd                     string
	Host_bin                string
	Tool                    string
	Depfile                 bool
	Generated_deps          []string
	Generated_sources       []string
	Encapsulates            []string
	Cflags                  []string
	Conlyflags              []string
	Cxxflags                []string
	Asflags                 []string
	Ldflags                 []string
	Ldlibs                  []string
	Rsp_content             *string
	Install_path *string
	Install_in_data      bool
	Install_in_testcases bool
}
type genruleProps struct {
	Out           []string
	Implicit_srcs []string
	Implicit_outs []string
}
type gensrcsProps struct {
	Out struct {
		Match         string
		Replace       []string
		Implicit_srcs []string
		Implicit_outs []string
	}
}
type soongInout struct {
	in           android.Paths
	out          android.WritablePaths
	depfile      android.WritablePath
	implicitSrcs android.Paths
	implicitOuts android.WritablePaths
	rspfile      android.WritablePath
}
type genruleInterface interface {
	genrule.SourceFileGenerator
	outputs() android.WritablePaths
	implicitOutputs() android.WritablePaths
	outputPath() android.Path
}
type genrulebobCommon struct {
	android.ModuleBase
	Properties commonProps
	genDir               android.Path
	exportGenIncludeDirs android.Paths
	inouts               []soongInout
	installedOuts        []android.InstallPath
}
type genrulebob struct {
	genrulebobCommon
	Properties genruleProps
}
type gensrcsbob struct {
	genrulebobCommon
	Properties gensrcsProps
}
var _ android.AndroidMkEntriesProvider = (*genrulebobCommon)(nil)
var _ genruleInterface = (*genrulebobCommon)(nil)
var _ android.Module = (*genrulebob)(nil)
var _ android.Module = (*gensrcsbob)(nil)
var _ android.SourceFileProducer = (*genrulebob)(nil)
type generatedSourceTagType struct {
	blueprint.BaseDependencyTag
}
type generatedDepTagType struct {
	blueprint.BaseDependencyTag
}
type hostToolBinTagType struct {
	blueprint.BaseDependencyTag
}
func init() {
	pctx.Import("android/soong/cc/config")
}
var (
	pctx = android.NewPackageContext("plugins/genrulebob")
	generatedSourceTag generatedSourceTagType
	generatedDepTag    generatedDepTagType
	hostToolBinTag     hostToolBinTagType
)
func genrulebobFactory() android.Module {
	m := &genrulebob{}
	m.AddProperties(&m.Properties)
	m.AddProperties(&m.genrulebobCommon.Properties)
	android.InitAndroidArchModule(m, android.DeviceSupported, android.MultilibCommon)
	return m
}
func gensrcsbobFactory() android.Module {
	m := &gensrcsbob{}
	m.AddProperties(&m.Properties)
	m.AddProperties(&m.genrulebobCommon.Properties)
	android.InitAndroidArchModule(m, android.DeviceSupported, android.MultilibCommon)
	return m
}
func init() {
	android.RegisterModuleType("genrule_bob", genrulebobFactory)
	android.RegisterModuleType("gensrcs_bob", gensrcsbobFactory)
}
func (m *genrulebobCommon) outputPath() android.Path {
	return m.genDir
}
func (m *genrulebobCommon) outputs() (ret android.WritablePaths) {
	for _, io := range m.inouts {
		ret = append(ret, io.out...)
	}
	return
}
func (m *genrulebobCommon) implicitOutputs() (ret android.WritablePaths) {
	for _, io := range m.inouts {
		ret = append(ret, io.implicitOuts...)
	}
	return
}
func (m *genrulebobCommon) allOutputs() (ret android.WritablePaths) {
	for _, io := range m.inouts {
		ret = append(ret, io.out...)
		ret = append(ret, io.implicitOuts...)
	}
	return
}