Git Product home page Git Product logo

Comments (13)

sunglim avatar sunglim commented on May 1, 2024

I understand your opinion.

But we normally run tests by doing below..
cd test -> find a dart file that have main function.

So.. we can run dart test/all.dart. that's all.

updated: sorry I wrongly understand this issue.

from grinder.dart.

bgourlie avatar bgourlie commented on May 1, 2024

I would like to use pub run because it will run transformers. pub run grinder tests was just an example.

from grinder.dart.

devoncarew avatar devoncarew commented on May 1, 2024

We had been relying on a user-supplied script at the root of the project - grind.sh - which just delegated to tool/grind.dart. With the new pub global activate feature, we moved to installing bin/grind.dart and bin/grinder.dart on the user path, which delegate to the host project's tool/grind.dart and tool/grinder.dart scripts, respectively.

We could definitely use better docs about this though! Patches welcome :)

Some ways to run grinder currently:

  • pub global run grind tests
  • pub global activate grinder, then grind tests
  • dart tools/grind.dart tests

from grinder.dart.

bgourlie avatar bgourlie commented on May 1, 2024

So for some clarification, the build configuration should live in tools/grinder.dart or tools/grind.dart? Ultimately what I did, which works, is define my build (tasks, etc) in tools/grinder.dart and run pub run grinder:grinder tests. It is my understanding that this executes packages/grinder/bin/grinder.dart, which is finding my build config in tools/grinder.dart.

I will be happy to create a pull request once I have an understanding of how everything should work. I think the first thing to clarify is where the app's build configuration should live, and then the easiest way to run it via pub run.

from grinder.dart.

devoncarew avatar devoncarew commented on May 1, 2024

Yup, all the above sounds right. But, to re-state it:

  • user build scripts go in tool/grind.dart (or tool/grinder.dart)
  • the user needs to execute pub global activate ginder once - this downloads grinder and puts the two binaries on the path
  • the user can run grind foo or grinder foo (equivalent commands: pub global run grind foo / pub global run grinder foo)
  • the grinder command grind will look for and execute tool/grind.dart in the user's project; the grinder command will look for and execute tool/grinder.dart

Which all sounds a bit complicated, but the end goal is that the user can type grind foo in the root of their project, and have it execute the foo task in their build script.

from grinder.dart.

sethladd avatar sethladd commented on May 1, 2024

I'd love to have a single way to run the tool, and a single convention for the script name. Since the tool's repo is named grinder.dart, I'd vote for grinder

from grinder.dart.

devoncarew avatar devoncarew commented on May 1, 2024

+1 going down to one entrypoint. We can have a deprecated message print out for a while if you use the other entrypoint.

from grinder.dart.

bgourlie avatar bgourlie commented on May 1, 2024

Agreed. To actually run the tool, id prefer 'grind' just because a verb seems more appropriate. I'm indifferent as to the grind config name.

from grinder.dart.

devoncarew avatar devoncarew commented on May 1, 2024

I'd lean towards grind as well; grinder as the noun and grind as the verb. Plus, all the build scripts I've written have been named grind.

I'll make a change to deprecate bin/grinder.dart.

from grinder.dart.

bgourlie avatar bgourlie commented on May 1, 2024

Cool. I can start on a PR to improve the readme.

from grinder.dart.

sethladd avatar sethladd commented on May 1, 2024

grind works for me. Yay for a single way to do it! :)

from grinder.dart.

seaneagan avatar seaneagan commented on May 1, 2024

@devoncarew IMO It's still a bit confusing to have both grinder and grind. In particular it would be nice to use the same name whether using pub run or not, currently it's:

pub run grinder
grind

I prefer grind, but pub run grind would require changing the package name, which would mean deprecating the entire package, so I'd be fine having to run grinder.

from grinder.dart.

devoncarew avatar devoncarew commented on May 1, 2024

Yeah, I have in the past argued that the main executable for a package should have the same name as a package. There's always reasons to do something different (grinder uses grind; dart_style uses format), but there's a lot of value to the users in just knowing what the main executable should be given the package name.

I'll do a bit more noodling on this.

from grinder.dart.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.