{"action":"created","issue":{"url":"https://api.github.com/repos/google/grinder.dart/issues/104","labels_url":"https://api.github.com/repos/google/grinder.dart/issues/104/labels{/name}","comments_url":"https://api.github.com/repos/google/grinder.dart/issues/104/comments","events_url":"https://api.github.com/repos/google/grinder.dart/issues/104/events","html_url":"https://github.com/google/grinder.dart/issues/104","id":59288860,"number":104,"title":"Ability to export tasks from other libraries","user":{"login":"seaneagan","id":444270,"avatar_url":"https://avatars.githubusercontent.com/u/444270?v=3","gravatar_id":"","url":"https://api.github.com/users/seaneagan","html_url":"https://github.com/seaneagan","followers_url":"https://api.github.com/users/seaneagan/followers","following_url":"https://api.github.com/users/seaneagan/following{/other_user}","gists_url":"https://api.github.com/users/seaneagan/gists{/gist_id}","starred_url":"https://api.github.com/users/seaneagan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seaneagan/subscriptions","organizations_url":"https://api.github.com/users/seaneagan/orgs","repos_url":"https://api.github.com/users/seaneagan/repos","events_url":"https://api.github.com/users/seaneagan/events{/privacy}","received_events_url":"https://api.github.com/users/seaneagan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-27T20:21:41Z","updated_at":"2015-02-27T21:14:00Z","closed_at":null,"body":"```dart\r\n// useful_tasks.dart\r\n\r\n@Task(description: 'Useful.')\r\nuseful(GrinderContext context) {}\r\n\r\n@Task(description: 'Also useful.', depends: const [useful])\r\nalsoUseful(GrinderContext context) {}\r\n```\r\n\r\n```dart\r\n// tool/grind.dart';\r\nimport 'package:useful_tasks/useful_tasks.dart';\r\nexport 'package:useful_tasks/useful_tasks.dart';\r\n\r\nmain(args) => grind(args);\r\n\r\n@Task(depends: const [useful, alsoUseful])\r\nbuild(GrinderContext context) {}\r\n```\r\n\r\nYou cannot depend on tasks you do not export.\r\n\r\nIf you don't actually want to call the tasks by themselves, then you just call them within your task instead of depending on them:\r\n\r\n```dart\r\n// tool/grind.dart';\r\nimport 'package:useful_tasks/useful_tasks.dart';\r\n\r\nmain(args) => grind(args);\r\n\r\n@Task()\r\nbuild() {\r\n  useful(context);\r\n  alsoUseful(context);\r\n  // ...\r\n}\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/google/grinder.dart/issues/comments/76472828","html_url":"https://github.com/google/grinder.dart/issues/104#issuecomment-76472828","issue_url":"https://api.github.com/repos/google/grinder.dart/issues/104","id":76472828,"user":{"login":"devoncarew","id":1269969,"avatar_url":"https://avatars.githubusercontent.com/u/1269969?v=3","gravatar_id":"","url":"https://api.github.com/users/devoncarew","html_url":"https://github.com/devoncarew","followers_url":"https://api.github.com/users/devoncarew/followers","following_url":"https://api.github.com/users/devoncarew/following{/other_user}","gists_url":"https://api.github.com/users/devoncarew/gists{/gist_id}","starred_url":"https://api.github.com/users/devoncarew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devoncarew/subscriptions","organizations_url":"https://api.github.com/users/devoncarew/orgs","repos_url":"https://api.github.com/users/devoncarew/repos","events_url":"https://api.github.com/users/devoncarew/events{/privacy}","received_events_url":"https://api.github.com/users/devoncarew/received_events","type":"User","site_admin":false},"created_at":"2015-02-27T21:14:00Z","updated_at":"2015-02-27T21:14:00Z","body":"Cool.\r\n\r\nFrom experience with Ant scripts however (which may or may not translate over), this may not be a common use case. I suspect that the tasks will all be defined in the user's single script. Those tasks will likely be non-trivial functions, with will call out to other libraries using normal dart mechanisims. When they do need to take tasks from another grind script wholesale (at least for ant), you'll often just shell out to it."}}