JNI 和 Java:ant 调用 make 还是 make 调用 ant? [英] JNI and Java: ant calling make or make calling ant?

查看:24
本文介绍了JNI 和 Java:ant 调用 make 还是 make 调用 ant?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我即将第一次进入 JNI(Java 本机接口)世界,以提供从特定于平台的 C/C++ 代码到 Java 的文件系统更改通知.除非有人建议我错过一些出色的图书馆来做这件事.

I'm just about to make my first trip into the world of JNI (Java Native Interface) to provide file system change notifications from platform specific C/C++ code to Java. That is unless someone suggest some brilliant library for doing this that I've missed.

作为 JNI 的新手,我设法在它的界面和库生成方面找到了很多文档,但我没有找到太多关于构建本机库的信息.

Being new to JNI I've managed to find much documentation on the interface side of it and library generation side of it, but I've not found much on building the native library.

我有一个基于 ant 的现有构建,用于预先存在的 Java 源代码,所以我正在尝试确定是否应该让 ant 调用 make 来创建库,或者最好让 make 调用创建库后的蚂蚁?

I've got an existing build based on ant for the pre-existing Java source, so I'm trying to work out if I should get ant to call make to create the library or if it's best to get make to call ant after creating the library?

这两个选项都不是特别好,但似乎都比试图让 ant 调用编译器来编译代码并直接生成库更好.

Neither option jumps out as being terribly nice, but both seem better than trying to get ant to call a compiler to compile the code and generate the library directly.

推荐答案

我非常不喜欢 make 因为它隐含的规则集和对空格的处理.我个人会使用 cpp 任务(http://ant-contrib.sourceforge.net/cpptasks/index.html) 来做我的 C 编译.它们不像 make 那样灵活,但也不那么复杂,这意味着您不必为学习 make 增加开发人员的负担.

I strongly dislike make because of its implicit ruleset and treatment of whitespace. Personally I would use cpp tasks (http://ant-contrib.sourceforge.net/cpptasks/index.html) to do my C compilation. They are not as flexible as make but they are also far less complex and it will mean you don't have to burden your developers with learning make.

这篇关于JNI 和 Java:ant 调用 make 还是 make 调用 ant?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆