构建自定义 Java 库
我注意到许多 Javascript/jQuery 库允许开发人员自定义 .js 文件,因此仅包含最少的功能以节省带宽/页面加载时间。
现在,当我将 Java 库分发给客户时,有没有办法做同样的事情?如果客户只想使用几个类,我不喜欢强迫客户在他们的应用程序中包含一个大型库。
理想情况下,所有内容都将打包到一个漂亮的 JAR 文件中。
编辑:与此类似的内容: http://flowplayer.org/tools/download/index.html< /a>
I've noticed that a lot of Javascript/jQuery libraries allow developers to customize the .js file, thus including only the bare minimum functionality to save bandwidth/page load times.
Now when I'm distributing my Java library to clients, is there a way to do the same? I don't like forcing clients to have to include a large library in their application if they're only going to be using a few classes.
Ideally everything would be packaged into a nice JAR file.
EDIT: Something similar to this: http://flowplayer.org/tools/download/index.html
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
大多数混淆器(包括流行的 ProGuard)可以(并且默认情况下)从 jar 中消除未使用的方法和类。他们很好地检查了明显未使用的类是否未被主程序间接使用。
Most obfuscators (including the popular ProGuard) can (and by default will) eliminate unused methods and classes from the jar. They do a nice job of checking that apparently unused classes are not used indirectly by the main program.
这是 ProGuard 所做的事情之一。来自网站:
This is one of the things ProGuard does. From the website: