aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleClassFunctionsTest.java
Commit message (Collapse)AuthorAge
* Add --incompatible_disable_data_transition for 'cfg = "data"' Skylark callsGravatar gregce2018-06-27
| | | | PiperOrigin-RevId: 202400312
* Remove Label.parseAbsolute(string, boolean). The goal is to get rid of all ↵Gravatar dannark2018-06-22
| | | | | | | label methods that don't explicitly pass a repository mapping. RELNOTES: None PiperOrigin-RevId: 201717665
* Allow structField callables to specify useSkylarkSemantics, useLocation, and ↵Gravatar cparsons2018-06-20
| | | | | | | | | | useEnvironment Unfortunately this doesn't work for all callers, namely NativeInfo objects, as they may have structField callables invoked from contexts that have no environment available. RELNOTES[INC]: Skylark structs (using struct()) may no longer have to_json and to_proto overridden. PiperOrigin-RevId: 201376969
* Be more permissive when dealing with rules which haveGravatar jcater2018-06-19
| | | | | | | ExecutionPlatformConstraintsAllowed set to PER_TARGET and also have an alread-existing exec_compatible_with attribute. PiperOrigin-RevId: 201238805
* Add more logging when executionPlatformConstraintsAllowed is set to PER_TARGETGravatar jcater2018-06-19
| | | | | | but the "exec_compatible_with" attribute is present. PiperOrigin-RevId: 201219412
* Allow Skylark rules to specify whether targets can add execution platform ↵Gravatar John Cater2018-06-14
| | | | | | | | | constraints. Closes #5341. Change-Id: Ib74e59fec48102469a5039e045e3f3d0e0d86d8c PiperOrigin-RevId: 200526448
* Skylark: Make 'cfg = "data"' a noop.Gravatar gregce2018-05-25
| | | | | | | This is no longer meaningful with the turndown of (C++) LIPO. PiperOrigin-RevId: 198092974
* Migrate struct() to skylarkbuildapiGravatar cparsons2018-05-24
| | | | | RELNOTES: None. PiperOrigin-RevId: 197915097
* Add typo detection when lookups on SkylarkModules fail.Gravatar Googler2018-05-22
| | | | | | Also consolidate code with getattr so getattr now also gets typo detection. PiperOrigin-RevId: 197612666
* Name LateBoundDefaultApi skylark type.Gravatar cparsons2018-04-30
| | | | | | | This still leaves this type documented until a later time, but it makes the type's name explicitly defined (instead of inferred from the class name) RELNOTES: None. PiperOrigin-RevId: 194838958
* Allow skylark rule definitions to advertise providers that targets of the ↵Gravatar cparsons2018-04-27
| | | | | | | | | | | rule must propagate This allows native aspects which specifically require advertised providers to be applied to skylark rules. Implementation to allow aspects to explicitly declare provider requirements will come later. RELNOTES: Skylark rule definitions may advertise providers that targets of the rule must propagate. PiperOrigin-RevId: 194581466
* Migrate most of SkylarkRuleClassFunctions to use @SkylarkCallableGravatar cparsons2018-04-17
| | | | | | | The only things that remain are Provider subclasses, as they require special treatment. (Namely, they are referencable at the top level as a Provider and not a function.) RELNOTES: None. PiperOrigin-RevId: 193249523
* Create @SkylarkGlobalLibrary annotation, allowing classes/interfaces with ↵Gravatar cparsons2018-04-16
| | | | | | | | | global skylark functions to use @SkylarkCallable instead of @SkylarkSignature. Also migrate skylark's global "rule" function to @SkylarkCallable, thus demonstrating the new feature. RELNOTES: None. PiperOrigin-RevId: 193085313
* Introduce `--incompatible_disallow_filetype` to remove the `FileType` function.Gravatar laurentlb2018-04-13
| | | | | | | | RELNOTES: `FileType` is deprecated and will be removed soon. Try the `--incompatible_disallow_filetype` flag to ensure your code is forward-compatible. PiperOrigin-RevId: 192758063
* Make RuleClass serializable and remove Environment from it, since it was ↵Gravatar janakr2018-03-30
| | | | | | | | only being used for the transitive hash code and transitive label of its globals, which can be passed in explicitly. Assert along the way that the transitive label of its globals is always non-null. That is currently the case, although there seems to be no hard invariant of the system that it is true. Might as well tighten it now. PiperOrigin-RevId: 191103310
* Convert several SkylarkAttr methods to use @SkylarkCallable instead of ↵Gravatar cparsons2018-03-22
| | | | | | | @SkylarkSignature RELNOTES: None. PiperOrigin-RevId: 190129404
* Expose an actions provider on RuleConfiguredTarget instances.Gravatar cparsons2018-03-06
| | | | | | | | | Given a target (for example from a skylark aspect), one will be able to access a list of actions that the target generated using "target.actions". This is without additional memory footprint. Actions themselves are not fully exposed to skylark (and thus there isn't much meaning to gather from them in skylark yet). Access methods will follow soon. RELNOTES: None. PiperOrigin-RevId: 188098079
* expectThrows has been renamed to assertThrowsGravatar cushon2018-02-24
| | | | | | More information: https://github.com/junit-team/junit5/issues/531 PiperOrigin-RevId: 186900384
* Remove Skylark ConfigurationTransition.DATA references.Gravatar gregce2018-01-29
| | | | PiperOrigin-RevId: 183733621
* Remove ConfigurationTransitionProxy.NONE and ↵Gravatar gregce2018-01-18
| | | | | | | | BaseRuleClasses.DYNAMIC_TRANSITION_MAP. This leaves DATA as the last remaining legacy transition. PiperOrigin-RevId: 182422552
* Info-related cleanupsGravatar brandjon2018-01-10
| | | | | | | | | - Reorder Info methods for consistency with ClassObject - "StructConstructor" -> "StructProvider" - Added javadoc RELNOTES: None PiperOrigin-RevId: 181469643
* Replace Attribute.ConfigurationTransition with ↵Gravatar gregce2017-12-28
| | | | | | | | | | | | | | | | config.transitions.ConfigurationTransitionProxy. The "proxy" part is to dissuade people from writing: void myfunc(ConfigurationTransition transition) signatures casually. Maybe that's actually a better name than "Transition". But I'd rather rename Transition to ConfigurationTransition in its own change if we want to do that. PiperOrigin-RevId: 180285321
* Fix test that accidentally masked an exceptionGravatar brandjon2017-12-28
| | | | | | | Looks like the test was originally broken (to always pass) by https://github.com/bazelbuild/bazel/commit/01120026dc313ee7ad9ea95069a29252eb19173b and its roll-forward https://github.com/bazelbuild/bazel/commit/950310ff911da6c26339f4dc0b124487adc0cdbb. RELNOTES: None PiperOrigin-RevId: 180272998
* Rename some ClassObject/Provider-related methodsGravatar brandjon2017-12-28
| | | | | | | The terminology "field" is preferred over "key" for the components of a struct or struct-like object. RELNOTES: None PiperOrigin-RevId: 180269374
* Change cfg(HOST) to cfg(HostTransition.INSTANCE).Gravatar gregce2017-12-21
| | | | | | Preparatory step for removing ConfigurationTransition.HOST. PiperOrigin-RevId: 179838374
* Expose ObjcProtoAspect to Skylark.Gravatar cparsons2017-12-20
| | | | | RELNOTES: None. PiperOrigin-RevId: 179737025
* Fix missing print statements in output functionsGravatar vladmos2017-12-02
| | | | PiperOrigin-RevId: 177708823
* Update tests to use the label-based load() syntax.Gravatar laurentlb2017-11-30
| | | | | RELNOTES: None. PiperOrigin-RevId: 177487913
* Shape sharing for Skylark providers.Gravatar Benjamin Peterson2017-11-27
| | | | | | | | | | Add CompactSkylarkInfo, which stores its values as an array instead of a map. The space savings will probably not be dramatic because providers usually have a limited amount of keys. But, there are a lot of them! Change-Id: Idd452a5e3982f773b1c5202c73f3d7031ec022c6 PiperOrigin-RevId: 176995376
* Add memory profiler.Gravatar tomlu2017-10-18
| | | | | | | | | | | This adds two dump command, bazel dump --rules and bazel dump --skylark_memory. dump --rules outputs a summary of the count, action count, and memory consumption of each rule and aspect class. dump --skylark_memory outputs a pprof-compatible file with all Skylark analysis allocations. Users can then use pprof as per normal to analyse their builds. RELNOTES: Add memory profiler. PiperOrigin-RevId: 172558600
* Implement field declarations for declared providers.Gravatar dslomov2017-08-25
| | | | | RELNOTES: Skylark providers can specify allowed fields and their documentation. PiperOrigin-RevId: 166446104
* Move the Skylark rule infrastructure from lib.rules to lib.analysis.skylarkGravatar ulfjack2017-08-09
| | | | | | | | | This is part of splitting up the build-base library into separate libraries for analysis, exec, and rules. Unfortunately, there are a number of reverse deps from analysis code to Skylark classes, so moving these is the only way to make progress. PiperOrigin-RevId: 164612957
* Use RequiredProviders to validate rule prerequisites in RuleContext.Gravatar dslomov2017-08-03
| | | | | | | | | We now use a unified way to check provider requirements everywhere. Reland of https://github.com/bazelbuild/bazel/commit/c32e1b1efcd703b3780de47fba62974123593d71. RELNOTES: None. PiperOrigin-RevId: 164038621
* Automated rollback of commit c32e1b1efcd703b3780de47fba62974123593d71.Gravatar dslomov2017-08-02
| | | | | | | | | | | | | | | *** Reason for rollback *** Breaks depot b/64250728 *** Original change description *** Use RequiredProviders to validate rule prerequisites in RuleContext. We now use a unified way to check provider requirements everywhere. RELNOTES: None. PiperOrigin-RevId: 163862067
* Better names for declared providers-related classes.Gravatar dslomov2017-08-01
| | | | | | | | Follows https://docs.google.com/document/d/1aAIVWvHPERDz2cv_PCFGwr8dvh5FcAkENFoRsNS4clk/. RELNOTES: None. PiperOrigin-RevId: 163728291
* Use RequiredProviders to validate rule prerequisites in RuleContext.Gravatar dslomov2017-07-31
| | | | | | | We now use a unified way to check provider requirements everywhere. RELNOTES: None. PiperOrigin-RevId: 163710961
* Add doc argument to attr.*, rule, aspect, and provider.Gravatar allevato2017-07-10
| | | | | | | | Skydoc can use these arguments to obtain documentation instead of (or in addition to) Python-style docstrings. RELNOTES: None. PiperOrigin-RevId: 161233014
* Improve error message when calling a builtin function with wrong typeGravatar laurentlb2017-07-07
| | | | | | | Error message is simpler and doesn't show the type of all arguments. RELNOTES: None. PiperOrigin-RevId: 161187134
* Remove the ToolchainConstructor class and change uses to be either aGravatar John Cater2017-07-06
| | | | | | | | | Label or a ToolchainInfo provider. Part of #2219. Change-Id: Ia09070717f54eea10e1ab0303253714b58768548 PiperOrigin-RevId: 160995546
* Allow strings as default values of labelsGravatar vladmos2017-07-05
| | | | | | | Strings now can be passed to the default parameter of attr.label, attr.label_list, and attr.label_keyed_string_dict. PiperOrigin-RevId: 160896987
* Rule functions should return None instead of internal Rule objectsGravatar vladmos2017-06-20
| | | | PiperOrigin-RevId: 159438112
* Remove all imports of org.junit.Assert except for static imports of #fail().Gravatar lberki2017-06-01
| | | | | RELNOTES: None. PiperOrigin-RevId: 157685150
* Migrate Java tests to Truth.Gravatar lberki2017-05-30
| | | | | | RELNOTES: None. PiperOrigin-RevId: 157446717
* Add toolchains data to RuleClass and RuleContext.Gravatar John Cater2017-05-19
| | | | | | | | Also expose both sides to Skylark. Part of #2219. Change-Id: I4d749dd9981fe33f75310acb0ec3927cff6f28fe PiperOrigin-RevId: 156340638
* Allow declared providers in attribute and aspect defintions.Gravatar Dmitry Lomov2017-03-06
| | | | | | -- PiperOrigin-RevId: 149169656 MOS_MIGRATED_REVID=149169656
* Allow ' ', '(', ')' and '$' in labels Gravatar Damien Martin-Guillerez2017-03-06
| | | | | | | | | | | | | | | | | | | | | | | This just add the special characters in labels and fixes the associated tests, left is the hard part to test adding those characters everywhere. This is experimental and several characters will break at several location especial in the runfiles manifest file. Follow-ups: Resolve quoting then test, test more and add even more tests. Issue found during development: Parentheses are not accepted in exclude pattern in globs Building a binary includes build-runfiles that relies on the runfiles manifest format so the added test would fails with a java_binary instead of a library. -- Change-Id: I9c87273a90318b931c61bdb86f1066962819960a Reviewed-on: https://cr.bazel.build/9055 PiperOrigin-RevId: 149108027 MOS_MIGRATED_REVID=149108027
* Refactor implementation of native and Skylark declared providers.Gravatar Dmitry Lomov2017-03-03
| | | | | | | | | | | | 1) Instead of having a single class for both, split them into {Skylark,Native}ClassObjectConstructors 2) Allow NativeClassObjectConstructors to customize their instantiation logic. 3) Prepare ClassObjectConstructor.Key to be serializable. -- PiperOrigin-RevId: 148997553 MOS_MIGRATED_REVID=148997553
* Rollback of commit 34ffc4cab1b6cdde54e5945427b79c24fff39aa5.Gravatar Dmitry Lomov2017-03-02
| | | | | | | | | | | | | | *** Reason for rollback *** Roll-forward of commit 01120026dc313ee7ad9ea95069a29252eb19173b with fix. *** Original change description *** Automated [] rollback of commit 01120026dc313ee7ad9ea95069a29252eb19173b. -- PiperOrigin-RevId: 148897534 MOS_MIGRATED_REVID=148897534
* Rollback of commit 01120026dc313ee7ad9ea95069a29252eb19173b.Gravatar Jon Brandvein2017-03-01
| | | | | | -- PiperOrigin-RevId: 148888469 MOS_MIGRATED_REVID=148888469
* Export exportable values as we go instead of at the end of evaluation.Gravatar Dmitry Lomov2017-03-01
| | | | | | | | | This simplifies implementation of attr.* functions and helps make declared provider implementation simpler. -- PiperOrigin-RevId: 148867326 MOS_MIGRATED_REVID=148867326