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

Contenu connexe

Plus de Tomer Gabel

Plus de Tomer Gabel (20)

Scala Refactoring for Fun and Profit (Japanese subtitles)
Scala Refactoring for Fun and Profit (Japanese subtitles)Scala Refactoring for Fun and Profit (Japanese subtitles)
Scala Refactoring for Fun and Profit (Japanese subtitles)
 
Scala Refactoring for Fun and Profit
Scala Refactoring for Fun and ProfitScala Refactoring for Fun and Profit
Scala Refactoring for Fun and Profit
 
Onboarding at Scale
Onboarding at ScaleOnboarding at Scale
Onboarding at Scale
 
Scala in the Wild
Scala in the WildScala in the Wild
Scala in the Wild
 
Speaking Scala: Refactoring for Fun and Profit (Workshop)
Speaking Scala: Refactoring for Fun and Profit (Workshop)Speaking Scala: Refactoring for Fun and Profit (Workshop)
Speaking Scala: Refactoring for Fun and Profit (Workshop)
 
Put Your Thinking CAP On
Put Your Thinking CAP OnPut Your Thinking CAP On
Put Your Thinking CAP On
 
Leveraging Scala Macros for Better Validation
Leveraging Scala Macros for Better ValidationLeveraging Scala Macros for Better Validation
Leveraging Scala Macros for Better Validation
 
A Field Guide to DSL Design in Scala
A Field Guide to DSL Design in ScalaA Field Guide to DSL Design in Scala
A Field Guide to DSL Design in Scala
 
Functional Leap of Faith (Keynote at JDay Lviv 2014)
Functional Leap of Faith (Keynote at JDay Lviv 2014)Functional Leap of Faith (Keynote at JDay Lviv 2014)
Functional Leap of Faith (Keynote at JDay Lviv 2014)
 
Scala Back to Basics: Type Classes
Scala Back to Basics: Type ClassesScala Back to Basics: Type Classes
Scala Back to Basics: Type Classes
 
5 Bullets to Scala Adoption
5 Bullets to Scala Adoption5 Bullets to Scala Adoption
5 Bullets to Scala Adoption
 
Nashorn: JavaScript that doesn’t suck (ILJUG)
Nashorn: JavaScript that doesn’t suck (ILJUG)Nashorn: JavaScript that doesn’t suck (ILJUG)
Nashorn: JavaScript that doesn’t suck (ILJUG)
 
Ponies and Unicorns With Scala
Ponies and Unicorns With ScalaPonies and Unicorns With Scala
Ponies and Unicorns With Scala
 
Lab: JVM Production Debugging 101
Lab: JVM Production Debugging 101Lab: JVM Production Debugging 101
Lab: JVM Production Debugging 101
 
DevCon³: Scala Best Practices
DevCon³: Scala Best PracticesDevCon³: Scala Best Practices
DevCon³: Scala Best Practices
 
Maven for Dummies
Maven for DummiesMaven for Dummies
Maven for Dummies
 
Scala in practice
Scala in practiceScala in practice
Scala in practice
 
SHC Israel: GigaSpaces Case Study
SHC Israel: GigaSpaces Case StudySHC Israel: GigaSpaces Case Study
SHC Israel: GigaSpaces Case Study
 
The Demoscene: A cursory introduction
The Demoscene: A cursory introductionThe Demoscene: A cursory introduction
The Demoscene: A cursory introduction
 
Video: What you never thought you might want to know
Video: What you never thought you might want to knowVideo: What you never thought you might want to know
Video: What you never thought you might want to know
 

Dernier

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Dernier (20)

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

ant-intellij-tasks: Automated build at your fingertips

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