Skip to content

Conversation

stnguyen90
Copy link
Contributor

What does this PR do?

The example.php we provide requires fiddling to select which SDK to build. This PR introduces a build script where you can pass arguments for which SDKs you want to build:

Test Plan

# install dependencies $ docker run --rm --interactive --tty \ --volume $PWD:/app \ composer update --ignore-platform-reqs --optimize-autoloader --no-plugins --no-scripts --prefer-dist # check usage $ docker run --rm -v $(pwd):/app -w /app php:8.1-cli php build.php Usage: php example.php <platform> [<sdk1> <sdk2> ...] <platform> The platform you want to generate the SDK for. Supported platforms: client, console, server <sdk> The SDK you want to generate. Supported SDKs: android, apple, flutter, web, cli, dart, deno, dotnet, kotlin, node, php, python, ruby, swift If no SDKs are provided, all SDKs for the specified platform will be generated. # build dart and dotnet server SDKs $ docker run --rm -v $(pwd):/app -w /app php:8.1-cli php build.php server dotnet dart Example SDKs generated successfully $ ls -la examples total 0 drwxr-xr-x 4 steven staff 128 Jun 23 14:41 . drwxr-xr-x 33 steven staff 1056 Jun 23 14:41 .. drwxr-xr-x 13 steven staff 416 Jun 23 14:41 dart drwxr-xr-x 9 steven staff 288 Jun 23 14:41 dotnet

Related PRs and Issues

None

Have you read the Contributing Guidelines on issues?

None

@stnguyen90 stnguyen90 requested a review from lohanidamodar June 23, 2023 21:43
@stnguyen90
Copy link
Contributor Author

@lohanidamodar, what are your thoughts on replacing our example.php with this?

@lohanidamodar
Copy link
Member

@lohanidamodar, what are your thoughts on replacing our example.php with this?

I'm okay, if by default, when we don't provide any arguments it generates all possible SDKs like example.php. Can we make that happen?

@stnguyen90
Copy link
Contributor Author

I'm okay, if by default, when we don't provide any arguments it generates all possible SDKs like example.php. Can we make that happen?

@lohanidamodar, the example.php we currently have makes all sdks, but does it make sense to do that because you need to use the right specs for each sdk, right (server specs for node, console specs for CLI, etc)?

@lohanidamodar
Copy link
Member

I'm okay, if by default, when we don't provide any arguments it generates all possible SDKs like example.php. Can we make that happen?

@lohanidamodar, the example.php we currently have makes all sdks, but does it make sense to do that because you need to use the right specs for each sdk, right (server specs for node, console specs for CLI, etc)?

It makes sense to quickly to check all the SDKs, in build.php we could do is setup in a way that appropriate spec is used to generate all the SDKs.

@lohanidamodar
Copy link
Member

@stnguyen90 let's sync with latest test changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants