Your SlideShare is downloading. ×
0
ant-intellij-tasks: Automated build at your fingertips
ant-intellij-tasks: Automated build at your fingertips
ant-intellij-tasks: Automated build at your fingertips
ant-intellij-tasks: Automated build at your fingertips
ant-intellij-tasks: Automated build at your fingertips
ant-intellij-tasks: Automated build at your fingertips
ant-intellij-tasks: Automated build at your fingertips
ant-intellij-tasks: Automated build at your fingertips
ant-intellij-tasks: Automated build at your fingertips
ant-intellij-tasks: Automated build at your fingertips
ant-intellij-tasks: Automated build at your fingertips
ant-intellij-tasks: Automated build at your fingertips
ant-intellij-tasks: Automated build at your fingertips
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

ant-intellij-tasks: Automated build at your fingertips

1,932

Published on

An overview of ant-intellij-tasks (an open source, Ant-based build system for IntelliJ IDEA, see http://code.google.com/p/ant-intellij-tasks/).

An overview of ant-intellij-tasks (an open source, Ant-based build system for IntelliJ IDEA, see http://code.google.com/p/ant-intellij-tasks/).

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,932
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. ant-intellij-tasks<br />Automated build at your fingertips<br />tomer@tomergabel.com<br />http://code.google.com/p/ant-intellij-tasks/<br />
  • 2. Agenda<br />Mission statement<br />Architecture<br />Customization<br />Overview and limitations<br />Customizing tests<br />Customizing packaging<br />What’s next?<br />
  • 3. Mission statement<br />Developers typically employ at least three tools:<br />Code editor;<br />Project structure manager (modules, dependencies and compilation options);<br />Build system<br />In the Java world, the first two are typically handled by the IDE (Eclipse, IntelliJ IDEA etc.)<br />The build system is typically separate, and requires duplicating the project structure in the form of Ant or Maven scripts<br />
  • 4. Mission statement<br />Keeping two different project structure definitions means:<br />Duplication of effort;<br />Manual synchronization is error-prone;<br />Synchronization issues are often subtle, hard to detect and resolve<br />ant-intellij-tasks is an open source (Apache license) build system which complements IntelliJ IDEA and builds on its project structure.<br />
  • 5. Architecture<br />ant-intellij-tasks comprises three components:<br />ant-intellij-tasks.jar - Extends Ant with IntelliJ-IDEA-related tasks<br />common.xml - Provides common functionality (e.g. “build module”, “test module” etc.)<br />build-all.xml: A project-wide build script<br />Typically these three are enough to enable automated builds with no further customizations<br />
  • 6. Architecture<br />ant-intellij-tasks.jar is an Ant task library primarily capable of:<br />Parsing project (.ipr) and module (.iml) files<br />Resolving module build order<br />Per-module resolution of:<br />Source/test directories<br />Source/test output paths (relative, absolute or project-inherited)<br />Classpath<br />Resources<br />
  • 7. Architecture<br />common.xml implements the four classic build targets:<br />Clean module output<br />Build module – currently only Java is supported<br />Package module - currently only JARs and WARs are supported<br />Test module – currently only with JUnit. Test classes must follow the convention *Test.java, *Tests.java or Test*.java)<br />
  • 8. Architecture<br />build-all.xml extends the module targets to the entire project<br />Entire codebase can be built with one command:ant –f build-all.xml package<br />Modules are resolved and processed in the correct build order<br />A module can override the default behavior by providing its own build.xml<br />
  • 9. Customization<br />Typically the build is “customized” by tweaking the project settings within IntelliJ IDEA<br />It may, however, be necessary to additionally customize the build process<br />Typically this is done by adding a custom build.xml to a module directory<br />The four targets (clean, build, test, package) are then delegated to the custom script<br />Set the project-file property to the project file location<br />Override by defining a new target with the same name<br />Call the default script using<antcall target=“common.target” /><br />
  • 10. Customization: Tests<br />Maximum heap size can be set with the junit.maxmemory property. (The default is defined by junit.maxmemory.default)<br />Pass system properties by prefixing junit.propertiesto the system property name<br /><?xml version="1.0" encoding="UTF-8"?><br /><project><br /> <import file="../libraries/ant/common.xml" /><br /> <target name="test"><br /> <property name="project-file" location="../Delver.ipr" /><br /> <property name="junit.properties.lucene.version" value="2.9-dev" /><br /> <property name="junit.maxmemory" value="128m" /><br /> <antcall target="common.test" /> <br /> </target><br /></project><br />
  • 11. Customization: Limitations<br />ant-intellij-tasks was designed to resolve IntelliJ IDEA metadata files, and leave most of the heavy lifting to Ant<br />Due to time constraints, this design goal is not always met:<br />Global libraries are not supported<br />Packaged JARs and WARs cannot only be customized by tweaking the packaging instructions or manually manipulating the output<br />
  • 12. What’s next?<br />Cleanup<br />Better script documentation<br />Better JavaDocs<br />Significant work on test corpus<br />Apache license headers<br />Testing on Linux<br />Optimization<br />Caching parsed modules/projects<br />Reusing build artifacts if they’re up-to-date<br />Reusing build artifacts for packaging<br />
  • 13. Questions, comments and groans are welcome!<br />Visit the project page at http://code.google.com/p/ant-intellij-tasks/ or send feedback directly to tomer@tomergabel.com<br />

×