Commit graph

20 commits

Author SHA1 Message Date
Colin Cross
635c3b0157 Rename common to android
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
2016-05-18 15:37:25 -07:00
Colin Cross
16b2349190 Add support for sanitizer property
Add a new feature to cc modules that adds the cflags and libraries
necessary to implement AddressSanitizer, ThreadSanitizer, and
UndefinedBehaviorSanitizer.

Change-Id: Ibe5ffadc7ece56080a2521f2c7c00da9ef712584
2016-04-21 16:42:08 -07:00
Dan Willemsen
b50381684a Split Allow_missing_dependencies from Unbundled_build
There are stripped down branches used to build other things than just
unbundled apps (like the AOSP llvm branch used to build llvm prebuilts).

Change-Id: Id772eac8c4622458591b52f9f27723fdb83f9a85
2016-03-16 12:35:33 -07:00
Dan Willemsen
0084d78abf DeviceUsesClang should default to true
It defaults to true in Make now.

Change-Id: Id216c35d4a4fc87ce19067a357561a7fc814cbbb
2016-03-01 17:22:37 -08:00
Dan Willemsen
7f730fd0ad Fix USE_SOONG[_FOR_KATI]
Make was depending on the installed path for ckati/makeparallel, since I
didn't want to hardcode intermediate paths.

For modules in USE_SOONG, we export the intermediate paths, so we don't
need to install.

Change-Id: I90bf3ad1461e239a8a40fd0c8ddbc679cf00d126
2016-01-14 11:24:27 -08:00
Dan Willemsen
322acafe9e Add Mega_device configuration option
This lets you configure soong to build for every supported architecture
in one build. Installation is disabled, since it's not actually setting
up multiple devices, and would try to install multiple versions to a
single path.

Configurations that do not build are commented out.

Change-Id: I92ddea0b9ddbd53e12187c7f581b8ac5bd5fdec3
2016-01-13 14:39:11 -08:00
Colin Cross
6ff5138355 Delay dependency errors to ninja time for unbundled builds
Unbundled builds may use a subset of the tree, which can bring in unused
modules but not their dependencies.  Delay handling of dependency errors
for unbundled builds to ninja time, which will prevent errors if only
modules with satisified dependencies are built.

Change-Id: Ib93bae93fcfa0b55df500a30d8e35231ffb0987c
2015-12-18 13:13:15 -08:00
Dan Willemsen
5ba07e8fe4 Only change behavior when actually embedded in make
The change to enable embedding in make change the default behavior to
produce an Android.mk file, change the ninja builddir, and add the
-soong suffix to the end of target names. These don't make sense if
we're not building inside make, so detect if we're running under make
by checking for a .soong.in_make file in the builddir.

Change-Id: I1a0f4c1becb327c769b8a130cafef11d83eb49f4
2015-12-15 13:05:56 -08:00
Dan Willemsen
34cc69e4bf Use Path instead of string for file paths
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
2015-12-09 14:29:12 -08:00
Dan Willemsen
218f65628e Hybrid soong/mk build using prebuilts
Change-Id: I96daa69af27bd19c8bfbe327a1318f51c738fc03
2015-12-01 15:08:01 -08:00
Dan Willemsen
dd0e2c338f Add DeviceUsesClang to change clang default
This is equivalent to USE_CLANG_PLATFORM_BUILD in the current build
system.

Change-Id: Ifaca0f2639871dac834ef603cfade695191cff11
2015-10-20 14:29:35 -07:00
Dan Willemsen
1d31ec3667 Add ProductVariables.DeviceName, set defaults to flounder
Using flounder defaults to compare against make.

Change-Id: I88fb0809e84b78ef005b76f255017a4d4a35fd13
2015-09-23 15:31:39 -07:00
Colin Cross
2738597af0 Fix product variables with no soong.variables
If soong.variables didn't exist, loadFromConfigFile would write default
values to soong.variables, but return with the product variables set to
the zero values.  Replace jsonConfigurable.DefaultConfig() with
SetDefaultConfig() that modifies the current object, and call it before
writing the values.

Change-Id: I7b7404c7a51975dc4493e25c775b3cf56ef335e3
2015-09-18 10:59:41 -07:00
Dan Willemsen
87b17d1ff4 Use SRCDIR as a working directory
The existing behavior of using the build directory as the working
directory is useful if you want to move/copy the output directory around
and SRCDIR still refers the the source. But, it's more useful to have
the source directory be the working directory. Tools like cpp(__FILE__)
and other debug prints embed relative paths from the working directory.
We also have tools that expect the working directory to be $TOP.

Change-Id: Ia0f1d3c6b7df72d61cf5628efa2baa98bd19775b
2015-09-17 23:42:25 -07:00
Dan Willemsen
e7680babe2 Freeze environment reading after saving deps
Any reads after the deps are saved won't show up as dependencies later.
So panic if new environment variables are read after saving deps.

Change-Id: Ia51deaf750804d3b99e69c001939a104c2d8c9f2
2015-09-15 20:30:03 +00:00
Colin Cross
485e572aeb Read product variables from soong.variables
Refactor the soong.config loading code to support reading in
product variables from soong.variables.

Change-Id: I389e6bb5c501b53167267d5f5d0d25557811cf72
2015-09-14 16:09:36 -07:00
Colin Cross
30e076af2e Add support for building android apps
Add support for running aapt to generate R.java and Manifest.java,
compiling java into jar, adding resources to the jar to convert it
into an apk, signing the apk, and zipaligning the apk.

Change-Id: I7a73fef590d07f35b3d0b56a8571780c09bb10ae
2015-04-20 14:12:30 -07:00
Colin Cross
c1e86a3896 Fix race condition in config.Getenv
The envDeps map may be accessed concurrently by multiple modules
in GenerateBuildActions, wrap the accesses in a mutex.

Change-Id: I18abf2687997c045a99b987908623f7d8c2ea344
2015-04-15 12:41:44 -07:00
Colin Cross
c3c0a49622 Remove Config interface
Replace the Config interface with a struct that wraps the real
*config object.  This keeps the existing pointer behavior without
having to list all of the available config functions in the interface.

Change-Id: If55a622b5a112ca5dc7193ebd59f2931b3a8e6cd
2015-04-10 15:50:37 -07:00
Colin Cross
1332b0035c Move config into common and provide helper
Using ctx.Config().(Config) everywhere is a mouthful, and it is
inefficient to do the type assertion.  Put the Config interface into
the context, and provide an AConfig() to return the Config already
converted to the right type.

Change-Id: I301a1fd7d2a005580aabca7866a37c5d42ad8c69
2015-04-08 15:19:24 -07:00
Renamed from config/config.go (Browse further)