Skip to content

putraxor/tdffi-dev

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 ..
cd .. # tdffi-dev/
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

python generator/generate_dart.py
cd tdffi

# use 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


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

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

output locations:

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

example:

About

dart class generator for tdlib (td_api.tl)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 53.8%
  • Python 31.8%
  • C 14.4%