I’ve been sick the last few days, and figured i’d learn Gradle. I created a Gradle based libgdx template, which you can start using now. It will eventually replace our current Setup-UI to make my life more enjoyable. IT will also allow you to build and run your libgdx projects on the CLI, Eclipse, IntelliJ and even Netbeans. And on top of that, you’ll not have to juggle any JARs or native libraries anymore, everthing is taken care off for you. You can update to different version of gdx, and easily include extensions or other 3rd party libraries. So, what is this magical Gradle?
我最近几天一直在生病,设想我学习Gradle.我创建了一个基于libgdx模板的Gradle,你现在能启动。它现在就可以开始使用,它最终将替代我们目前的setup-ui,使我的生活更有趣。它也将允许你构建和允许你的libgdx工程在CLI,Eclipse,IntelliJ和Netbeans.而最重要的是,你将不必在任何JARs或者更多本地库之间周旋,每一件事情将为你小心关闭。你能更新到不同libgdx版本,并且容易包含扩展的或其他第三方库。那么,这个神奇的Gradle是什么呢?
Gradle is a build and dependency management system, using Groovy and some domain specific language sugar. A build system is responsible for compiling your application and packaging it up. A dependency management system allows you to define which 3rd party libraries you want to use, and the system will automatically pull those libraries in for you. Provided the libraries are available in some sort of repository. The most established type of repository in Java land are Maven repositories, with Maven Central being the global central hub to which almost all things get published to.
Gradle是构建和依赖管理系统,用Groovy和一些特定域的语言sugar.构建系统是负责编译你的应用程序和打包。一个依赖管理系统允许你定义你想用的第三方库,且系统将自动为你放那些库。准备的库是可用的在一些资源库里。历史最悠久的库在Java领地和Maven资源库,Maven中央仓库,几乎所有的事情都发布在全球中央仓库。
Here’s what defining such dependencies looks like in Gradle for a libgdx project that also uses the FreeType and Bullet extensions (no GWT and iOS yet):
下面是定义了一个libgdx工程在Grdle的许多依赖是什么,也用于FreeType和Bullet扩展(还没有GWT和iOS)。