Improve property comments for docs
Improve the comments associated with properties to work better with Blueprint's auto-documenting feature. Make all properties structs into named types so that thet types can be found using reflection and cross-referenced to the source code to auto-extract docs. Remove the leading <property>: text from properties, the documentation will include the lowercased name of the property. Add filter tags to the nested arch properties. Change-Id: I4ef5db86358886fe61456c24eb2dbe6f7b876115
This commit is contained in:
parent
0bc42685ee
commit
7d5136f033
314
cc/cc.go
314
cc/cc.go
|
@ -151,6 +151,117 @@ type CCFlags struct {
|
|||
Clang bool
|
||||
}
|
||||
|
||||
// Properties used to compile all C or C++ modules
|
||||
type CCBaseProperties struct {
|
||||
// list of source files used to compile the C/C++ module. May be .c, .cpp, or .S files.
|
||||
Srcs []string `android:"arch_variant,arch_subtract"`
|
||||
|
||||
// list of module-specific flags that will be used for C and C++ compiles.
|
||||
Cflags []string `android:"arch_variant"`
|
||||
|
||||
// list of module-specific flags that will be used for C++ compiles
|
||||
Cppflags []string `android:"arch_variant"`
|
||||
|
||||
// list of module-specific flags that will be used for C compiles
|
||||
Conlyflags []string `android:"arch_variant"`
|
||||
|
||||
// list of module-specific flags that will be used for .S compiles
|
||||
Asflags []string `android:"arch_variant"`
|
||||
|
||||
// list of module-specific flags that will be used for .y and .yy compiles
|
||||
Yaccflags []string
|
||||
|
||||
// list of module-specific flags that will be used for all link steps
|
||||
Ldflags []string `android:"arch_variant"`
|
||||
|
||||
// the instruction set architecture to use to compile the C/C++
|
||||
// module.
|
||||
Instruction_set string `android:"arch_variant"`
|
||||
|
||||
// list of directories relative to the root of the source tree that will
|
||||
// be added to the include path using -I.
|
||||
// If possible, don't use this. If adding paths from the current directory use
|
||||
// local_include_dirs, if adding paths from other modules use export_include_dirs in
|
||||
// that module.
|
||||
Include_dirs []string `android:"arch_variant"`
|
||||
|
||||
// list of directories relative to the Blueprints file that will
|
||||
// be added to the include path using -I
|
||||
Local_include_dirs []string `android:"arch_variant"`
|
||||
|
||||
// list of directories relative to the Blueprints file that will
|
||||
// be added to the include path using -I for any module that links against this module
|
||||
Export_include_dirs []string `android:"arch_variant"`
|
||||
|
||||
// list of module-specific flags that will be used for C and C++ compiles when
|
||||
// compiling with clang
|
||||
Clang_cflags []string `android:"arch_variant"`
|
||||
|
||||
// list of module-specific flags that will be used for .S compiles when
|
||||
// compiling with clang
|
||||
Clang_asflags []string `android:"arch_variant"`
|
||||
|
||||
// list of system libraries that will be dynamically linked to
|
||||
// shared library and executable modules. If unset, generally defaults to libc
|
||||
// and libm. Set to [] to prevent linking against libc and libm.
|
||||
System_shared_libs []string
|
||||
|
||||
// list of modules whose object files should be linked into this module
|
||||
// in their entirety. For static library modules, all of the .o files from the intermediate
|
||||
// directory of the dependency will be linked into this modules .a file. For a shared library,
|
||||
// the dependency's .a file will be linked into this module using -Wl,--whole-archive.
|
||||
Whole_static_libs []string `android:"arch_variant"`
|
||||
|
||||
// list of modules that should be statically linked into this module.
|
||||
Static_libs []string `android:"arch_variant"`
|
||||
|
||||
// list of modules that should be dynamically linked into this module.
|
||||
Shared_libs []string `android:"arch_variant"`
|
||||
|
||||
// allow the module to contain undefined symbols. By default,
|
||||
// modules cannot contain undefined symbols that are not satisified by their immediate
|
||||
// dependencies. Set this flag to true to remove --no-undefined from the linker flags.
|
||||
// This flag should only be necessary for compiling low-level libraries like libc.
|
||||
Allow_undefined_symbols bool
|
||||
|
||||
// don't link in crt_begin and crt_end. This flag should only be necessary for
|
||||
// compiling crt or libc.
|
||||
Nocrt bool `android:"arch_variant"`
|
||||
|
||||
// don't insert default compiler flags into asflags, cflags,
|
||||
// cppflags, conlyflags, ldflags, or include_dirs
|
||||
No_default_compiler_flags bool
|
||||
|
||||
// compile module with clang instead of gcc
|
||||
Clang bool `android:"arch_variant"`
|
||||
|
||||
// pass -frtti instead of -fno-rtti
|
||||
Rtti bool
|
||||
|
||||
// -l arguments to pass to linker for host-provided shared libraries
|
||||
Host_ldlibs []string `android:"arch_variant"`
|
||||
|
||||
// select the STL library to use. Possible values are "libc++", "libc++_static",
|
||||
// "stlport", "stlport_static", "ndk", "libstdc++", or "none". Leave blank to select the
|
||||
// default
|
||||
Stl string
|
||||
|
||||
// Set for combined shared/static libraries to prevent compiling object files a second time
|
||||
SkipCompileObjs bool `blueprint:"mutated"`
|
||||
|
||||
Debug, Release struct {
|
||||
// list of module-specific flags that will be used for C and C++ compiles in debug or
|
||||
// release builds
|
||||
Cflags []string `android:"arch_variant"`
|
||||
} `android:"arch_variant"`
|
||||
|
||||
// Minimum sdk version supported when compiling against the ndk
|
||||
Sdk_version string
|
||||
|
||||
// install to a subdirectory of the default install path for the module
|
||||
Relative_install_path string
|
||||
}
|
||||
|
||||
// CCBase contains the properties and members used by all C/C++ module types, and implements
|
||||
// the blueprint.Module interface. It expects to be embedded into an outer specialization struct,
|
||||
// and uses a ccModuleType interface to that struct to create the build steps.
|
||||
|
@ -158,117 +269,7 @@ type CCBase struct {
|
|||
common.AndroidModuleBase
|
||||
module CCModuleType
|
||||
|
||||
// Properties used to compile all C or C++ modules
|
||||
Properties struct {
|
||||
// srcs: list of source files used to compile the C/C++ module. May be .c, .cpp, or .S files.
|
||||
Srcs []string `android:"arch_variant,arch_subtract"`
|
||||
|
||||
// cflags: list of module-specific flags that will be used for C and C++ compiles.
|
||||
Cflags []string `android:"arch_variant"`
|
||||
|
||||
// cppflags: list of module-specific flags that will be used for C++ compiles
|
||||
Cppflags []string `android:"arch_variant"`
|
||||
|
||||
// conlyflags: list of module-specific flags that will be used for C compiles
|
||||
Conlyflags []string `android:"arch_variant"`
|
||||
|
||||
// asflags: list of module-specific flags that will be used for .S compiles
|
||||
Asflags []string `android:"arch_variant"`
|
||||
|
||||
// yaccflags: list of module-specific flags that will be used for .y and .yy compiles
|
||||
Yaccflags []string
|
||||
|
||||
// ldflags: list of module-specific flags that will be used for all link steps
|
||||
Ldflags []string `android:"arch_variant"`
|
||||
|
||||
// instruction_set: the instruction set architecture to use to compile the C/C++
|
||||
// module.
|
||||
Instruction_set string `android:"arch_variant"`
|
||||
|
||||
// include_dirs: list of directories relative to the root of the source tree that will
|
||||
// be added to the include path using -I.
|
||||
// If possible, don't use this. If adding paths from the current directory use
|
||||
// local_include_dirs, if adding paths from other modules use export_include_dirs in
|
||||
// that module.
|
||||
Include_dirs []string `android:"arch_variant"`
|
||||
|
||||
// local_include_dirs: list of directories relative to the Blueprints file that will
|
||||
// be added to the include path using -I
|
||||
Local_include_dirs []string `android:"arch_variant"`
|
||||
|
||||
// export_include_dirs: list of directories relative to the Blueprints file that will
|
||||
// be added to the include path using -I for any module that links against this module
|
||||
Export_include_dirs []string `android:"arch_variant"`
|
||||
|
||||
// clang_cflags: list of module-specific flags that will be used for C and C++ compiles when
|
||||
// compiling with clang
|
||||
Clang_cflags []string `android:"arch_variant"`
|
||||
|
||||
// clang_asflags: list of module-specific flags that will be used for .S compiles when
|
||||
// compiling with clang
|
||||
Clang_asflags []string `android:"arch_variant"`
|
||||
|
||||
// system_shared_libs: list of system libraries that will be dynamically linked to
|
||||
// shared library and executable modules. If unset, generally defaults to libc
|
||||
// and libm. Set to [] to prevent linking against libc and libm.
|
||||
System_shared_libs []string
|
||||
|
||||
// whole_static_libs: list of modules whose object files should be linked into this module
|
||||
// in their entirety. For static library modules, all of the .o files from the intermediate
|
||||
// directory of the dependency will be linked into this modules .a file. For a shared library,
|
||||
// the dependency's .a file will be linked into this module using -Wl,--whole-archive.
|
||||
Whole_static_libs []string `android:"arch_variant"`
|
||||
|
||||
// static_libs: list of modules that should be statically linked into this module.
|
||||
Static_libs []string `android:"arch_variant"`
|
||||
|
||||
// shared_libs: list of modules that should be dynamically linked into this module.
|
||||
Shared_libs []string `android:"arch_variant"`
|
||||
|
||||
// allow_undefined_symbols: allow the module to contain undefined symbols. By default,
|
||||
// modules cannot contain undefined symbols that are not satisified by their immediate
|
||||
// dependencies. Set this flag to true to remove --no-undefined from the linker flags.
|
||||
// This flag should only be necessary for compiling low-level libraries like libc.
|
||||
Allow_undefined_symbols bool
|
||||
|
||||
// nocrt: don't link in crt_begin and crt_end. This flag should only be necessary for
|
||||
// compiling crt or libc.
|
||||
Nocrt bool `android:"arch_variant"`
|
||||
|
||||
// no_default_compiler_flags: don't insert default compiler flags into asflags, cflags,
|
||||
// cppflags, conlyflags, ldflags, or include_dirs
|
||||
No_default_compiler_flags bool
|
||||
|
||||
// clang: compile module with clang instead of gcc
|
||||
Clang bool `android:"arch_variant"`
|
||||
|
||||
// rtti: pass -frtti instead of -fno-rtti
|
||||
Rtti bool
|
||||
|
||||
// host_ldlibs: -l arguments to pass to linker for host-provided shared libraries
|
||||
Host_ldlibs []string `android:"arch_variant"`
|
||||
|
||||
// stl: select the STL library to use. Possible values are "libc++", "libc++_static",
|
||||
// "stlport", "stlport_static", "ndk", "libstdc++", or "none". Leave blank to select the
|
||||
// default
|
||||
Stl string
|
||||
|
||||
// Set for combined shared/static libraries to prevent compiling object files a second time
|
||||
SkipCompileObjs bool `blueprint:"mutated"`
|
||||
|
||||
Debug struct {
|
||||
Cflags []string `android:"arch_variant"`
|
||||
} `android:"arch_variant"`
|
||||
Release struct {
|
||||
Cflags []string `android:"arch_variant"`
|
||||
} `android:"arch_variant"`
|
||||
|
||||
// Minimum sdk version supported when compiling against the ndk
|
||||
Sdk_version string
|
||||
|
||||
// relative_install_path: install to a subdirectory of the default install path for the module
|
||||
Relative_install_path string
|
||||
}
|
||||
Properties CCBaseProperties
|
||||
|
||||
unused struct {
|
||||
Asan bool
|
||||
|
@ -676,15 +677,16 @@ func (c *CCBase) depsToPaths(ctx common.AndroidModuleContext, depNames CCDeps) C
|
|||
return depPaths
|
||||
}
|
||||
|
||||
type ccLinkedProperties struct {
|
||||
VariantIsShared bool `blueprint:"mutated"`
|
||||
VariantIsStatic bool `blueprint:"mutated"`
|
||||
VariantIsStaticBinary bool `blueprint:"mutated"`
|
||||
}
|
||||
|
||||
// CCLinked contains the properties and members used by libraries and executables
|
||||
type CCLinked struct {
|
||||
CCBase
|
||||
|
||||
dynamicProperties struct {
|
||||
VariantIsShared bool `blueprint:"mutated"`
|
||||
VariantIsStatic bool `blueprint:"mutated"`
|
||||
VariantIsStaticBinary bool `blueprint:"mutated"`
|
||||
}
|
||||
dynamicProperties ccLinkedProperties
|
||||
}
|
||||
|
||||
func newCCDynamic(dynamic *CCLinked, module CCModuleType, hod common.HostOrDeviceSupported,
|
||||
|
@ -922,6 +924,25 @@ type ccExportedFlagsProducer interface {
|
|||
// Combined static+shared libraries
|
||||
//
|
||||
|
||||
type CCLibraryProperties struct {
|
||||
BuildStatic bool `blueprint:"mutated"`
|
||||
BuildShared bool `blueprint:"mutated"`
|
||||
Static struct {
|
||||
Srcs []string `android:"arch_variant"`
|
||||
Cflags []string `android:"arch_variant"`
|
||||
Whole_static_libs []string `android:"arch_variant"`
|
||||
Static_libs []string `android:"arch_variant"`
|
||||
Shared_libs []string `android:"arch_variant"`
|
||||
} `android:"arch_variant"`
|
||||
Shared struct {
|
||||
Srcs []string `android:"arch_variant"`
|
||||
Cflags []string `android:"arch_variant"`
|
||||
Whole_static_libs []string `android:"arch_variant"`
|
||||
Static_libs []string `android:"arch_variant"`
|
||||
Shared_libs []string `android:"arch_variant"`
|
||||
} `android:"arch_variant"`
|
||||
}
|
||||
|
||||
type CCLibrary struct {
|
||||
CCLinked
|
||||
|
||||
|
@ -931,24 +952,7 @@ type CCLibrary struct {
|
|||
exportFlags []string
|
||||
out string
|
||||
|
||||
LibraryProperties struct {
|
||||
BuildStatic bool `blueprint:"mutated"`
|
||||
BuildShared bool `blueprint:"mutated"`
|
||||
Static struct {
|
||||
Srcs []string `android:"arch_variant"`
|
||||
Cflags []string `android:"arch_variant"`
|
||||
Whole_static_libs []string `android:"arch_variant"`
|
||||
Static_libs []string `android:"arch_variant"`
|
||||
Shared_libs []string `android:"arch_variant"`
|
||||
} `android:"arch_variant"`
|
||||
Shared struct {
|
||||
Srcs []string `android:"arch_variant"`
|
||||
Cflags []string `android:"arch_variant"`
|
||||
Whole_static_libs []string `android:"arch_variant"`
|
||||
Static_libs []string `android:"arch_variant"`
|
||||
Shared_libs []string `android:"arch_variant"`
|
||||
} `android:"arch_variant"`
|
||||
}
|
||||
LibraryProperties CCLibraryProperties
|
||||
}
|
||||
|
||||
func (c *CCLibrary) buildStatic() bool {
|
||||
|
@ -1233,23 +1237,25 @@ var _ ccObjectProvider = (*ccObject)(nil)
|
|||
// Executables
|
||||
//
|
||||
|
||||
type CCBinaryProperties struct {
|
||||
// compile executable with -static
|
||||
Static_executable bool
|
||||
|
||||
// set the name of the output
|
||||
Stem string `android:"arch_variant"`
|
||||
|
||||
// append to the name of the output
|
||||
Suffix string `android:"arch_variant"`
|
||||
|
||||
// if set, add an extra objcopy --prefix-symbols= step
|
||||
Prefix_symbols string
|
||||
}
|
||||
|
||||
type CCBinary struct {
|
||||
CCLinked
|
||||
out string
|
||||
installFile string
|
||||
BinaryProperties struct {
|
||||
// static_executable: compile executable with -static
|
||||
Static_executable bool
|
||||
|
||||
// stem: set the name of the output
|
||||
Stem string `android:"arch_variant"`
|
||||
|
||||
// suffix: append to the name of the output
|
||||
Suffix string `android:"arch_variant"`
|
||||
|
||||
// prefix_symbols: if set, add an extra objcopy --prefix-symbols= step
|
||||
Prefix_symbols string
|
||||
}
|
||||
BinaryProperties CCBinaryProperties
|
||||
}
|
||||
|
||||
func (c *CCBinary) buildStatic() bool {
|
||||
|
@ -1402,14 +1408,16 @@ func (c *CCBinary) HostToolPath() string {
|
|||
return ""
|
||||
}
|
||||
|
||||
type CCTestProperties struct {
|
||||
// Create a separate test for each source file. Useful when there is
|
||||
// global state that can not be torn down and reset between each test suite.
|
||||
Test_per_src bool
|
||||
}
|
||||
|
||||
type CCTest struct {
|
||||
CCBinary
|
||||
|
||||
TestProperties struct {
|
||||
// test_per_src: Create a separate test for each source file. Useful when there is
|
||||
// global state that can not be torn down and reset between each test suite.
|
||||
Test_per_src bool
|
||||
}
|
||||
TestProperties CCTestProperties
|
||||
}
|
||||
|
||||
func (c *CCTest) flags(ctx common.AndroidModuleContext, flags CCFlags) CCFlags {
|
||||
|
|
|
@ -92,38 +92,68 @@ module {
|
|||
},
|
||||
}
|
||||
*/
|
||||
|
||||
type archProperties struct {
|
||||
// Properties to vary by target architecture
|
||||
Arch struct {
|
||||
Arm interface{}
|
||||
Arm64 interface{}
|
||||
Mips interface{}
|
||||
Mips64 interface{}
|
||||
X86 interface{}
|
||||
X86_64 interface{}
|
||||
// Properties for module variants being built to run on arm (host or device)
|
||||
Arm interface{} `blueprint:"filter(android:\"arch_variant\")"`
|
||||
// Properties for module variants being built to run on arm64 (host or device)
|
||||
Arm64 interface{} `blueprint:"filter(android:\"arch_variant\")"`
|
||||
// Properties for module variants being built to run on mips (host or device)
|
||||
Mips interface{} `blueprint:"filter(android:\"arch_variant\")"`
|
||||
// Properties for module variants being built to run on mips64 (host or device)
|
||||
Mips64 interface{} `blueprint:"filter(android:\"arch_variant\")"`
|
||||
// Properties for module variants being built to run on x86 (host or device)
|
||||
X86 interface{} `blueprint:"filter(android:\"arch_variant\")"`
|
||||
// Properties for module variants being built to run on x86_64 (host or device)
|
||||
X86_64 interface{} `blueprint:"filter(android:\"arch_variant\")"`
|
||||
}
|
||||
// Properties to vary by 32-bit or 64-bit
|
||||
Multilib struct {
|
||||
Lib32 interface{}
|
||||
Lib64 interface{}
|
||||
// Properties for module variants being built to run on 32-bit devices
|
||||
Lib32 interface{} `blueprint:"filter(android:\"arch_variant\")"`
|
||||
// Properties for module variants being built to run on 64-bit devices
|
||||
Lib64 interface{} `blueprint:"filter(android:\"arch_variant\")"`
|
||||
}
|
||||
// Properties to vary by build target (host or device, os, os+archictecture)
|
||||
Target struct {
|
||||
Host interface{}
|
||||
Android interface{}
|
||||
Android_arm interface{}
|
||||
Android_arm64 interface{}
|
||||
Android_mips interface{}
|
||||
Android_mips64 interface{}
|
||||
Android_x86 interface{}
|
||||
Android_x86_64 interface{}
|
||||
Android64 interface{}
|
||||
Android32 interface{}
|
||||
Linux interface{}
|
||||
Linux_x86 interface{}
|
||||
Linux_x86_64 interface{}
|
||||
Darwin interface{}
|
||||
Darwin_x86 interface{}
|
||||
Darwin_x86_64 interface{}
|
||||
Windows interface{}
|
||||
Not_windows interface{}
|
||||
// Properties for module variants being built to run on the host
|
||||
Host interface{} `blueprint:"filter(android:\"arch_variant\")"`
|
||||
// Properties for module variants being built to run on the device
|
||||
Android interface{} `blueprint:"filter(android:\"arch_variant\")"`
|
||||
// Properties for module variants being built to run on arm devices
|
||||
Android_arm interface{} `blueprint:"filter(android:\"arch_variant\")"`
|
||||
// Properties for module variants being built to run on arm64 devices
|
||||
Android_arm64 interface{} `blueprint:"filter(android:\"arch_variant\")"`
|
||||
// Properties for module variants being built to run on mips devices
|
||||
Android_mips interface{} `blueprint:"filter(android:\"arch_variant\")"`
|
||||
// Properties for module variants being built to run on mips64 devices
|
||||
Android_mips64 interface{} `blueprint:"filter(android:\"arch_variant\")"`
|
||||
// Properties for module variants being built to run on x86 devices
|
||||
Android_x86 interface{} `blueprint:"filter(android:\"arch_variant\")"`
|
||||
// Properties for module variants being built to run on x86_64 devices
|
||||
Android_x86_64 interface{} `blueprint:"filter(android:\"arch_variant\")"`
|
||||
// Properties for module variants being built to run on devices that support 64-bit
|
||||
Android64 interface{} `blueprint:"filter(android:\"arch_variant\")"`
|
||||
// Properties for module variants being built to run on devices that do not support 64-bit
|
||||
Android32 interface{} `blueprint:"filter(android:\"arch_variant\")"`
|
||||
// Properties for module variants being built to run on linux hosts
|
||||
Linux interface{} `blueprint:"filter(android:\"arch_variant\")"`
|
||||
// Properties for module variants being built to run on linux x86 hosts
|
||||
Linux_x86 interface{} `blueprint:"filter(android:\"arch_variant\")"`
|
||||
// Properties for module variants being built to run on linux x86_64 hosts
|
||||
Linux_x86_64 interface{} `blueprint:"filter(android:\"arch_variant\")"`
|
||||
// Properties for module variants being built to run on darwin hosts
|
||||
Darwin interface{} `blueprint:"filter(android:\"arch_variant\")"`
|
||||
// Properties for module variants being built to run on darwin x86 hosts
|
||||
Darwin_x86 interface{} `blueprint:"filter(android:\"arch_variant\")"`
|
||||
// Properties for module variants being built to run on darwin x86_64 hosts
|
||||
Darwin_x86_64 interface{} `blueprint:"filter(android:\"arch_variant\")"`
|
||||
// Properties for module variants being built to run on windows hosts
|
||||
Windows interface{} `blueprint:"filter(android:\"arch_variant\")"`
|
||||
// Properties for module variants being built to run on linux or darwin hosts
|
||||
Not_windows interface{} `blueprint:"filter(android:\"arch_variant\")"`
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -85,10 +85,10 @@ type commonProperties struct {
|
|||
Deps []string
|
||||
Tags []string
|
||||
|
||||
// disabled: don't emit any build rules for this module
|
||||
// don't emit any build rules for this module
|
||||
Disabled bool `android:"arch_variant"`
|
||||
|
||||
// multilib: control whether this module compiles for 32-bit, 64-bit, or both. Possible values
|
||||
// control whether this module compiles for 32-bit, 64-bit, or both. Possible values
|
||||
// are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
|
||||
// architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
|
||||
// platform
|
||||
|
|
|
@ -40,21 +40,23 @@ type HostToolProvider interface {
|
|||
HostToolPath() string
|
||||
}
|
||||
|
||||
type generatorProperties struct {
|
||||
// command to run on one or more input files. Available variables for substitution:
|
||||
// $in: one or more input files
|
||||
// $out: a single output file
|
||||
// $srcDir: the root directory of the source tree
|
||||
// The host bin directory will be in the path
|
||||
Cmd string
|
||||
|
||||
// name of the module (if any) that produces the host executable. Leave empty for
|
||||
// prebuilts or scripts that do not need a module to build them.
|
||||
Tool string
|
||||
}
|
||||
|
||||
type generator struct {
|
||||
common.AndroidModuleBase
|
||||
|
||||
properties struct {
|
||||
// cmd: command to run on one or more input files. Available variables for substitution:
|
||||
// $in: one or more input files
|
||||
// $out: a single output file
|
||||
// $srcDir: the root directory of the source tree
|
||||
// The host bin directory will be in the path
|
||||
Cmd string
|
||||
|
||||
// tool: name of the module (if any) that produces the host executable. Leave empty for
|
||||
// prebuilts or scripts that do not need a module to build them.
|
||||
Tool string
|
||||
}
|
||||
properties generatorProperties
|
||||
|
||||
tasks taskFunc
|
||||
|
||||
|
@ -146,10 +148,10 @@ func GenSrcsFactory() (blueprint.Module, []interface{}) {
|
|||
}
|
||||
|
||||
type genSrcsProperties struct {
|
||||
// srcs: list of input files
|
||||
// list of input files
|
||||
Srcs []string
|
||||
|
||||
// output_extension: extension that will be substituted for each output file
|
||||
// extension that will be substituted for each output file
|
||||
Output_extension string
|
||||
}
|
||||
|
||||
|
@ -169,9 +171,9 @@ func GenRuleFactory() (blueprint.Module, []interface{}) {
|
|||
}
|
||||
|
||||
type genRuleProperties struct {
|
||||
// srcs: list of input files
|
||||
// list of input files
|
||||
Srcs []string
|
||||
|
||||
// out: name of the output file that will be generated
|
||||
// name of the output file that will be generated
|
||||
Out string
|
||||
}
|
||||
|
|
54
java/app.go
54
java/app.go
|
@ -31,35 +31,37 @@ import (
|
|||
// AndroidManifest.xml merging
|
||||
// package splits
|
||||
|
||||
type androidAppProperties struct {
|
||||
// path to a certificate, or the name of a certificate in the default
|
||||
// certificate directory, or blank to use the default product certificate
|
||||
Certificate string
|
||||
|
||||
// paths to extra certificates to sign the apk with
|
||||
Additional_certificates []string
|
||||
|
||||
// If set, create package-export.apk, which other packages can
|
||||
// use to get PRODUCT-agnostic resource data like IDs and type definitions.
|
||||
Export_package_resources bool
|
||||
|
||||
// flags passed to aapt when creating the apk
|
||||
Aaptflags []string
|
||||
|
||||
// list of resource labels to generate individual resource packages
|
||||
Package_splits []string
|
||||
|
||||
// list of directories relative to the Blueprints file containing assets.
|
||||
// Defaults to "assets"
|
||||
Asset_dirs []string
|
||||
|
||||
// list of directories relative to the Blueprints file containing
|
||||
// Java resources
|
||||
Android_resource_dirs []string
|
||||
}
|
||||
|
||||
type AndroidApp struct {
|
||||
javaBase
|
||||
|
||||
appProperties struct {
|
||||
// certificate: path to a certificate, or the name of a certificate in the default
|
||||
// certificate directory, or blank to use the default product certificate
|
||||
Certificate string
|
||||
|
||||
// additional_certificates: paths to extra certificates to sign the apk with
|
||||
Additional_certificates []string
|
||||
|
||||
// export_package_resources: If set, create package-export.apk, which other packages can
|
||||
// use to get PRODUCT-agnostic resource data like IDs and type definitions.
|
||||
Export_package_resources bool
|
||||
|
||||
// aaptflags: flags passed to aapt when creating the apk
|
||||
Aaptflags []string
|
||||
|
||||
// package_splits: list of resource labels to generate individual resource packages
|
||||
Package_splits []string
|
||||
|
||||
// asset_dirs: list of directories relative to the Blueprints file containing assets.
|
||||
// Defaults to "assets"
|
||||
Asset_dirs []string
|
||||
|
||||
// android_resource_dirs: list of directories relative to the Blueprints file containing
|
||||
// Java resources
|
||||
Android_resource_dirs []string
|
||||
}
|
||||
appProperties androidAppProperties
|
||||
|
||||
aaptJavaFileList string
|
||||
exportPackage string
|
||||
|
|
122
java/java.go
122
java/java.go
|
@ -44,59 +44,61 @@ import (
|
|||
// DroidDoc
|
||||
// Findbugs
|
||||
|
||||
type javaBaseProperties struct {
|
||||
// list of source files used to compile the Java module. May be .java, .logtags, .proto,
|
||||
// or .aidl files.
|
||||
Srcs []string `android:"arch_variant,arch_subtract"`
|
||||
|
||||
// list of directories containing Java resources
|
||||
Java_resource_dirs []string `android:"arch_variant"`
|
||||
|
||||
// don't build against the default libraries (core-libart, core-junit,
|
||||
// ext, and framework for device targets)
|
||||
No_standard_libraries bool
|
||||
|
||||
// list of module-specific flags that will be used for javac compiles
|
||||
Javacflags []string `android:"arch_variant"`
|
||||
|
||||
// list of module-specific flags that will be used for jack compiles
|
||||
Jack_flags []string `android:"arch_variant"`
|
||||
|
||||
// list of module-specific flags that will be used for dex compiles
|
||||
Dxflags []string `android:"arch_variant"`
|
||||
|
||||
// list of of java libraries that will be in the classpath
|
||||
Java_libs []string `android:"arch_variant"`
|
||||
|
||||
// list of java libraries that will be compiled into the resulting jar
|
||||
Java_static_libs []string `android:"arch_variant"`
|
||||
|
||||
// manifest file to be included in resulting jar
|
||||
Manifest string
|
||||
|
||||
// if not blank, set to the version of the sdk to compile against
|
||||
Sdk_version string
|
||||
|
||||
// Set for device java libraries, and for host versions of device java libraries
|
||||
// built for testing
|
||||
Dex bool `blueprint:"mutated"`
|
||||
|
||||
// if not blank, run jarjar using the specified rules file
|
||||
Jarjar_rules string
|
||||
|
||||
// directories to pass to aidl tool
|
||||
Aidl_includes []string
|
||||
|
||||
// directories that should be added as include directories
|
||||
// for any aidl sources of modules that depend on this module
|
||||
Export_aidl_include_dirs []string
|
||||
}
|
||||
|
||||
// javaBase contains the properties and members used by all java module types, and implements
|
||||
// the blueprint.Module interface.
|
||||
type javaBase struct {
|
||||
common.AndroidModuleBase
|
||||
module JavaModuleType
|
||||
|
||||
properties struct {
|
||||
// srcs: list of source files used to compile the Java module. May be .java, .logtags, .proto,
|
||||
// or .aidl files.
|
||||
Srcs []string `android:"arch_variant,arch_subtract"`
|
||||
|
||||
// java_resource_dirs: list of directories containing Java resources
|
||||
Java_resource_dirs []string `android:"arch_variant"`
|
||||
|
||||
// no_standard_libraries: don't build against the default libraries (core-libart, core-junit,
|
||||
// ext, and framework for device targets)
|
||||
No_standard_libraries bool
|
||||
|
||||
// javacflags: list of module-specific flags that will be used for javac compiles
|
||||
Javacflags []string `android:"arch_variant"`
|
||||
|
||||
// jack_flags: list of module-specific flags that will be used for jack compiles
|
||||
Jack_flags []string `android:"arch_variant"`
|
||||
|
||||
// dxflags: list of module-specific flags that will be used for dex compiles
|
||||
Dxflags []string `android:"arch_variant"`
|
||||
|
||||
// java_libs: list of of java libraries that will be in the classpath
|
||||
Java_libs []string `android:"arch_variant"`
|
||||
|
||||
// java_static_libs: list of java libraries that will be compiled into the resulting jar
|
||||
Java_static_libs []string `android:"arch_variant"`
|
||||
|
||||
// manifest: manifest file to be included in resulting jar
|
||||
Manifest string
|
||||
|
||||
// sdk_version: if not blank, set to the version of the sdk to compile against
|
||||
Sdk_version string
|
||||
|
||||
// Set for device java libraries, and for host versions of device java libraries
|
||||
// built for testing
|
||||
Dex bool `blueprint:"mutated"`
|
||||
|
||||
// jarjar_rules: if not blank, run jarjar using the specified rules file
|
||||
Jarjar_rules string
|
||||
|
||||
// aidl_includes: directories to pass to aidl tool
|
||||
Aidl_includes []string
|
||||
|
||||
// aidl_export_include_dirs: directories that should be added as include directories
|
||||
// for any aidl sources of modules that depend on this module
|
||||
Export_aidl_include_dirs []string
|
||||
}
|
||||
properties javaBaseProperties
|
||||
|
||||
// output file suitable for inserting into the classpath of another compile
|
||||
classpathFile string
|
||||
|
@ -442,13 +444,15 @@ func JavaLibraryHostFactory() (blueprint.Module, []interface{}) {
|
|||
// Java Binaries (.jar file plus wrapper script)
|
||||
//
|
||||
|
||||
type javaBinaryProperties struct {
|
||||
// installable script to execute the resulting jar
|
||||
Wrapper string
|
||||
}
|
||||
|
||||
type JavaBinary struct {
|
||||
JavaLibrary
|
||||
|
||||
binaryProperties struct {
|
||||
// wrapper: installable script to execute the resulting jar
|
||||
Wrapper string
|
||||
}
|
||||
binaryProperties javaBinaryProperties
|
||||
}
|
||||
|
||||
func (j *JavaBinary) GenerateJavaBuildActions(ctx common.AndroidModuleContext) {
|
||||
|
@ -478,12 +482,14 @@ func JavaBinaryHostFactory() (blueprint.Module, []interface{}) {
|
|||
// Java prebuilts
|
||||
//
|
||||
|
||||
type javaPrebuiltProperties struct {
|
||||
Srcs []string
|
||||
}
|
||||
|
||||
type JavaPrebuilt struct {
|
||||
common.AndroidModuleBase
|
||||
|
||||
properties struct {
|
||||
Srcs []string
|
||||
}
|
||||
properties javaPrebuiltProperties
|
||||
|
||||
classpathFile string
|
||||
classJarSpecs, resourceJarSpecs []jarSpec
|
||||
|
@ -540,12 +546,14 @@ type sdkDependency interface {
|
|||
|
||||
var _ sdkDependency = (*sdkPrebuilt)(nil)
|
||||
|
||||
type sdkPrebuiltProperties struct {
|
||||
Aidl_preprocessed string
|
||||
}
|
||||
|
||||
type sdkPrebuilt struct {
|
||||
JavaPrebuilt
|
||||
|
||||
sdkProperties struct {
|
||||
Aidl_preprocessed string
|
||||
}
|
||||
sdkProperties sdkPrebuiltProperties
|
||||
|
||||
aidlPreprocessed string
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue