Commit graph

1423 commits

Author SHA1 Message Date
Chris Parsons
bb39193bd0 Merge remote-tracking branch 'aosp/upstream' into pull-upstream-2 am: 10b473fefa am: 470dd942e7
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1339763

Change-Id: I9f3a7f0a64afd6781c5b662a97a76c57f3be1a78
2020-06-16 23:01:54 +00:00
Chris Parsons
470dd942e7 Merge remote-tracking branch 'aosp/upstream' into pull-upstream-2 am: 10b473fefa
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1339763

Change-Id: Ifcf191ebc34518c85a7a79b149e7eaa2d06c8e8a
2020-06-16 22:47:53 +00:00
Chris Parsons
10b473fefa Merge remote-tracking branch 'aosp/upstream' into pull-upstream-2
* aosp/upstream:
  Use github actions instead of travis
  Export ModuleListFile in bootstrap (with fix) (#304)
  Revert "Merge pull request #301 from c-parsons/modulelistfile"
  Revert "Always emit rules for tests and add phony to run them"
  Revert changes to singleton_ctx.go
  Change bootstrap.moduleListFile to be exported
  Add a getter for ModuleListFile to SingletonContext

Test: `m nothing` and treehugger
Change-Id: I37cb1b08d962ab34d3b7d7999496795986315217
2020-06-16 13:02:55 -04:00
Dan Willemsen
2c0cd0ac8d
Merge pull request #305 from danw/ghactions
Use github actions instead of travis
2020-06-15 11:19:25 -07:00
Dan Willemsen
bb7ecb7fb3 Use github actions instead of travis
Change-Id: I8a03ca383c53bbcacc403cb954fc2ec2af8fe33d
2020-06-15 10:32:10 -07:00
c-parsons
fe2fa04c30
Export ModuleListFile in bootstrap (with fix) (#304)
* Export ModuleListFile in bootstrap (with fix)

* Run gofmt on command.go
2020-06-15 09:03:27 -07:00
colincross
743261c07e
Merge pull request #303 from colincross/blueprint_tests
Revert changes that broke the build or tests
2020-06-11 16:34:45 -07:00
Colin Cross
bae4de9f16 Revert "Merge pull request #301 from c-parsons/modulelistfile"
This reverts commit 1160e9826f, reversing
changes made to 3a153ecc7f.
2020-06-11 16:29:43 -07:00
Colin Cross
f89751462c Revert "Always emit rules for tests and add phony to run them"
This reverts commit 63085f9e7c.

It breaks the blueprint tests, and we aren't use it yet, so revert
it for now.

Change-Id: I1ac81371342285e8d57baf15fe3a223d4140c6cf
2020-06-11 16:23:10 -07:00
colincross
1160e9826f
Merge pull request #301 from c-parsons/modulelistfile 2020-06-04 14:42:05 -07:00
Colin Cross
4542cd49da Merge remote-tracking branch 'aosp/upstream' am: 91fa1c8b99 am: f7f790fe75
Change-Id: I5491370aaef5d8442e01ffc63ea7f3863a490445
2020-05-28 03:13:08 +00:00
Colin Cross
f7f790fe75 Merge remote-tracking branch 'aosp/upstream' am: 91fa1c8b99
Change-Id: I032e8b1478d5aa46fe603dd346705c22bcefd581
2020-05-28 02:59:50 +00:00
c-parsons
01e094f1b4
Revert changes to singleton_ctx.go 2020-05-27 21:34:26 -04:00
c-parsons
8690f8f196
Change bootstrap.moduleListFile to be exported 2020-05-27 21:31:07 -04:00
Colin Cross
91fa1c8b99 Merge remote-tracking branch 'aosp/upstream'
* aosp/upstream:
  Add ctx.OtherModule(Reverse)DependencyVariantExists.

Bug: 151303681
Test: treehugger
Change-Id: I2389db5e558a34b8a44756bdd2a5f91a0a0f6a3f
2020-05-26 14:48:26 -07:00
colincross
3a153ecc7f
Merge pull request #300 from marstj/master
Add ctx.OtherModule(Reverse)DependencyVariantExists.
2020-05-26 13:27:14 -07:00
Martin Stjernholm
2f212479e2 Add ctx.OtherModule(Reverse)DependencyVariantExists.
This allows guarding calls to AddVariationDependencies and
AddReverseDependency to register dependencies on optional modules.
2020-05-26 20:52:43 +01:00
Chris Parsons
56a06b3c06 Add a getter for ModuleListFile to SingletonContext 2020-05-20 13:50:58 -04:00
Colin Cross
97f031a094 Merge remote-tracking branch 'goog/mirror-aosp-master' into rvc-dev am: c9944506d5
Change-Id: I5c76a82998c0d1219719fc2dd1c707fde905bf3e
2020-05-19 04:43:54 +00:00
Colin Cross
c9944506d5 Merge remote-tracking branch 'goog/mirror-aosp-master' into rvc-dev
* goog/mirror-aosp-master:
  Support checking syntax of generated Blueprint files
  Always emit rules for tests and add phony to run them

Bug: 155628860
Test: treehugger
Change-Id: Ie843b929edf1c11c201792eefcb7772b1e6daeb8
2020-05-18 17:07:28 -07:00
Colin Cross
ee5caa6d7b Merge remote-tracking branch 'aosp/upstream' am: 709f28242e am: 0f1a8e2f85
Change-Id: I8a804d271b249d67f558d7d15c3f895166d150f8
2020-05-18 20:58:07 +00:00
Colin Cross
0f1a8e2f85 Merge remote-tracking branch 'aosp/upstream' am: 709f28242e
Change-Id: I4aee761b65fdde0fbe2640df98dafc2a68cdd0b0
2020-05-18 20:40:44 +00:00
Colin Cross
709f28242e Merge remote-tracking branch 'aosp/upstream'
* aosp/upstream:
  Support checking syntax of generated Blueprint files
  Always emit rules for tests and add phony to run them

Bug: 155628860
Bug: 156428456
Test: treehugger
Change-Id: Ia0e0c8d8d07489c945d4e03d039273cc3f597ac0
2020-05-18 12:03:48 -07:00
colincross
2bcc43c60f
Merge pull request #299 from paulduffin/master
Support checking syntax of generated Blueprint files
2020-05-14 16:10:00 -07:00
Paul Duffin
2a2c58ef46 Support checking syntax of generated Blueprint files
Adds a CheckBlueprintSyntax(...) method to check the syntax of a
Blueprint file.

Changes processModuleDef and newModule from being method on *Context to
being standalone functions. That ensures that CheckBlueprintSyntax(...)
does not need to take a context and so there is no chance that it can
change its state.
2020-05-13 09:06:17 +01:00
colincross
301749801e
Merge pull request #298 from colincross/blueprint_tests
Always emit rules for tests and add phony to run them
2020-05-12 20:45:35 -07:00
Colin Cross
63085f9e7c Always emit rules for tests and add phony to run them
Emit the rules to build blueprint tests even if runGoTests is not
set, and add a phony rule "blueprint_tests" to run them.  This will
allow Soong to stop running the tests at the beginning of every build
but still run them as part of checkbuild or with a manual
`m blueprint_tests`.

Bug: 156428456
Test: m
Test: m blueprint_tests
Change-Id: If293a0757766d3046e78bf230a1825f15adc68fd
2020-05-12 19:20:26 -07:00
Colin Cross
0aa8d6d0bb [automerger skipped] Merge remote-tracking branch 'goog/mirror-aosp-master' into rvc-dev am: 300b6297f4 -s ours
am skip reason: Change-Id I649f2a524f200d696b038ee6bc99d95308e1b475 with SHA-1 6f902c4134 is in history

Change-Id: I3102c52dd904376e2dd127db2312bf9341ef8686
2020-05-07 07:11:55 +00:00
Colin Cross
300b6297f4 Merge remote-tracking branch 'goog/mirror-aosp-master' into rvc-dev
* goog/mirror-aosp-master:
  Run LoadHooks before registering module
  Actually write an empty ninja file with --empty-ninja-file

Bug: 155462403
Test: treehugger
Change-Id: Ia2e5856c52407cebca56abb195915b370e26f0e7
Merged-In: I649f2a524f200d696b038ee6bc99d95308e1b475
2020-05-07 00:30:24 +00:00
Colin Cross
96d10b19c9 Merge remote-tracking branch 'aosp/upstream' am: 6f902c4134 am: 8f60c67b41
Change-Id: I2a216b21bfdc6b5188c19d49504804a6f901adc5
2020-05-06 02:53:57 +00:00
Colin Cross
8f60c67b41 Merge remote-tracking branch 'aosp/upstream' am: 6f902c4134
Change-Id: I49d97f46239283fadb938133d26b801d714c6327
2020-05-06 02:43:36 +00:00
Colin Cross
6f902c4134 Merge remote-tracking branch 'aosp/upstream'
* aosp/upstream:
  Run LoadHooks before registering module

Bug: 155462403
Test: treehugger
Change-Id: I649f2a524f200d696b038ee6bc99d95308e1b475
2020-05-04 08:30:27 -07:00
colincross
b0fe51a0c2
Merge pull request #297 from paulduffin/master
Run LoadHooks before registering module
2020-05-04 08:27:39 -07:00
Paul Duffin
244033b20f Run LoadHooks before registering module
Previously a LoadHook could not modify the name of a module because the
module was registered before the LoadHooks were run. That made it very
complicated (requiring mutators and auto generated names) to create a
module type whose name was determined by say the directory in which it
is defined.

This change moves the LoadHook execution slightly earlier so it runs
before registration of the module.

That caused one slight side problem which was that the
moduleInfo.Name() would fail when called in a LoadHook. That was
because that gets the name from group.name but was group was nil
because it is only set when the module is registered.

Modifying the moduleInfo.Name() method to get the name from the module
logicModule.Name() if group is nil fixed that. The reason for getting
the name from the group.name rather than the logicModule.Name() is that
the former tracks renames but the latter does not. However that is not
an issue in this case as there has been no opportunity for the module
to be renamed until after the LoadHook has returned.
2020-05-04 14:16:03 +01:00
Dan Willemsen
81426fa08b Merge remote-tracking branch 'aosp/upstream' am: ec5085e613 am: 6a1534fcc8
Change-Id: I7b22e7fd4aec98613f0d1831e5518ae6c6b96d47
2020-04-20 13:27:02 +00:00
Dan Willemsen
6a1534fcc8 Merge remote-tracking branch 'aosp/upstream' am: ec5085e613
Change-Id: If5a2fa9080bfcc884b8bc6ed7bba72d0c8357002
2020-04-20 13:05:05 +00:00
Dan Willemsen
ec5085e613 Merge remote-tracking branch 'aosp/upstream'
* aosp/upstream:
  Actually write an empty ninja file with --empty-ninja-file

Test: treehugger (build_test)
Change-Id: Iff7851f2aa39eb14b7ae72ed6ce94fa0ce8d2621
2020-04-19 15:20:02 -07:00
Dan Willemsen
2a062a2ef0
Merge pull request #296 from danw/emptyfile
Actually write an empty ninja file with --empty-ninja-file
2020-04-19 13:32:06 -07:00
Dan Willemsen
6c6c103612 Actually write an empty ninja file with --empty-ninja-file
Otherwise we'll re-run the primary builder every time this is used. This
triggered my new ninja checks that verify that all commands write their
outputs.

Change-Id: Ic92d1ea57203b953da8025a170b24e6420c5436c
2020-04-19 12:50:48 -07:00
Colin Cross
2f2b03e118 Merge remote-tracking branch 'goog/mirror-aosp-master' into rvc-dev am: 681e941f42
Change-Id: Ie769085170c4bdbe2e36ff98f58c8ef2ab50e34d
2020-04-13 23:25:57 +00:00
Xin Li
25168f0dfe [automerger skipped] DO NOT MERGE - Empty merge qt-qpr1-dev-plus-aosp into stag-aosp-master am: 6a2e0e33bd -s ours
am skip reason: subject contains skip directive

Change-Id: I8897e5b812c9e6793baefc0c20f59f16387a4f51
2020-04-10 02:29:06 +00:00
Xin Li
6a2e0e33bd DO NOT MERGE - Empty merge qt-qpr1-dev-plus-aosp into stag-aosp-master
Bug: 151763422
Change-Id: I96cea16a098a8e3272ca2331787d5834bd7f90d7
2020-04-09 17:50:10 -07:00
Colin Cross
681e941f42 Merge remote-tracking branch 'goog/mirror-aosp-master' into rvc-dev
Update rvc-dev build/blueprint to match current AOSP master.

* goog/mirror-aosp-master:
  WalkDeps - only record module visited when it has been recursed into
  Allow missing variants when allowMissingDependencies=true
  bpmodify: fix os.Exit() shouldn't shadow panic()
  bpmodify: respect exitCode
  Set bpmodify usage function
  Fix bug in buildPropertyMap in previous commit.
  Fix missing dependencies from mutators
  Implement list of maps
  In kzip files, compilation unit paths should be relative to top.

Fixes: 150689149
Test: m checkbuild
Change-Id: I38d4b4f5fd51f9467019b7ed8cdeaec1e0798ae3
2020-04-09 10:29:58 -07:00
Colin Cross
54724a1228 Merge remote-tracking branch 'aosp/upstream' am: 5ef2a1eeaa am: a97c1fd916
Change-Id: I35b7342151dee46eaffb0e467b1e7b79798e9d6c
2020-04-03 03:38:40 +00:00
Colin Cross
6423b031af Merge remote-tracking branch 'aosp/upstream' am: 5ef2a1eeaa am: a97c1fd916
Change-Id: I2dde6d2194bb59811f62a3baeb1899024360d027
2020-04-03 03:37:45 +00:00
Colin Cross
a97c1fd916 Merge remote-tracking branch 'aosp/upstream' am: 5ef2a1eeaa
Change-Id: I9d139f84c35497173b2aac08e964807f9dee73d8
2020-04-03 02:57:07 +00:00
Colin Cross
5ef2a1eeaa Merge remote-tracking branch 'aosp/upstream'
* aosp/upstream:
  WalkDeps - only record module visited when it has been recursed into
  Allow missing variants when allowMissingDependencies=true
  bpmodify: fix os.Exit() shouldn't shadow panic()
  bpmodify: respect exitCode
  Set bpmodify usage function

Test: treehugger
Change-Id: Ida99d7412ea3c034e1ddce228b1e851c1dc40cc2
2020-04-02 16:39:51 -07:00
colincross
6957a46d38
Merge pull request #293 from paulduffin/master
WalkDeps - only record module visited when it has been recursed into
2020-04-02 12:58:05 -07:00
Yo Chiang
b138d49adf bpmodify: handle nested properties
Add an option "-property", which is an alias to the option "-parameter".

For example if Android.bp contains:

  cc_foo {
    name: "foo",
  }

Then `bpmodify -m foo -a bar -property baz.buz Android.bp` outputs:

  cc_foo {
    name: "foo",
    baz: {
      buz: ["bar"],
    },
  }

Bug: 149715904
Test: go test -v
Change-Id: I9660cff1b5239ccf5aa9ef1a41835b8ac6cd4b9f
2020-04-03 02:16:55 +08:00
Paul Duffin
72bab1707e WalkDeps - only record module visited when it has been recursed into
Previously, WalkDeps() would record that a module was visited after the
first time it encountered the module irrespective of whether it recursed
into or not. This change moves the recording so it happens only after it
has been recursed into.

Added TestWalkDepsDuplicates_IgnoreFirstPath to test the change. Without
the change the test fails because it does not visit E.

Test refactoring:
* A depsMutator was added instead of relying on blueprintDepsMutator to
  allow different tags to be used for different dependency types.
* Modified barModule and fooModule to support the new depsMutator and
  add support for another type of dependency that is ignored by the
  walking code.
* Extracted walkDependencyGraph() function to reuse common code.
2020-04-02 10:56:13 +01:00