LoginSignup
0
0

More than 5 years have passed since last update.

Haxe でファイルリストをソースに埋め込むマクロ

Posted at

書いたけど結局使わなそうなので張っておきます。
(JSでクラスの動的読み込み的な事がしたかった)

haxe
class Files {

    macro
    public static function files(path:Expr):Expr
    {
        return macro sys.FileSystem.readDirectory($path);
    }

    static function main() {
        var files = files('/target/path/');
        trace(files);
    }
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0