aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skylarkinterface
Commit message (Collapse)AuthorAge
* Test suite to verify contracts of @SkylarkCallable and @SkylarkModule which ↵Gravatar cparsons2018-07-13
| | | | | | | are difficult or impossible to verify by annotation processor. RELNOTES: None. PiperOrigin-RevId: 204540521
* Remove SkylarkCallable.mandatoryPositionalsGravatar cparsons2018-07-13
| | | | | RELNOTES: None. PiperOrigin-RevId: 204505003
* Remove outdated TODOGravatar juliexxia2018-07-10
| | | | | RELNOTES: None. PiperOrigin-RevId: 203977219
* Fix CcCompilationInfo to appropriately subclass Struct, and improve upon ↵Gravatar cparsons2018-07-09
| | | | | | | error messaging and commenting when there's an unresolvable skylark type. RELNOTES: None. PiperOrigin-RevId: 203826504
* Javadoc that generic1 doesn't actually do what you'd expectGravatar brandjon2018-06-29
| | | | | RELNOTES: None PiperOrigin-RevId: 202692405
* Require @SkylarkCallable parameters to be explicitly specified.Gravatar cparsons2018-06-28
| | | | | | | | | | This will be enforced by annotation processor. This will be followed up, along with turndown of mandatoryPositionals, by removing the intepreter code which infers the correct number and type of parameters. RELNOTES: None. PiperOrigin-RevId: 202499089
* Make @SkylarkCallable.name mandatory.Gravatar cparsons2018-06-22
| | | | | RELNOTES: None. PiperOrigin-RevId: 201748802
* Remove several uses of @SkylarkCallable.mandatoryPositionalsGravatar cparsons2018-06-21
| | | | | | | mandatoryPositionals is going away soon. While it is less verbose than the alternative, it does not allow for documentation to be specified (nor type-checking), and is thus inferior to the alternative. Killing mandatoryPositionals will also make the interpreter code cleaner. RELNOTES: None. PiperOrigin-RevId: 201566377
* 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
* Replace ambiguous bit of info with pointer to rules pageGravatar brandjon2018-06-08
| | | | | RELNOTES: None PiperOrigin-RevId: 199852932
* Clarify invariants for @SkylarkModule and @SkylarkCallableGravatar brandjon2018-05-24
| | | | | | | Also refactor away SkylarkModule.Resolver. RELNOTES: None PiperOrigin-RevId: 197955164
* Make @SkylarkModule detection (through superclasses/superinterfaces) ↵Gravatar cparsons2018-05-24
| | | | | | | | | well-defined. Moving forward, if a class not already annotated with @SkylarkModule has SkylarkModule supertypes A and B, then it must be the case that A is a type of B, or B is a type of A. The skylark type of a given class is dictated by the *most specific* superclass annotated with @SkylarkModule. RELNOTES: None. PiperOrigin-RevId: 197946898
* Fix SkylarkCallable-annotation detection to appropriately handle methods ↵Gravatar cparsons2018-05-24
| | | | | | | with generic parameters RELNOTES: None. PiperOrigin-RevId: 197932265
* Migrate JavaInfo's provider to use the new provider pattern.Gravatar cparsons2018-05-22
| | | | | | | This dramatically improves documentation generation for JavaInfo and it makes it far more maintainable and extensible going forward. RELNOTES: None. PiperOrigin-RevId: 197619040
* Use a new pattern for builtin Provider objects with @SkylarkCallable.Gravatar cparsons2018-05-01
| | | | | | | | This deprecates the old NativeProvider pattern. The new pattern is demonstrated using AppleStaticLibraryInfo. RELNOTES: None. PiperOrigin-RevId: 194956883
* Introduce @SkylarkCallable.selfCall, to signify the containing class should ↵Gravatar cparsons2018-04-24
| | | | | | | | | | | | be treated as a callable skylark object. This will allow Skylark Provider objects to be better specified. For example, "JavaInfo" can have a fully-documented, fully-specified @SkylarkCallable method with selfCall=true to represent the method JavaInfo(), instead of being a subclass of BaseFunction and requiring a @SkylarkSignature annotation. There are no usages of this pattern introduced in this CL, and also no updates to docgen to support the new pattern. These will be introduced in another CL. RELNOTES: None. PiperOrigin-RevId: 194088227
* Start refactoring elements of the Skylark Build API into their own package.Gravatar cparsons2018-04-23
| | | | | RELNOTES: None. PiperOrigin-RevId: 193962460
* Create @SkylarkConstructor annotation, to annotate certain global-namespace ↵Gravatar cparsons2018-04-16
| | | | | | | | | | @SkylarkCallable methods as representing constructors of other skylark types. This change also demonstrates the new pattern on the global Label() constructor. As an added bonus, it fixes documentation of that constructor. The old documentation used to read "Label.Label(...)" and the new documentation reads "Label(...)". RELNOTES: None. PiperOrigin-RevId: 193109338
* 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 Param.legacyNamed() to handle migration from @SkylarkSignature to ↵Gravatar cparsons2018-04-11
| | | | | | | | | | @SkylarkCallable. @SkylarkSignature.parameters() treat named()=true for parameters regardless of whether named() was actually set to true, and thus for ease of migration we mark migrated parameters as legacyNamed() = true, which is currently semantically equivalent to named() = true. We make a distinction so that it's easier to bulk fix these later. RELNOTES: None. PiperOrigin-RevId: 192477405
* Introduce extraPositonals and extraArguments to SkylarkCallable, to have ↵Gravatar cparsons2018-04-09
| | | | | | | | | parity with @SkylarkSignature. This is necessary for several builtin functions that still use @SkylarkSignature, such as string format. These will be migrated in a future CL. RELNOTES: None. PiperOrigin-RevId: 192200282
* Cleanup @SkylarkCallable parameters and their error handling.Gravatar cparsons2018-04-06
| | | | | | | This involves enforcing additional compiletime restrictions on Param ordering and semantics. RELNOTES: None. PiperOrigin-RevId: 191927206
* Enforce @SkylarkCallable must have a non-empty doc string or explicitly be ↵Gravatar cparsons2018-03-30
| | | | | | | documented=false. RELNOTES: None. PiperOrigin-RevId: 191112140
* Support source versions newer than 8 in Bazel's annotation processorsGravatar cushon2018-03-29
| | | | | | This quiets some build warnings. PiperOrigin-RevId: 190958692
* Create useSkylarkSemantics for @SkylarkCallable, so annotated methods can ↵Gravatar cparsons2018-03-22
| | | | | | | | | | | specifically get a semantics object This is slightly redundant with useEnvironment, yes (as one can easily obtain the semantics object with Environment), but we intend on restricting useEnvironment so that structField=true methods cannot specify useEnvironment, but *can* specify useSkylarkSemantics. In general, we can also ween off non structField methods to use useSkylarkSemantics instead of useEnvironment in cases where this is feasible. RELNOTES: None. PiperOrigin-RevId: 190082547
* Add annotation-processor verification that only one of Param.type or ↵Gravatar cparsons2018-03-22
| | | | | | | Param.allowedTypes is used. RELNOTES: None. PiperOrigin-RevId: 190070309
* Force @SkylarkCallable Params with defaultValue = "None" to be noneable.Gravatar cparsons2018-03-20
| | | | | | | | Previously, usage was fairly inconsistent. From now on, if the @Param is mandatory, use defaultValue = "" instead. RELNOTES: None. PiperOrigin-RevId: 189777905
* Allow passing location, ast, and environment to @SkylarkCallable methodsGravatar cparsons2018-03-07
| | | | | RELNOTES: None. PiperOrigin-RevId: 188201686
* Change Skylark's print() on a rule target to print the Skylark-exposed ↵Gravatar cparsons2018-02-16
| | | | | | | | | provider keys. This change only affects printing a rule target directly -- it intentionally does not affect the behavior of str(target), as we want to avoid skylark code being able to parse potentially-private provider keys. RELNOTES: In skylark, print(target) now shows the provider keys of a target, as debug information. PiperOrigin-RevId: 186046226
* Create a basic annotation processor for validating SkylarkCallable uses at ↵Gravatar cparsons2018-02-12
| | | | | | | compile time. RELNOTES: None. PiperOrigin-RevId: 185432867
* Fix light typo in java docs.Gravatar dbabkin2017-12-14
| | | | | RELNOTES:none PiperOrigin-RevId: 179028810
* Break dependency on vfs from the interface of syntax and cmdline.Gravatar tomlu2017-11-06
| | | | | | | | These libs are exposed externally, implying that the vfs is also exposed externally. We break out PathFragment from vfs to still use this in their interface. This class is a much smaller dependency than the entire vfs. PiperOrigin-RevId: 174729373
* Remove deprecated legacy string representations of Skylark objectsGravatar vladmos2017-10-13
| | | | | | | | RELNOTES[INC]: The flag --incompatible_descriptive_string_representations is no longer available, old style string representations of objects are not supported anymore. PiperOrigin-RevId: 171952621
* Make SkylarkValue instances mutable by defaultGravatar vladmos2017-07-11
| | | | | | | | | | Simplify the code by providing the default implementation of `SkylarkValue$isImmutable` that always returns false. All objects are considered mutable unless their `isImmutable` method is overridden. This change doesn't affect the current behavior. PiperOrigin-RevId: 161422029
* Clean up string representations for labelsGravatar vladmos2017-07-05
| | | | | | | | | | | If --incompatible_descriptive_string_representations is passed, labels are converted to strings using `repr` differently: `Label("//package:name")` instead of `"//package:name"` This CL doesn't affect representations of other object types but provides the necessary infrastructure for it. PiperOrigin-RevId: 160955284
* Refactor PrinterGravatar vladmos2017-07-03
| | | | | | | It's now easier to customize Printer if in different situations objects should be printed differently. Also its API is cleaner now. Names of methods of SkylarkValue objects now reflect names of Skylark functions: SkylarkValue#repr and SkylarkPrintableValue#str. PiperOrigin-RevId: 160635154
* Fix broken linkGravatar Jon Brandvein2017-03-14
| | | | | | -- PiperOrigin-RevId: 149969486 MOS_MIGRATED_REVID=149969486
* Fix the documentation of set/depsetGravatar Vladimir Moskva2017-02-14
| | | | | | -- PiperOrigin-RevId: 147456653 MOS_MIGRATED_REVID=147456653
* Fix links for provider and configuration fragment docsGravatar Googler2016-11-16
| | | | | | | Change it to use relative links so it works for different deployments, and have the link for providers note that providers are attributes of a Target, not of ctx. -- MOS_MIGRATED_REVID=139207051
* Change our URL to bazel.buildGravatar Damien Martin-Guillerez2016-10-28
| | | | | -- MOS_MIGRATED_REVID=137500893
* Refactor getParentWithSkylarkModule() into SkylarkInterfaceUtilsGravatar Jon Brandvein2016-10-13
| | | | | -- MOS_MIGRATED_REVID=135956016
* Make EvalUtils.getDataTypeNameFromClass() look for @SkylarkModules in parent ↵Gravatar Jon Brandvein2016-10-12
| | | | | | | | | classes This is needed to let subclasses of @SkylarkModules have the same type() string as their superclass, without requiring a second annotation for the subclass. -- MOS_MIGRATED_REVID=135814343
* Rollback of commit 9c25afe750a937b2152c21a93effc8b9ba82c27b.Gravatar Ulf Adams2016-10-11
| | | | | | | | | | | | | | | *** Reason for rollback *** Seems to break some parts of aspects. *** Original change description *** Make EvalUtils.getDataTypeNameFromClass() look for @SkylarkModules in parent classes This is needed to let subclasses of @SkylarkModules have the same type() string as their superclass, without requiring a second annotation for the subclass (which would lead to redundant documentation being generated). -- MOS_MIGRATED_REVID=135786137
* Make EvalUtils.getDataTypeNameFromClass() look for @SkylarkModules in parent ↵Gravatar Jon Brandvein2016-10-05
| | | | | | | | | classes This is needed to let subclasses of @SkylarkModules have the same type() string as their superclass, without requiring a second annotation for the subclass (which would lead to redundant documentation being generated). -- MOS_MIGRATED_REVID=135161653
* Refactor getAnnotationFromParentClass() to a new SkylarkInterfaceUtils moduleGravatar Jon Brandvein2016-10-05
| | | | | -- MOS_MIGRATED_REVID=135144084
* Replace js provider methods with named parameters.Gravatar Pedro Liberal Fernandez2016-08-29
| | | | | -- MOS_MIGRATED_REVID=131576962
* Enable named arguments for SkylarkCallable annotationGravatar Damien Martin-Guillerez2016-08-04
| | | | | | | | | | This just add the support on the Skylark side, the documentation generator still needs to be updated. -- Change-Id: Ic26547cdb8d2c5c01839a4014c10f1b9b209b92b Reviewed-on: https://bazel-review.googlesource.com/#/c/4247/ MOS_MIGRATED_REVID=129328278
* Fix a broken linkGravatar Googler2016-07-29
| | | | | -- MOS_MIGRATED_REVID=128755445
* Display all allowed types for SkylarkSignature Params that allow multipleGravatar David Chen2016-07-05
| | | | | | | | | | | | | | | | | | | types. Fixes #921 Certain parameters, such as the `executable` and `command` parameters of ctx.action, allow multiple types. However, the allowed types are not enumerated in the SkylarkSignature annotation, causing the generated Skylark Library document to not display any type information for those params. This change adds a new field, `allowedTypes`, to `SkylarkSignature` that is a list of `ParamType` objects. If the param can accept multiple types, then `type` is set to `Object.class`, and `allowedTypes` is set to the list of types that can be accepted. -- MOS_MIGRATED_REVID=126617047
* Reorganize Skylark Reference documentation.Gravatar Dmitry Lomov2016-06-29
| | | | | -- MOS_MIGRATED_REVID=126081020