Coder Social home page Coder Social logo

Comments (13)

tinesoft avatar tinesoft commented on July 3, 2024 1

Hi @danielesegato

Thanks for your response. I will have a closer look this weekend and let you know.

Stay tuned

from nxrocks.

tinesoft avatar tinesoft commented on July 3, 2024 1

Thanks for the updates.

Is it expected for build-aar to not run in flutter modules? (it only tried to run on the app module which doesn't have android libraries)

build-aar is only available when building for android platform.

(is there a way to specify if I want to use FVM or not via environmental flag? it would be useful to disable FVM on CI)

Right now, no. fvm is automatically used (instead of regular flutter) when it is found on the path. This is not configurable at the moment, but I agree, this can/should be configurable.

In the meantime, if you don't have fvm on your CI/CD, but just regular flutter binary, it should be good already

from nxrocks.

tinesoft avatar tinesoft commented on July 3, 2024

Hi @danielesegato

Thanks for using the plugin and for reporting this.

Can you please share me the content of your .env file (if present at root) and your nx.json + project.json files please?

from nxrocks.

danielesegato avatar danielesegato commented on July 3, 2024

Sure.

there's no .env file at the moment, it's a new project - mostly empty.

The nx.json in the root of the workspace:

{
  "extends": "nx/presets/npm.json",
  "$schema": "./node_modules/nx/schemas/nx-schema.json",
  "plugins": [
    {
      "plugin": "@nxrocks/nx-flutter",
      "options": {
        "analyzeTargetName": "analyze",
        "cleanTargetName": "clean",
        "formatTargetName": "format",
        "testTargetName": "test",
        "doctorTargetName": "doctor",
        "assembleTargetName": "assemble",
        "attachTargetName": "attach",
        "driveTargetName": "drive",
        "genL10nTargetName": "gen-l10n",
        "installTargetName": "install",
        "runTargetName": "run",
        "buildAarTargetName": "build-aar",
        "buildApkTargetName": "build-apk",
        "buildAppbundleTargetName": "build-appbundle",
        "buildBundleTargetName": "build-bundle",
        "buildIosTargetName": "build-ios",
        "buildIosFrameworkTargetName": "build-ios-framework",
        "buildIpaTargetName": "build-ipa"
      }
    }
  ],
  "targetDefaults": {}
}

And a project.info file in a module at apps/poc relative directory

{
  "name": "apps/poc",
  "$schema": "../../node_modules/nx/schemas/project-schema.json",
  "sourceRoot": "apps/poc/src",
  "tags": []
}

this is what was generated by the plugin, I just changed the name of the project to match the folder

from nxrocks.

tinesoft avatar tinesoft commented on July 3, 2024

Hi,

can you try changing the name to simply poc in project.json ?

I'm not sure "apps/poc" is valid. What matters to find the files is the "sourceRoot".

from nxrocks.

danielesegato avatar danielesegato commented on July 3, 2024

I've created a new project to test this out.

Run this command from the route:

npx nx g @nxrocks/nx-flutter:project

and chose these options:

✔ What name would you like to use? · foo
✔ What package name would you like to use? · foo
✔ What is the project about? · Testing NX-Flutter
✔ Which type of Flutter project would you like to create? · app
✔ Are you using Flutter Version Manager (fvm)? (y/N) · true
✔ What should be the project name and where should it be generated? · foo @ foo
✔ Which platforms would you like to use? · android, ios
✔ Which Android language would you like to use? · kotlin
✔ Which iOS language would you like to use? · swift
⚙️ Generating project configuration...
Generating Flutter project with following options : --project-name=foo --org=foo --description="Testing NX-Flutter" --android-language=kotlin --ios-language=swift --template=app --platforms="android,ios" ...
Executing command: fvm flutter create --project-name=foo --org=foo --description="Testing NX-Flutter" --android-language=kotlin --ios-language=swift --template=app --platforms="android,ios"  foo
Creating project foo...
Resolving dependencies in `foo`... 
Downloading packages... 
Got dependencies in `foo`.
Wrote 74 files.

All done!

still getting 0 projects run when trying to run a target.

I've also tried renaming the project just "poc" but that didn't help either.

from nxrocks.

tinesoft avatar tinesoft commented on July 3, 2024

Hi @danielesegato

Sorry for the delay.

This should be fixed now in the latest version of the create-nx-flutter.

If you've already generated your workspace, you can simply update the version of @nxrocks/nx-flutter package in the nx.json to latest version (i.e 9.0.3) and run any nx command ( for example ./nx reset && ./nx graph)

If the version of package, in the nx.json is set to latest (default setting), simply delete the node_modules folder within the .nx/installation folder. Then run any nx command ( for example ./nx reset && ./nx graph).

Either action should force the download of the right version of underlying @nxrocks/nx-flutter plugin, that contains the fix.

Enjoy!

from nxrocks.

danielesegato avatar danielesegato commented on July 3, 2024

Thanks @tinesoft yes I can confirm some of the tasks are now running.

I did npm upgrade to update to the latest version.

Is it expected for build-aar to not run in flutter modules? (it only tried to run on the app module which doesn't have android libraries)

(is there a way to specify if I want to use FVM or not via environmental flag? it would be useful to disable FVM on CI)

from nxrocks.

danielesegato avatar danielesegato commented on July 3, 2024

Hi @tinesoft I'm sorry, there's still some target not working:

npx nx run-many -t gen-l10n

produces:

 NX   Successfully ran target gen-l10n for 0 projects (15ms)

the same happen with, for example, the assemble target.

from nxrocks.

tinesoft avatar tinesoft commented on July 3, 2024

Hi @danielesegato

Inferred tasks depends on the type of project (template) your have generated, the target platforms you've chosen , etc...

The related code can be found here

Some of the values, are read at runtime from the .metadata file that is present at the root of each flutter project.

Can you show me the content of those files ?

from nxrocks.

danielesegato avatar danielesegato commented on July 3, 2024

core/auth .metadata

# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.

version:
  revision: "a14f74ff3a1cbd521163c5f03d68113d50af93d3"
  channel: "stable"

project_type: package

and apps/poc .metadata:

# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.

version:
  revision: "a14f74ff3a1cbd521163c5f03d68113d50af93d3"
  channel: "stable"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
  platforms:
    - platform: root
      create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
      base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
    - platform: android
      create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
      base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
    - platform: ios
      create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
      base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
    - platform: linux
      create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
      base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
    - platform: macos
      create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
      base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
    - platform: web
      create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
      base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
    - platform: windows
      create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
      base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3

  # User provided section

  # List of Local paths (relative to this file) that should be
  # ignored by the migrate tool.
  #
  # Files that are not part of the templates will be ignored by default.
  unmanaged_files:
    - 'lib/main.dart'
    - 'ios/Runner.xcodeproj/project.pbxproj'

both of them contains localizations and should be able to run the gen-l10n task.

and I'd expect all projects to be able to run the assemble task.

I see the code checks for this app template, not sure what's the logic behind that.

from nxrocks.

tinesoft avatar tinesoft commented on July 3, 2024

Hi,

You might be right about the gen-l10n and assemble tasks. I 'll review the conditions for all tasks.

As for the poc project (which is of template app), I'm surprised it was not picked when you run npx nx run-many -t gen-l10n...
Can you try running npx nx gen-l10n poc directly ?

from nxrocks.

danielesegato avatar danielesegato commented on July 3, 2024

Here it is @tinesoft

$ npx nx gen-l10n apps/poc --verbose

 NX   Cannot find configuration for task apps/poc:gen-l10n


Error: Cannot find configuration for task apps/poc:gen-l10n
    at ProcessTasks.createTask (/Volumes/sourcecode/[redacted]/node_modules/nx/src/tasks-runner/create-task-graph.js:156:19)
    at ProcessTasks.processTasks (/Volumes/sourcecode/[redacted]/node_modules/nx/src/tasks-runner/create-task-graph.js:23:39)
    at createTaskGraph (/Volumes/sourcecode/[redacted]/node_modules/nx/src/tasks-runner/create-task-graph.js:194:21)
    at createTaskGraphAndValidateCycles (/Volumes/sourcecode/[redacted]/node_modules/nx/src/tasks-runner/run-command.js:62:63)
    at /Volumes/sourcecode/[redacted]/node_modules/nx/src/tasks-runner/run-command.js:85:27
    at handleErrors (/Volumes/sourcecode/[redacted]/node_modules/nx/src/utils/params.js:9:30)
    at runCommand (/Volumes/sourcecode/[redacted]/node_modules/nx/src/tasks-runner/run-command.js:83:52)
    at Object.runOne (/Volumes/sourcecode/[redacted]/node_modules/nx/src/command-line/run/run-one.js:53:59)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async handleErrors (/Volumes/sourcecode/[redacted]/node_modules/nx/src/utils/params.js:9:24)

regarding the gen-l10n command it should only be available on projects and modules that have generation anabled and the l10n.yaml file I believe.

for the assemble one I'm not sure.

from nxrocks.

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.