Post by alandau on Oct 25, 2014 12:46:11 GMT -8
I recently added the necessary files for a Gradle-based build system in GGP-Base. This has a few benefits:
1) Gradle offers better support for building and running the code for anyone not running Eclipse. Currently we use Ant for this, which allows for some command-line building and running, but Gradle should allow for more and make them easier to write and configure. (Right now I'm looking for ways to appropriately replace ant tasks other than building the project, with the hopes of not needing to support ant builds in the future.) It also makes it easy to add IntelliJ IDEA support.
2) It makes it easier to standardize requirements for new commits, like checkstyle. Running 'gradle check' builds the codebase, runs all the tests, and runs any additional checks, and will work the same across platforms with no manual installation required.
Feel free to ask questions on this thread. Pre-emptive FAQ:
Will this change how I run the code in Eclipse?
No, at least not yet. The normal Gradle workflow would require Eclipse users to run 'gradlew eclipse' on the command line before importing the project or when the project configuration changes. For now, we're keeping the Eclipse project files (.classpath, .project, .settings/*) checked into git. This is intended to reduce the amount of effort needed for the typical student to get started with the project.
Do I need to install Gradle?
Running the gradlew file (or gradlew.bat on Windows systems) will automatically download the necessary Gradle files for the correct version if needed. It can be used to run any of the gradle commands; e.g. instead of running 'gradle build', you can run './gradlew build' and it will do the same thing, but does not need gradle to be manually installed.
Does this mean we're switching to getting library .jars from an online source, like Maven?
Not yet; I didn't want to inadvertently break anyone's workflows, and this would likely. However, Gradle supports this and we can consider it for the future.
How do I add a new (local) dependency?
Add the new .jar to the lib/ directory or a subdirectory, add the filename to the list of .jars in the build.gradle file, and then run 'gradlew eclipse' to add the new dependency to the .classpath file for Eclipse.
1) Gradle offers better support for building and running the code for anyone not running Eclipse. Currently we use Ant for this, which allows for some command-line building and running, but Gradle should allow for more and make them easier to write and configure. (Right now I'm looking for ways to appropriately replace ant tasks other than building the project, with the hopes of not needing to support ant builds in the future.) It also makes it easy to add IntelliJ IDEA support.
2) It makes it easier to standardize requirements for new commits, like checkstyle. Running 'gradle check' builds the codebase, runs all the tests, and runs any additional checks, and will work the same across platforms with no manual installation required.
Feel free to ask questions on this thread. Pre-emptive FAQ:
Will this change how I run the code in Eclipse?
No, at least not yet. The normal Gradle workflow would require Eclipse users to run 'gradlew eclipse' on the command line before importing the project or when the project configuration changes. For now, we're keeping the Eclipse project files (.classpath, .project, .settings/*) checked into git. This is intended to reduce the amount of effort needed for the typical student to get started with the project.
Do I need to install Gradle?
Running the gradlew file (or gradlew.bat on Windows systems) will automatically download the necessary Gradle files for the correct version if needed. It can be used to run any of the gradle commands; e.g. instead of running 'gradle build', you can run './gradlew build' and it will do the same thing, but does not need gradle to be manually installed.
Does this mean we're switching to getting library .jars from an online source, like Maven?
Not yet; I didn't want to inadvertently break anyone's workflows, and this would likely. However, Gradle supports this and we can consider it for the future.
How do I add a new (local) dependency?
Add the new .jar to the lib/ directory or a subdirectory, add the filename to the list of .jars in the build.gradle file, and then run 'gradlew eclipse' to add the new dependency to the .classpath file for Eclipse.