{"push_id":2423042470,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"32f7a9f2083fac8865f6b10769cbb29f2696fad8","before":"1b5d17092c7c3cbeda9082de8ec6495e67640d5f","commits":[{"sha":"32f7a9f2083fac8865f6b10769cbb29f2696fad8","author":{"name":"Todd Volkert","email":"b3d8d82aebeed9f4b7550f411920404bffbad98b@users.noreply.github.com"},"message":"Update `make_dart_context` to take `data` as a list of targets rather than (#174)\n\na list of files.\r\n\r\nThis change updates `make_dart_context` such that `data` is now a list of\r\ntargets rather than a list of files.  References to those targets are\r\nmaintained and exposed in the `transitive_data` struct field so that callers\r\nmay in turn access the providers of those targets.\r\n\r\nMost of the time, however, callers of `dart_ctx.transitive_data` still just\r\nwant the files (to add it to their runfiles, for example).  So for both\r\ncaller convenience and efficiency, `make_dart_context` still maintains the\r\ndepset as well.  It now exposes the `transitive_data` struct field as follows:\r\n\r\n-- Before\r\n\r\n    struct(\r\n        ...\r\n        transitive_data = <depset>,\r\n    )\r\n\r\n-- After\r\n\r\n    struct(\r\n        ...\r\n        transitive_data = struct(\r\n            targets = {<label_name>: <target>},\r\n            files: <depset>,\r\n        ),\r\n    )\r\n\r\nFor an attempt at API consistency, this CL updated any property of the\r\n`dart_ctx` struct whose name matches \"transitive_*\" to follow the same\r\npattern, but to omit the dict or depset if it doesn't apply.  So we have:\r\n\r\n    struct(\r\n        ...\r\n        transitive_srcs = struct(\r\n            targets = {<label_name>: <target>},\r\n            files = <depset>,\r\n        ),\r\n        transitive_dart_srcs = struct(\r\n            files = <depset>,\r\n        ),\r\n        transitive_data = struct(\r\n            targets = {<label_name>: <target>},\r\n            files = <depset>,\r\n        ),\r\n        transitive_deps = struct(\r\n            targets = {<label_name>: <target>},\r\n        ),\r\n        transitive_archives = struct(\r\n            files = <depset>,\r\n        ),\r\n    )\r\n\r\nYou'll notice above that `transitive_srcs`, which used to be a depset, now\r\ncontains both the dict and the depset.  That's because in at least one\r\nplace, we were taking the transitive sources from a dart context and passing\r\nthem as data to `dart_vm.binary_action` (which in turn passed the data\r\nthrough to `make_dart_context`).  Thus, `transitive_srcs` needs to expose\r\nthe targets as well, which in turn means that the `srcs` argument to\r\n`make_dart_context` needs to accept a list of targets.\r\n\r\nThe tricky part about `srcs`, however, is that we can't force the attribute\r\nto only contain targets; sometimes, generated outputs (which have no targets)\r\nexist in this list.  To deal with this, this CL introduces a new parameter to\r\n`make_dart_context`: `generated_srcs`, which is a list of File.  In the case\r\n`generated_srcs`, they simply won't contribute to the `transitive_srcs.targets`\r\nreturn value.","distinct":true,"url":"https://api.github.com/repos/dart-lang/rules_dart/commits/32f7a9f2083fac8865f6b10769cbb29f2696fad8"}]}
{"actor":{"display_login":"natebosch"}}