aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/packages/Rule.java
Commit message (Collapse)AuthorAge
* Fix missing print statements in output functionsGravatar vladmos2017-12-02
| | | | PiperOrigin-RevId: 177708823
* Replace all usages of Blaze's Preconditions class with guava.Gravatar tomlu2017-11-09
| | | | | | | | Blaze had its own class to avoid GC from varargs array creation for the precondition happy path. Guava now (mostly) implements these, making it unnecessary to maintain our own. This change was almost entirely automated by search-and-replace. A few BUILD files needed fixing up since I removed an export of preconditions from lib:util, which was all done by add_deps. There was one incorrect usage of Preconditions that was caught by error prone (which checks Guava's version of Preconditions) that I had to change manually. PiperOrigin-RevId: 175033526
* Clean up Label validation, and introduce a factory method for constructing a ↵Gravatar nharmata2017-08-08
| | | | | | | Label without validation. RELNOTES: None PiperOrigin-RevId: 164479651
* Automated g4 rollback of commit c4134802dd15d6ef5cca6521f6bf6aac395ee2ad.Gravatar kchodorow2017-05-23
| | | | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Roll forward of directory name change *** Original change description *** Automated g4 rollback of commit 1d9e1ac90197b1d3d7b137ba3c1ada67bb9ba31b. *** Reason for rollback *** Breaks //src/test/shell/integration:force_delete_output_test *** Original change description *** Symlink output directories to the correct directory name If the workspace directory is /path/to/my/proj and the name in the WORKSPACE file is "floop", this will symlink the output directories to output_base/execroot/floop instead of output_base/execroot/proj. More prep for #1262, fixes #1681. PiperOrigin-RevId: 156892980
* Add static methods to return target kinds for built-in targetsGravatar Googler2017-05-03
| | | | | | | | Add static methods to return target kinds of InputFile and OutFile, as well as suffix of target kind of Rule. RELNOTES: None PiperOrigin-RevId: 154866926
* Automated g4 rollback of commit 1d9e1ac90197b1d3d7b137ba3c1ada67bb9ba31b.Gravatar hlopko2017-04-04
| | | | | | | | | | | | | | | | | | *** Reason for rollback *** Breaks //src/test/shell/integration:force_delete_output_test *** Original change description *** Symlink output directories to the correct directory name If the workspace directory is /path/to/my/proj and the name in the WORKSPACE file is "floop", this will symlink the output directories to output_base/execroot/floop instead of output_base/execroot/proj. More prep for #1262, fixes #1681. PiperOrigin-RevId: 152126545
* Use ImmutableList.Builder and ImmutableListMultimap.Builder to create the ↵Gravatar shreyax2017-03-31
| | | | | | | | outputFiles and outputFileMap objects in Rule. RELNOTES: None. PiperOrigin-RevId: 151764143
* Symlink output directories to the correct directory nameGravatar kchodorow2017-03-31
| | | | | | | | | | If the workspace directory is /path/to/my/proj and the name in the WORKSPACE file is "floop", this will symlink the output directories to output_base/execroot/floop instead of output_base/execroot/proj. More prep for #1262, fixes #1681. PiperOrigin-RevId: 151712384
* Show more sensible error messages for invalid placeholders Gravatar Pranjal Agrawal2017-03-23
| | | | | | | | | | | | | | | | (like %{invalid}) in implicit outputs. SkylarkImplicitOutputsFunctionWithMap.calculateOutputs now throws an EvalException in case of invalid placeholders in com.google. \ devtools.build.lib.packages.ImplicitOutputsFucntion. Fix #2467 on Github -- Change-Id: I5460388d0b3f83390aed4c45c967c633c2574e3b Reviewed-on: https://cr.bazel.build/9490 PiperOrigin-RevId: 150907001 MOS_MIGRATED_REVID=150907001
* Clarifies some javadoc in Rule and AttributeContainer.Gravatar Alex Humesky2017-03-21
| | | | | | -- PiperOrigin-RevId: 150675067 MOS_MIGRATED_REVID=150675067
* Global cleanup change.Gravatar Googler2016-12-07
| | | | | | -- PiperOrigin-RevId: 141307853 MOS_MIGRATED_REVID=141307853
* Initial commit of cc_proto_library.Gravatar Carmi Grushko2016-12-01
| | | | | | | RELNOTES: cc_proto_library generates C++ code from proto_library rules. -- MOS_MIGRATED_REVID=140680034
* If Label syntax is wrong, actual offense is now reported in error message.Gravatar Andreas Bergmeier2016-09-30
| | | | | | | | Closes #1633. -- Reviewed-on: https://github.com/bazelbuild/bazel/pull/1633 MOS_MIGRATED_REVID=134774446
* Allow Skyframe graph lookups and value retrievals to throw InterruptedException.Gravatar Janak Ramakrishnan2016-08-16
| | | | | | | The only place we now don't handle InterruptedException is in the action graph created after analysis, since I'm not sure that will be around for that much longer. -- MOS_MIGRATED_REVID=130327770
* Add the repository name as a parameter to the output path functionsGravatar Kristina Chodorow2016-08-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This doesn't do anything yet, it's in preparation for the execroot rearranging change. The execroot will have one bazel-out per repo, so it'll look like: execroot/ repo1/ bazel-out/ local-fastbuild/ bin/ repo2/ bazel-out/ local-fastbuild/ bin/ genfiles/ repo3/ bazel-out/ local-fastbuild/ testlogs/ and so on. Thus, any output path (getBinDirectory() & friends) needs to know what the repo name is. This changes so many places in the code I thought it would be good to do separately, then just flip the functionality in the execroot-rearranging commit. While I was poking around, I changed all of the refs I could from getPackageRelativeArtifact() to getBin/GenfilesArtifact(), so that 1) rule implementation don't have to know as much about roots and 2) they'll be more isolated from other output dir changes. `bazel info` and similar just return roots for the main repository. The only "change" is passing around a target label in the Java rules. Continues work on #1262. -- MOS_MIGRATED_REVID=129985336
* Allow ImplicitOutputsFunctions to be overriden on Rule creation.Gravatar Michajlo Matijkiw2016-08-10
| | | | | -- MOS_MIGRATED_REVID=129787305
* Optimize Rule.getLabels(void) to avoid ImmutableSortedSet.construct().Gravatar Googler2016-07-26
| | | | | | | | | This is called only from Package$Builder.checkForInputOutputConflicts() which just wants the name of each input label; there's no need to sort or deduplicate. -- MOS_MIGRATED_REVID=128355375
* Remove Rule's dependence on a RawAttributeMapper instanceGravatar Michajlo Matijkiw2016-07-21
| | | | | | | | | The things Rule needs it for aren't terribly complex. Instead inline functionality where sensible, and refactor into static methods where not. This reduces each Rule's memory footprint by 38%. -- MOS_MIGRATED_REVID=128011760
* Don't store workspace name on ruleGravatar Michajlo Matijkiw2016-07-18
| | | | | | | Instead have callers get it via package. -- MOS_MIGRATED_REVID=127715494
* Properly filter out Aspect attributes when `blaze query` requests ↵Gravatar Dmitry Lomov2016-01-22
| | | | | | | | | --noimplicit_deps and/or --nohost_deps. RELNOTES: --noimplicit_deps and --nohost_deps work correctly for Aspect attributes. -- MOS_MIGRATED_REVID=112724917
* Extract AttributeInfoProvider interface for DependencyFilters.Gravatar Dmitry Lomov2016-01-22
| | | | | | | | This is in preparation of implementing dependency filtering correctly for aspects. -- MOS_MIGRATED_REVID=112721440
* Refactor dependency filtering out of Rule class.Gravatar Dmitry Lomov2016-01-22
| | | | | -- MOS_MIGRATED_REVID=112717648
* Use Bazel Preconditions variant which avoids varargs array creationGravatar Mark Schaller2015-12-10
| | | | | | | Reduces garbage. -- MOS_MIGRATED_REVID=109914243
* Aspect terminology update.Gravatar Dmitry Lomov2015-11-10
| | | | | | | | Aspect => ConfiguredAspect AspectWithParameters => Aspect -- MOS_MIGRATED_REVID=107375211
* Skylark: Updated the locations of more error messages.Gravatar Florian Weikert2015-11-05
| | | | | | | | | | | | | | In the presence of a Skylark macro some error messages used to show the location of a bzl file for errors that actually happened in a BUILD file. For the "crosses boundary of subpackage" case, we decided to always show the location of the BUILD file. This solution is not perfect since it misses some scenarios where the illegal label was actually specified in a bzl file, such as def macro_skylark_rule(name, srcs=[]): skylark_rule(name = name, srcs = srcs + ['sub/package/illegal.h']) However, the current design in regards to attribute errors does not allow us to provide two locations (BUILD and bzl), nor can we make a case-by-case choice whether we return the location in the BUILD file or in the bzl file. Consequently, we still get a wrong location in some cases. However, these cases should be rare. -- MOS_MIGRATED_REVID=107044681
* Parametrize aspect definition with AspectParameters.Gravatar Dmitry Lomov2015-11-02
| | | | | -- MOS_MIGRATED_REVID=106848269
* Implement propagation along dependencies for Skylark aspects.Gravatar Dmitry Lomov2015-11-02
| | | | | -- MOS_MIGRATED_REVID=106694515
* Remove ast from RuleGravatar Michajlo Matijkiw2015-10-22
| | | | | | | It's always null -- MOS_MIGRATED_REVID=106053287
* Introduce an AspectClass: a representation of a class of aspects.Gravatar Dmitry Lomov2015-10-22
| | | | | | | For native aspects, AspectClass is a facade for Class<AspectFactory<...>>. -- MOS_MIGRATED_REVID=105986390
* Don't crash when building environment groups directlyGravatar Greg Estren2015-09-30
| | | | | | | | | | (following PackageGroup's precedent). Also cleanup: generalize the pattern by which we determine non-configurable target types. -- MOS_MIGRATED_REVID=104125803
* Make rules construction more flexible.Gravatar Miguel Alcon Pinto2015-09-28
| | | | | -- MOS_MIGRATED_REVID=103942367
* Rationalize copyright headersGravatar Damien Martin-Guillerez2015-09-25
| | | | | | | | | | | The headers were modified with `find . -type f -exec 'sed' '-Ei' 's|Copyright 201([45]) Google|Copyright 201\1 The Bazel Authors|' '{}' ';'` And manual edit for not Google owned copyright. Because of the nature of ijar, I did not modified the header of file owned by Alan Donovan. The list of authors were extracted from the git log. It is missing older Google contributors that can be added on-demand. -- MOS_MIGRATED_REVID=103938715
* Remove both of equals/hashCode from classes in lib/packages where either ↵Gravatar Nathan Harmata2015-09-24
| | | | | | | | | only one of them was implemented (potentially incorrectly) or the class really intends to have reference equality. RELNOTES: -- MOS_MIGRATED_REVID=103778746
* Move Label from the lib.syntax to the lib.cmdline package so that:Gravatar Lukacs Berki2015-09-21
| | | | | | | | | | - Label parsing can be simplified - lib.syntax is only contains the code for Skylark and is reasonably independent from the problem domain of building things This change is mostly only changes to imports declarations. The rest is reversing the dependency between :cmdline and :syntax and moving a tiny amount of code between Printer and FilesetEntry and the addition of SkylarkPrintableValue that I couldn't be bothered to separate out into its own change. -- MOS_MIGRATED_REVID=103527877
* Separate build-specific types and types inherent to Skylark.Gravatar Lukacs Berki2015-09-21
| | | | | -- MOS_MIGRATED_REVID=103374106
* Parse the label syntax "@//a:b" so that eventually we can make that the ↵Gravatar Lukacs Berki2015-09-15
| | | | | | | | | syntax that means "refer to the main repository". There isn't an overarching plan for what we are going to do with the cmdline package, which seems to be separated from the .syntax one in all sorts of awkward ways. -- MOS_MIGRATED_REVID=103088960
* Prevented catching/wrapping of InterruptedExceptions, especially in ↵Gravatar Florian Weikert2015-09-14
| | | | | | | BaseFunction. -- MOS_MIGRATED_REVID=102988766
* Don't unnecessarily concatenate Strings just for an error message in an ↵Gravatar Nathan Harmata2015-08-28
| | | | | | | IllegalStateException that might not be thrown at all. -- MOS_MIGRATED_REVID=101748191
* Description redacted.Gravatar Lukacs Berki2015-06-10
| | | | | -- MOS_MIGRATED_REVID=95615442
* Remove Package.AbstractBuilder.Gravatar Han-Wen Nienhuys2015-04-22
| | | | | | | | This simplifies the code a little, and prepares for properly serializing ExternalPackage. -- MOS_MIGRATED_REVID=91673213
* Make rule.getLabels deterministic.Gravatar Laurent Le Brun2015-04-02
| | | | | | | HashMultimap provides no guarantee on the iteration order. -- MOS_MIGRATED_REVID=90153110
* Add support of aspects to the skyframe implementation of query. To keep ↵Gravatar Marian Lobur2015-03-25
| | | | | | | these two versions of query consistent we need to add additional edges to the target that contains aspects, instead of adding it to the target that was in direct deps of the original one. -- MOS_MIGRATED_REVID=89483301
* Description redacted.Gravatar Greg Estren2015-03-23
| | | | | -- MOS_MIGRATED_REVID=89134834
* Make Rule know about the name of the workspace it is in.Gravatar Kristina Chodorow2015-03-05
| | | | | | | This is needed for taking the runfiles prefix from the WORKSPACE file instead of hardcoding it. -- MOS_MIGRATED_REVID=87347883
* Update from Google.Gravatar Han-Wen Nienhuys2015-02-25
-- MOE_MIGRATED_REVID=85702957