gpt4 book ai didi

ant - 自动化 Ant 构建 - 任何发现文件系统中的更改以触发构建的开源项目?

转载 作者:行者123 更新时间:2023-12-04 05:58:18 25 4
gpt4 key购买 nike

有没有人发现任何根据文件系统更改自动启动 ant 构建过程的方法?

我基本上希望我的 ant 构建系统开始构建类似于 IDE(编译 java 类),但是来自某种命令行服务。

如果没有,总是用 Java 编写一个代码并将 Ant API 集成到其中。

我熟悉 Jenkins 等持续集成系统,但是我需要触发构建而不是 checkin 。我也希望它独立于 IDE,因为这可以在保存后工作。

我正在寻找没有源代码控制要求的独立构建服务。

最佳答案

由于您使用的是 ant,因此我假设基于 Java 的目录轮询程序会有所帮助。您可以使用 IO notification api 编写程序

页面注释

When to Use and Not Use This API

The Watch Service API is designed for applications that need to be notified about file change events. It is well suited for any application, like an editor or IDE, that potentially has many open files and needs to ensure that the files are synchronized with the file system. It is also well suited for an application server that watches a directory, perhaps waiting for .jsp or .jar files to drop, in order to deploy them.

This API is not designed for indexing a hard drive. Most file system implementations have native support for file change notification. The Watch Service API takes advantage of this support where available. However, when a file system does not support this mechanism, the Watch Service will poll the file system, waiting for events.



编辑

在我写下这个问题及其答案之后,这里似乎更有用: Is there a sophisticated file system monitor for Java which is freeware or open source?

关于ant - 自动化 Ant 构建 - 任何发现文件系统中的更改以触发构建的开源项目?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9235663/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com