aboutsummaryrefslogtreecommitdiffstats
path: root/java/gen.go
Commit message (Collapse)AuthorAgeFilesLines
* Build framework.aidl in SoongColin Cross2019-04-221-2/+3
| | | | | | | | | | | | | | | Move the rules to build framework.aidl into Soong, and use it when compiling aidl files with sdk_version: "current". Also fixes incorrectly using the aidl includes exported by the "framework" module when the proguardRaiseDep dependency was added. Bug: 130798034 Test: sdk_test.go Change-Id: I126adf1d9e7b6acb528875ff62b974ba7ad9a337 Merged-In: I126adf1d9e7b6acb528875ff62b974ba7ad9a337 (cherry picked from commit 3047fa23da6d9f6e504c81e275ad7f6761fb7c7b)
* Add support for protoc pluginsColin Cross2019-04-021-1/+1
| | | | | | | | | Add a proto.plugin property to allow specifying a custom protoc plugin to generate the code. Fixes: 70706119 Test: m am StreamingProtoTest Change-Id: I1ecdd346284b42bbcc8297019d98d2cd564eb94c
* Remove incorrect file commentsDan Willemsen2018-12-271-4/+0
| | | | | Test: none Change-Id: Ia2889ee29c2c0bf18adf5d90e506cfce4b14fdcc
* Add support for sysprop description files to JavaInseob Kim2018-10-041-0/+28
| | | | | | | | | | | | | | | | | From now on, a java shared library can be built only with adding ".sysprop" description file to srcs. Sysprop library generator will automatically generate a .java file, and soong will wrap it into .srcjar file which will finally be contained in the java library. For the schema of description file, see system/tools/sysprop/sysprop.proto. Bug: 80125326 Test: 1) write a .sysprop description file. 2) create java_library and add description file to srcs. 3) create a test app, link against library of 2), and call generated sysprop methods. 4) see compile succeeded. Change-Id: I3ff87bc0a20f5a1aa126ef6d0f4d874a2ff4af8d
* Add proto.canonical_path_from_rootDan Willemsen2018-02-221-10/+2
| | | | | | | | | | | | | | | | | | | | | | | | Historically, we've always passed '-I .' as the first argument to protoc, essentially treating all proto file package names as their full path in the android source tree. This would make sense in a monorepo world, but it makes less sense when we're pulling in external projects with established package names. So keep the same default (for now), but allow individual builds to opt into using local paths as the default names with 'canonical_path_from_root: false'. A cleanup effort and/or large scale change in the future could change the default to false. As part of this, run protoc once per input proto file, since the flags may need to change per-file. We'll also need this in order to specify --dependency_out in the future. Bug: 70704330 Test: aosp/master build-aosp_arm.ninja is identical Test: aosp/master soong/build.ninja has expected changes Test: m Test: Build protobuf test Change-Id: I9d6de9fd630326bbcced1c62a4a7e9546429b0ce
* When compiling with the lite protobuf option, pass the option to aprotoc to ↵Joe Onorato2017-12-151-1/+1
| | | | | | | | force the lite runtime. Test: make Merged-In: I450f89d144d496a6ddfccc6a6a5a679a05809595 Change-Id: I450f89d144d496a6ddfccc6a6a5a679a05809595
* Wrap PackageContext and SingletonContextColin Cross2017-11-291-8/+6
| | | | | | | | | | | | | | | Wrap blueprint.PackageContext so that the *Func methods can provide an android.Config instead of an interface{}. The modified signatures means that every method in ModuleContext and SingletonContext that takes a blueprint.PackageContext now needs to be wrapped to take an android.PackageContext. SingletonContext wasn't previously wrapped at all, but as long as it is, wrap everything like ModuleContext does. This requires updating every Singleton to use the android-specific methods. Test: builds, all Soong tests pass Change-Id: I4f22085ebca7def6c5cde49e8210b59d994ba625
* Use logtags without merged fileColin Cross2017-11-171-1/+1
| | | | | | | | | Assume logtags files will have hardcoded tag numbers and don't build against the merged file. Simplifies the build when logtags files are split across Make and Soong. Test: m checkbuild Change-Id: I1e995ec458690fcadb1b86d64864f277aa9fe3af
* Add support for .srcjar files from genrules and srcsColin Cross2017-11-171-6/+4
| | | | | | | | | Allow srcs to contain .srcjar files, which will be extracted just before javac. Also allow genrules and generated sources to directly return .srcjar files. Test: m checkbuild Change-Id: Ie4cf60ecb9d2ec63a4c2275221544203b1383597
* Fix source jarsColin Cross2017-10-261-2/+2
| | | | | | | | | | | Source jars were not working as designed because javac will only compile files from the -sourcepath if there are references to them starting from files on the command line. Switch to extracting the source jars into a directory and passing a list of the files to javac. Test: m checkbuild Change-Id: I9f7d824f8538d081b2f5ad64ae3cbfd0e96213af
* Move ModuleContext.ModuleBuild to ModuleContext.BuildColin Cross2017-10-241-2/+2
| | | | | | | | | | | | Now that android.ModuleContext does not include blueprint.ModuleContext we can rename android.ModuleContext.ModuleBuild to android.ModuleContext.Build without colliding with blueprint.ModuleContext.Build. Leave ModuleBuild as a wrapper around Build for now to avoid having to update all the users outside build/soong simultaneously. Test: m checkbuild Change-Id: I18eb8cc04faf002049a11d9aac97e9732ff5d638
* Use jars containg sources for java generatorsColin Cross2017-10-161-5/+6
| | | | | | | | | | | | | | | | | srcFileLists was an ill-fated attempt to deal with generators that produce a set of java sources that is not known ahead of time. For example, the list of files produced by protoc depends on the package statement in the .proto file. srcFileLists put the list of generated files into a file, which was then passed to javac using the @file syntax. This worked, but it was too easy to cause missing dependencies, and will not work well in a future distributed build environment. Switch to putting generated sources into a jar, and then pass them jar to javac using -sourcepath. Test: m checkbuild Change-Id: Iaab7a588a6c1239f7bf46e4f1b102b3ef517619b
* Add support for .proto files in java modulesColin Cross2017-10-031-5/+21
| | | | | Test: m -j checkbuild Change-Id: Ia03429948baebff85164a91a34507866c97a08ef
* Remove non-idiomatic inheritanceColin Cross2017-06-231-1/+1
| | | | | | | | Remove inheritance implemented with the bad "superclass calls subclass through interface" pattern, and replace it with composition. Test: builds Change-Id: If323f89360455b3f98b40777edaaaa265bb3b5fc
* Prettify soong ninja build descriptionsColin Cross2017-05-101-12/+12
| | | | | | | | | | | | | | | | | Descriptions currently look like: [ 0% 4/29328] cc out-soong/.intermediates/external/clang/lib/Sema/libclangSema/android_arm_armv7-a-neon_denver_static_core/obj/external/clang/lib/Sema/SemaCodeComplete.o This is not very helpful - most of the characters are used to show the output path, which contains useful information like target architecture, but also contains most of the path to the source files twice, and less useful information like the exact variant name used by soong. Make the descriptions look like: [ 0% 3/29329] //external/clang/lib/Sema:libclangSema clang++ SemaTemplateInstantiate.cpp This is //path/to/module:modulename tool relative/path/to/source/file Test: builds, looks pretty Change-Id: I3087aa7d4eb1860ef6239d77407b8b35445616d7
* Add subdir to GenPathDan Willemsen2016-11-021-2/+2
| | | | | | | | | We were emulating this for proto files, standardize it and make the other generators use it as well. Test: Compare out/soong/build.ninja before/after change Test: mmma -j system/tools/hidl Change-Id: I1888c7b981749060a398387bbb9b481270bf6d75
* Enable goma in soongColin Cross2016-08-311-3/+3
| | | | | | | | | | When the UseGoma flag is set, put all rules except the C compilation rule in an externally defined local_pool, which will have been created by kati. The gomacc wrapper will already be in the CC_WRAPPER environment variable. Bug: 31142427 Change-Id: I699d4edff2e302eee398dad8692ceb14721a628c
* Rename common to androidColin Cross2016-05-181-11/+11
| | | | | | | | | | | | | | | | Rename the "common" package to "android", because common is too generic. Also removes all android.Android naming stutter. Ran: gomvpkg -from 'android/soong/common' -to 'android/soong/android' gorename -from '"android/soong/android".AndroidModuleContext' -to 'ModuleContext' gorename -from '"android/soong/android".AndroidBaseContext' -to 'BaseContext' gorename -from '"android/soong/android".AndroidModuleBase' -to 'ModuleBase' gorename -from '"android/soong/android".AndroidBottomUpMutatorContext' -to 'BottomUpMutatorContext' gorename -from '"android/soong/android".AndroidTopDownMutatorContext' -to 'TopDownMutatorContext' gorename -from '"android/soong/android".AndroidModule' -to 'Module' Change-Id: I3b23590b8ce7c8a1ea1139411d84a53163288da7
* Use `Path` instead of string for file pathsDan Willemsen2015-12-091-35/+23
| | | | | | | | | | | | This centralizes verification and common operations, like converting the path to a source file to the path for a built object. It also embeds the configuration knowledge into the path, so that we can remove "${SrcDir}/path" from the ninja file. When SrcDir is '.', that leads to paths like './path' instead of just 'path' like make is doing, causing differences in compiled binaries. Change-Id: Ib4e8910a6e867ce1b7b420d927c04f1142a7589e
* Use Rule-local implicit dependenciesDan Willemsen2015-11-171-8/+9
| | | | | | | | | | | Depends on https://github.com/google/blueprint/pull/78 This uses the new CommandDeps field to move implicit dependencies embedded in the Command string next to the definition, instead of having to specify them in every BuildParam struct. This should make it easier to verify dependencies. Change-Id: I2711b160920e22fa962a436e1f7041272166f50f
* Fix java resource glob file list locationColin Cross2015-08-241-3/+2
| | | | | | | | | | | | | The source path was being appended to the module out directory to create the file list file, which was resulting in .. in the source path moving the file list file up the directory tree. Use SrcDirRelPath to convert the globbed resource directories to be relatiave to $srcDir before appending them. Also do the same fix to generated aidl, logtags, yacc, and lex files. Change-Id: I2e636bd30abf03bc1d80a897951a9812cc3e09ef
* Add logtags source file supportColin Cross2015-04-131-1/+63
| | | | | | | | | Add support for converting logtags files to source files. Each .logtags file is converted to a .java file, but only after all .logtags files have been combined into a merged text file by the logtagsSingleton. Change-Id: I375d82874029bd26a7c528e46add2a638ba123f9
* Add aidl file support to java buildsColin Cross2015-04-081-0/+79
Add support for aidl files listed in srcs for java builds, and an aidl_preprocess module type for framework and sdk aidls. Change-Id: I3aa537f4483822e5b534c74d0b35f13a938f8947