Coder Social home page Coder Social logo

playfab / sdkgenerator Goto Github PK

View Code? Open in Web Editor NEW
69.0 37.0 74.0 87.36 MB

SDK Generator, produces the source code for all PlayFab SDKs.

License: Apache License 2.0

JavaScript 8.77% C 0.01% C++ 3.04% C# 48.56% PowerShell 0.49% Batchfile 0.93% Makefile 0.03% Java 0.47% ActionScript 3.06% Python 0.29% Objective-C 2.54% Lua 2.21% Shell 2.61% TypeScript 3.42% EJS 20.70% HTML 2.87%

sdkgenerator's Introduction

PlayFab SDK Generator README

1. Overview:

This is an internal PlayFab tool, but not necessarily a "product". Feel free to use it as you need, but please note: We expect SdkGenerator users to be more tolerant of breaking changes and conflicts than we would with our SDKs.

This is a node.js based program that takes a json description of the PlayFab API and uses it to generate out all the different SDKs that must be kept up to date. This project also contains the sources for all PlayFab SDKs on all platforms. If you want to make a change in an SDK, this is where the change has to go.

2. Prerequisites:

  1. Any recent MS-Windows Operating System
  2. You must have Node.js installed: http://nodejs.org/
    • The location of node.exe must be in your PATH environment variable. Default: C:\Program Files (x86)\nodejs\
    • Highly suggested that you install Node.js tools for Visual Studio: https://beta.visualstudio.com/vs/node-js/
    • Note: If you have logged into another npm registry, you may get login errors when running npm login in this repository. Check your .npmrc file to ensure its empty since we pull from the public registery.
  3. SdkGenerator requires several PlayFab repositories, cloned to your local machine, as sibiling folders to SdkGenerator.
    • <parent-folder>/SdkGenerator = https://github.com/PlayFab/SDKGenerator (you're looking at it)
    • <parent-folder>/sdks/<targetSDK> - For every sdk you want to generate, you should git-clone the PlayFab repository for that target into the "sdks" subfolder first. In many cases, there are required files in the repo which are not generated
  4. [Optional] SdkGenerator can be configured to read from other PlayFab repositories, cloned to your local machine, as sibiling folders to SdkGenerator.

3. Usage Instructions:

If you have installed Node.js tools, then you can build any existing SDK from the Visual Studio solution: https://github.com/PlayFab/SDKGenerator/blob/master/SDKGenerator.sln

  • Open the solution
  • Set the Project Configuration to match the sdk you wish to build
  • Build -> Build Solution

There are many prebuilt scripts which can build each SDK automatically: https://github.com/PlayFab/SDKGenerator/tree/master/SDKBuildScripts

  • Find the script that matches the SDK you wish to build (EX unity_build.bat)
  • Double-click that file

If you wish to build an new sdk, you may need to build a new .bat file using the instructions in the next section.

Finally, to manually invoke the generator, open a command line at the root of the project and type:

node generate.js
    <targetName>=<targetOutputPath>
    -(apiSpecPath|apiSpecGitUrl|apiSpecPfUrl)[ (<apiSpecPath>|<apiSpecGitUrl>|<apiSpecPfUrl>)]
    [ -flags <flag>[ <flag> ...]]

You must supply a list of targets to generate, and the directory to generate them to. Each target takes the form:

<targetName>=<targetOutputLocation>

Where <targetName> is one of the supported SDK targets, and <targetOutputLocation> is a path to a directory to generate the SDK in. Note: Make sure there are no spaces between the arguments and the equals sign.

API-Spec Location:

  • You may optionally define exactly one location to read Api-Spec information
    • -apiSpecPath []
      • If the "-apiSpecPath" switch is defined without a path, this defaults to "../API_Specs" (relative path, sibling to SdkGenerator repo location)
    • -apiSpecGitUrl []
    • -apiSpecPfUrl []

Flags are optional, and can be used to generate console apis.

Example:

node generate.js unity-v2=../sdks/UnitySDK

4. Building a new SDK

Setting up a new target in the SdkGenerator is fairly simple. This example has been added to the SdkGenerator for reference: https://github.com/PlayFab/SDKGenerator/tree/master/targets/newTarget

  • Add a new subfolder in SdkGenerator/Targets
  • Add a "make.js" file to your new target
    • Implement makeClientAPI2, makeServerAPI, and/or makeCombinedAPI in the file, as shown in the NewTarget Example
    • Optionally, you may use template files and source files, as described in the NewTarget example.
  • Add a new bat-file to generate your sdk in SdkGenerator/SDKBuildScripts

PlayFab somtimes accepts submissions for new SDKs. This process is extensive, and it has to be integrated with our automated build and testing system. For more information contact us on the forums.

5. Troubleshooting:

For a complete list of available APIs, check out the online documentation.

Contact Us

We love to hear from our developer community! Do you have ideas on how we can make our products and services better?

Our Developer Success Team can assist with answering any questions as well as process any feedback you have about PlayFab services.

Forums, Support and Knowledge Base

6. Copyright and Licensing Information:

Apache License -- Version 2.0, January 2004 http://www.apache.org/licenses/ Full details available within the LICENSE file.

sdkgenerator's People

Contributors

alonsomondal avatar amccalib avatar benkatt avatar cobalt910 avatar ericxl avatar fineredmist avatar howardroeske avatar jayzuo avatar jeremy-playfab avatar jlyons1985 avatar joshuastrunk avatar jtonojimenez avatar m-pixel avatar marcowilliamspf avatar maryammadzadeh avatar melihceyhan avatar michaelmackendms avatar mtuska avatar nima-ap-zz avatar pgilmorepf avatar sanchitgarg avatar sini-codes avatar sivakatir avatar tculotta avatar tkgdbowen avatar toddbellmsft avatar veleek avatar vicodex avatar vishnuchoutapelly avatar waznop avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

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.