This is a tool for adding define macro definition to programming languages.

Related tags

Templates definetool
Overview

宏替换工具

English | 简体中文

这是一个为编程语言加入define宏定义的工具,用于实现对不同版本、不同平台进行区分,实现原理是利用宏注释不需要的代码,该工具理论上适用于任何编程语言。

使用方式

1.在代码中加入宏注释

    // #ifdef WINDOWS
    print("hello windows");
    // #endif

    // #ifdef WEB
    print("hello web");
    // #endif

2.在代码所在目录运行findtool工具,并定义宏:WINDOWS

这个命令可直接在本项目上操作来查看效果

    definetool -define WINDOWS 

在编译时若没有此宏,会将define与endif之间的内容进行/**/注释,若有宏,则进行解除注释。

宏内定义的内容不要使用多行注释

命令使用

-define 定义宏
-exdir 排除文件夹
-h 查看帮助

不足与限制

  1. 在#define与#endif之间不要使用多行注释/**/,yaml文件中#define与#endif之间不要使用#注释
  2. #与define之间不能出现空格
  3. 替换前的代码会备份为.bak文件,不过还是建议在执行替换前备份代码

默认排除文件夹:

bin build .git .svn debug release

打赏作者

打赏留言备注项目名+您的名字,您将出现在影子项目的赞助列表~ https://afdian.net/@fengdeyingzi

You might also like...

A UI library for easily adding audio waveforms to your apps, with several customization options

A UI library for easily adding audio waveforms to your apps, with several customization options

A UI library for easily adding audio waveforms to your apps, with several custom

Dec 11, 2022

Aris imageexmii - Learn everything about images such as adding filters, borders & different shapes

Aris imageexmii - Learn everything about images such as adding filters, borders & different shapes

Flutter Tutorial - 2/2 Image - Deep Dive Learn everything about images such as a

Dec 29, 2021

Docker images for the Dart programming language (https://dart.dev)

dart-docker This is the Git repo of the Docker "Official Images" for the Dart programming language. See the Docker Hub page for a full description on

Dec 14, 2022

This repository was created to provide the basics of the Dart programming language and Its use cases.

dart-exercises A collection of source code of the Dart Programming language. How does this repository works? Clone / Fork this repository to make your

Oct 28, 2021

Repo for Teach Yourself mastering dart programming language

mastering-dart Repo for Teach Yourself mastering dart programming language Chapter Membuat Aplikasi Pertama Menggunakan Dart Percabangan Perulangan Fu

Nov 10, 2022

Dart programming learning Files

dart_programming A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started

Nov 23, 2021

App concept created with Flutter using Dart programming language, inspired by Groceries Shopping App Interaction.

App concept created with Flutter using Dart programming language, inspired by Groceries Shopping App Interaction.

Grocery Shop Flutter App concept created with Flutter using Dart programming language, inspired by Groceries Shopping App Interaction. About The app w

Dec 9, 2022

The component created with Flutter using Dart programming language, inspired in Fluid Slider by Ramotion.

The component created with Flutter using Dart programming language, inspired in Fluid Slider by Ramotion.

Fluid Slider Flutter The component created with Flutter using Dart programming language, inspired in Fluid Slider by Ramotion. About The component was

Sep 30, 2022
Owner
fengdeyingzi
fengdeyingzi
An intuitive Token Parser that includes grammar definition, tokenization, parsing, syntax error and debugging. Implementation based on Lexical Analysis for Dart.

Token Parser An intuitive Token Parser that includes syntax/grammar definition, tokenization and parsing. Implementation based on Lexical Analysis. Re

JUST A SNIPER ツ 2 Dec 15, 2022
Z time ago - A simple Flutter z time ago package used to change date to time ago for english, arabic and kurdish languages

This package is used to get time duration from now and given time for kurdish, a

Zakarya Muhammad 2 May 19, 2022
A text field that displays text on different languages based on your selection.

translatable_text_field A text field that displays text on different languages based on your selection. Its basic idea is that you place this fields i

null 0 Mar 13, 2022
This is tool to create 3D Models which can be used in Flutter Applications. Tool is developed completely using Flutter.

three_d_model_tool A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you start

Shubham Yeole 2 Nov 8, 2022
Flutter plugin for selecting images from the Android and iOS image library, taking new pictures with the camera, and edit them before using such as rotation, cropping, adding sticker/text/filters.

advance_image_picker Flutter plugin for selecting multiple images from the Android and iOS image library, taking new pictures with the camera, and edi

Weta Vietnam 91 Dec 19, 2022
Following Along with a tutorial and adding differing customization to learn Dart and Flutter

flutter_ss_portfolio A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you sta

Midnight 0 Nov 28, 2021
A simple package for adding water drops to your Widgets!

Water Drop ?? ?? ?? A simple package for adding water drops to your Widgets! ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? Blog article with detailed explanation: htt

Marcin Szałek 46 Jun 30, 2022
This is a repository for Flutter Focused Menu, an easy to implement package for adding Focused Long Press Menu to Flutter Applications

Focused Menu This is an easy to implement package for adding Focused Long Press Menu to Flutter Applications Current Features Add Focused Menu to Any

Paras Jain 160 Dec 26, 2022
This is an easy to use Flutter Package for adding Fancy Foldable Sidebar to your Flutter Applications.

Foldable Sidebar An easy to implement Foldable Sidebar Navigation Drawer for Flutter Applications. Current Features Initial Release for Foldable Navig

Paras Jain 87 Nov 26, 2022
Small application where I worked with streams, firebase database, sorting, adding, modifying and deleting data.

messenger_app Small application where I worked with streams, firebase database, sorting, adding, modifying and deleting data. Features Provider: takin

Danil Shubin 2 Dec 19, 2021