beamable / BeamableProduct

The beamable product suite including com.beamable, com.beamable.server, microservice base image, portal, the installer, and build scripts
Other
3 stars 0 forks source link

CLI - SAMs project should use local CLI install #3473

Open cdhanna opened 3 weeks ago

cdhanna commented 3 weeks ago

Today, a .beamable workspace is a single folder... But we should include a sibling folder, .config that includes the idiomatic dotnet local tool config,

{
  "version": 1,
  "isRoot": true,
  "tools": {
    "beamable.tools": {
      "version": "2.0.0",
      "commands": [
        "beam"
      ]
    }
  }
}

The global version becomes a setup only version, to install SAMs. If you aren't using SAM, this whole convo is almost meaningless. The local version is the source-of-truth, and is defined by .config/dotnet-tools.json as a sibling to the .beamable folder.

dotnet-tools.json is the source of truth for the entire project for

  1. nuget packages,
  2. cli usages

SDK integrations are responsible for setting dotnet-tools.json. (From Unity, it'll come from versions-default.json, in UE it comes from ???)

Then, we need

  1. some sort of msbuild wizardry to keep the nuget package in-sync with the local tools version. Perhaps we use an msbuild property in the csproj that is auto-infered from the tool path.

If the user invokes the global CLI,

  1. at min, identify the error, and log an error.
  2. better yet, auto-correct the issue and proxy to the local CLI, but log a loud warning and don't do this step on --no-local-proxy or something.

all beamable versions are derived from the dotnet-tools.json file. Pedro has added msbuild wizardry to extract an msbuild property that is the version number in the json.

At engine integration, we need to have a .config folder that defines the CLI

cdhanna commented 2 weeks ago

the proxy of the global to local needs to be

  1. loud, and announce that it is happening, and mention
  2. there is a flag to disable it
PedroRauizBeamable commented 2 weeks ago

PR for it is here: https://github.com/beamable/BeamableProduct/pull/3490

All tests are passing locally, so... there's still needs some things to be done. Namely, getting GHA to play nicely with the new stuff as well as fixing any MacOS/Linux issues.