Giter VIP home page Giter VIP logo

Comments (7)

alorenzen avatar alorenzen commented on August 22, 2024

Do we want to support overriding commands like this, or would it be better to just bake support for flutter into the mono_repo tool?

I.e., if your pubspec specified the flutter sdk, then we would always run flutter packages get instead of pub get

from mono_repo.dart.

rrousselGit avatar rrousselGit commented on August 22, 2024

I think we should have both.
This issue is more about customizing.

Who knows, maybe you want a project to specify some custom arguments such as
--[no-]packages-dir

The fact that it helps with flutter support is just a side-effect

from mono_repo.dart.

kevmoo avatar kevmoo commented on August 22, 2024

Pull requests welcome!

from mono_repo.dart.

BenVercammen avatar BenVercammen commented on August 22, 2024

I'm trying to address this issue, in the way suggested by @alorenzen. In the pub method in tool/ci.sh I now check (grep) for sdk: flutter and if so, call flutter instead of pub.

This does of course require the user to install flutter, which I'm currently doing in a before_script in my mono_repo.yaml config.

I'll open a pull request for this asap.

from mono_repo.dart.

nstrelow avatar nstrelow commented on August 22, 2024

@BenVercammen Could you share a full example of how you are currently using mono_repo with flutter?

That would be very helpful, 😁

from mono_repo.dart.

BenVercammen avatar BenVercammen commented on August 22, 2024

@BenVercammen Could you share a full example of how you are currently using mono_repo with flutter?

So, my set up is nothing special:

  • /dart_package_1
    • mono_pkg.yaml
  • /dart_package_2
    • mono_pkg.yaml
  • /flutter_package
    • mono_pkg.yaml
  • /mono_repo.yaml

In the root folder of my project, I use the default mono_repo commands:

  • mono_repo pub get for dependencies
  • mono_repo generate to generate travis/CI script

There's really nothing special to it, I guess...

I do have a "trick" in order to make this work on Travis CI, in the before_script in my mono_repo.yaml file:

self_validate: analyzer_and_format

travis:
  branches:
    - master
    - develop
  before_script:
    - git clone https://github.com/flutter/flutter.git ${TRAVIS_HOME}/flutter-sdk -b master
    - export FLUTTER_SDK="${TRAVIS_HOME}/flutter-sdk"
    - export PATH="$FLUTTER_SDK/bin:$PATH"
    - export NO_PROXY=localhost,127.0.0.1
    - flutter doctor
  after_failure:
    - tool/report_failure.sh

merge_stages:
  - analyzer_and_format
  - ensure_build
  - unit_test

This script is taking care of setting up flutter on Travis CI before running the other scripts. Otherwise, my fix to call flutter pub get in stead of pub get will fail because flutter is not present.

I guess there is still some work to do if you also want to run flutter (integration) tests on Travis CI. However, for now this is enough for me. I'll probably also switch to codemagic in a while, as it is supposed to have better (out of the box?) support for testing and deploying flutter apps.

Hope this helps...

PS: of course, you'll need to have the latest release installed (4.0.0) for this to work.

from mono_repo.dart.

nstrelow avatar nstrelow commented on August 22, 2024

I see, thanks a lot :D

I am using github actions, so I do not have the option to define a before_script. not sure if there is an equivalent.

Besides that the Github Actions generated, execute:

run: pub upgrade --no-precompile

which fails ofc for my flutter app.
It should probably execute mono_repo pub instead.

Seems that is not happening in travis.

from mono_repo.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.