Coder Social home page Coder Social logo

animeshxd / tdffi-dev Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 1.12 MB

dart class generator for tdlib (td_api.tl)

Home Page: https://animeshxd.github.io/tdffi-docs/

Python 31.90% C 14.14% Dart 53.96%
dart flutter tdlib telegram td telegram-api

tdffi-dev's Introduction

git clone --recurse-submodules [email protected]:animeshxd/tdffi-dev.git
cd tdffi-dev/

build tdlib https://github.com/tdlib/td#building

mkdir td/build
cd td/build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --target tdjson
cd ..
# setup for ffigen
cd .. # tdffi-dev/ (working directory)

mkdir -p headers/td/telegram/
cp td/build/td/telegram/tdjson_export.h headers/td/telegram/tdjson_export.h
cp td/td/telegram/td_json_client.h headers/td_json_client.h

dart pub global activate ffigen
# for termux: dart pub global activate ffigen -sgit https://github.com/animeshxd/ffigen

# you can remove with:
#   dart pub global deactivate ffigen
# tdffi-dev/ (working directory)

# generate 
#   dart ffi code from (td_json_client.h) 
#   dart classes from (td_api.tl)

python generator/generate_dart.py
cd tdffi

# generate files it in your own dart/flutter package
#
# dart/flutter create <your/package/location>
# DART_PACKAGE_DIR=<your/package/location> python generator/generate_dart.py
# cd <your/package/location>
# dart pub add ffi

dart pub get
# (Optional)
# generate dart ffi code (td_json_client.h)

# change output location in ffigen.yaml
# output: 'your/package/location/lib/.../td_json_client.dart'
# The output: location should be relative to ffigen.yaml or is absolute

# dart pub global run ffigen --config ../ffigen.yaml 
# or, dart pub global run ffigen --config <path/to/ffigen.yaml> 

output locations:

  • tdffi/lib/td.dart
  • tdffi/lib/src/generated/
  • json/

example:

tdffi-dev's People

Contributors

animeshxd avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

putraxor

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.