aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2015-05-11 13:39:40 -0700
committerColin Cross <ccross@android.com>2015-06-29 10:36:02 -0700
commit7d5136f03350ca18dd8e3b9b34725973f2aa26a0 (patch)
treea23fe8c9249d445627fcf8c89c35945ecd0b7438 /java
parent0bc42685eedb2a520fd3e9b2d950ba24e521c0d2 (diff)
downloadbuild_soong-7d5136f03350ca18dd8e3b9b34725973f2aa26a0.tar.gz
build_soong-7d5136f03350ca18dd8e3b9b34725973f2aa26a0.tar.bz2
build_soong-7d5136f03350ca18dd8e3b9b34725973f2aa26a0.zip
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
Diffstat (limited to 'java')
-rw-r--r--java/app.go46
-rw-r--r--java/java.go106
2 files changed, 81 insertions, 71 deletions
diff --git a/java/app.go b/java/app.go
index 5f153cf4..e6851b5c 100644
--- a/java/app.go
+++ b/java/app.go
@@ -31,35 +31,37 @@ import (
// AndroidManifest.xml merging
// package splits
-type AndroidApp struct {
- javaBase
+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
- 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
+ // paths to extra certificates to sign the apk with
+ Additional_certificates []string
- // additional_certificates: 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
- // 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
+ // flags passed to aapt when creating the apk
+ Aaptflags []string
- // aaptflags: flags passed to aapt when creating the apk
- Aaptflags []string
+ // list of resource labels to generate individual resource packages
+ Package_splits []string
- // package_splits: 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
- // asset_dirs: 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
+}
- // android_resource_dirs: list of directories relative to the Blueprints file containing
- // Java resources
- Android_resource_dirs []string
- }
+type AndroidApp struct {
+ javaBase
+
+ appProperties androidAppProperties
aaptJavaFileList string
exportPackage string
diff --git a/java/java.go b/java/java.go
index 9787d602..a16d1d67 100644
--- a/java/java.go
+++ b/java/java.go
@@ -44,59 +44,61 @@ import (
// DroidDoc
// Findbugs
-// 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
+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"`
- 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"`
+ // list of directories containing Java resources
+ Java_resource_dirs []string `android:"arch_variant"`
- // java_resource_dirs: 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
- // no_standard_libraries: 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"`
- // javacflags: 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"`
- // jack_flags: 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"`
- // dxflags: 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"`
- // java_libs: 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"`
- // java_static_libs: 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
- // manifest: 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
- // 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"`
- // 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
- // jarjar_rules: if not blank, run jarjar using the specified rules file
- Jarjar_rules string
+ // directories to pass to aidl tool
+ Aidl_includes []string
- // aidl_includes: 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
+}
- // 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
- }
+// 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 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
}