Apache Ant is a Java-based build tool similar to make. It uses XML configuration files and allows tasks to be executed based on targets. Key features include being cross-platform, extensible via Java, and using XML for configuration. Ant provides tasks to compile code, create archives, execute tests and more.
While CMake has become the de-facto standard buildsystem for C++, it's siblings CTest and CPack are less well known. This talk gives a lightspeed introduction into these three tools and then focuses on best practices on building, testing, and packaging.
An overview of how to consume 3rd party C++ libraries with CMake.
Methods covered include: find_package, pkg-config and writing a custom CMake Find Module.
While CMake has become the de-facto standard buildsystem for C++, it's siblings CTest and CPack are less well known. This talk gives a lightspeed introduction into these three tools and then focuses on best practices on building, testing, and packaging.
An overview of how to consume 3rd party C++ libraries with CMake.
Methods covered include: find_package, pkg-config and writing a custom CMake Find Module.
Drupal Camp Porto - Developing with Drupal: First StepsLuís Carneiro
The goal of this presentation is to give Drupal new comers some insights about key aspects of developing with Drupal.
The idea is to give the audience some guidelines about good practices of Drupal development along with some tips and, by a simple example application, present the most common and important structures/characteristics of the Drupal API.
Drupal 7 Theming - Behind the Scenes: PHP control flow starting from entering URL to browser displaying webpage. Covers Theme info file, regions, an Rendear Arrays (Phoenix User Group 1/25/2012)
This a really short and compact introduction to CMake mechanisum and common variables used. Showed in a simple groupe meeting of the REVES team of the INRIA Sophia Antipolis (France) to sudents/PhD.
Arcadian Learning is an Industrial Training Company with 50 years of Industry Expertise on Planning, Implementation and Operation of the Networks Offering six months Industrial Training program on Cloud Computing, Telecom, Big Data and Application Development.
The Android developer should have the knowledge of fundamentals of Android layouts, Widgets, UIs and Web Services & how to program your app’s interaction with activities and services.
http://www.arcadianlearning.com/application-web-development.html
Let ColdFusion ORM do the work for you!Masha Edelen
This intermediate to advanced session will show how to save development time in creating ColdFusion applications by leveraging ORM to achieve data persistency. Briefly going over the setup and CRUD functions we will concentrate on advanced ORM features that enable you to write less of better code.
ITPROceed 2016 - The Art of PowerShell ToolmakingKurt Roggen [BE]
Learn some best pratices and guidelines on building your own PowerShell toolset. Also discover some of the best kept secrets and how you can benefit from them.
Drupal Camp Porto - Developing with Drupal: First StepsLuís Carneiro
The goal of this presentation is to give Drupal new comers some insights about key aspects of developing with Drupal.
The idea is to give the audience some guidelines about good practices of Drupal development along with some tips and, by a simple example application, present the most common and important structures/characteristics of the Drupal API.
Drupal 7 Theming - Behind the Scenes: PHP control flow starting from entering URL to browser displaying webpage. Covers Theme info file, regions, an Rendear Arrays (Phoenix User Group 1/25/2012)
This a really short and compact introduction to CMake mechanisum and common variables used. Showed in a simple groupe meeting of the REVES team of the INRIA Sophia Antipolis (France) to sudents/PhD.
Arcadian Learning is an Industrial Training Company with 50 years of Industry Expertise on Planning, Implementation and Operation of the Networks Offering six months Industrial Training program on Cloud Computing, Telecom, Big Data and Application Development.
The Android developer should have the knowledge of fundamentals of Android layouts, Widgets, UIs and Web Services & how to program your app’s interaction with activities and services.
http://www.arcadianlearning.com/application-web-development.html
Let ColdFusion ORM do the work for you!Masha Edelen
This intermediate to advanced session will show how to save development time in creating ColdFusion applications by leveraging ORM to achieve data persistency. Briefly going over the setup and CRUD functions we will concentrate on advanced ORM features that enable you to write less of better code.
ITPROceed 2016 - The Art of PowerShell ToolmakingKurt Roggen [BE]
Learn some best pratices and guidelines on building your own PowerShell toolset. Also discover some of the best kept secrets and how you can benefit from them.
Zen and-the-art-of-build-script-maintenance-skillsmatterSkills Matter
Build scripts are an essential art in any software project. And yet they are so often fragile, brittle and unportable things, hard to understand and harder to maintain. In this talk, we cover what constitutes a good build script, and look at a few of the essential rules in writing one.
John Smart, creator of the Java Power Tools Bootcamp, will look at general techniques that are applicable to any build scripting technology, as well as some technology-specific tips for Ant and Maven.
Conferencia sobre los conceptos básicos de Angular.js dictada por Jeison Castañeda miembro del GDG Cali. El código fuente se encuentra en https://github.com/gdgcali/IntegrantesGDG
Some insights about how to get started architecting your Frontend applications and what technologies and tools are available in the market to make your life easier.
Java Performance Fundamental 세미나 교재입니다. 4장은 Class Loader를 다루고 있습니다. Class Loader란 무엇이고 Class가 어떻게 JVM안으로 들어와 메모리의 일부로 동작하는지에 대해 상세하게 설명하고 있습니다. 그리고 Java 5에서 새로 소개된 Class Sharing에 대해서도 다루고 있습니다.
* Class Loader
o Namespace
o Class Loader Delegation Model
o Class Sharing
* Class Loader Work
o Loading
o Linking
o Initialization
Confused by testing terms and jargon? This talk walks through testing web applications, explaining the difference between unit testing and end to end testing. Several tools and concepts are also explored through a demo section.
Sample projects can be found at https://github.com/sethmcl/testing_web_applications.
Ant is a Java library and command-line tool. Ant's mission is to drive processes described in build files as targets and extension points dependent upon each other. The main known usage of Ant is the build of Java applications. Ant supplies a number of built-in tasks allowing to compile, assemble, test and run Java applications. Ant can also be used effectively to build non Java applications, for instance C or C++ applications. More generally, Ant can be used to pilot any type of process which can be described in terms of targets and tasks.
Ant is written in Java. Users of Ant can develop their own "antlibs" containing Ant tasks and types, and are offered a large number of ready-made commercial or open-source "antlibs".
Ant is extremely flexible and does not impose coding conventions or directory layouts to the Java projects which adopt it as a build tool.
Software development projects looking for a solution combining build tool and dependency management can use Ant in combination with Ivy.
Ant is a Java library and command-line tool. Ant's mission is to drive processes described in build files as targets and extension points dependent upon each other. The main known usage of Ant is the build of Java applications. Ant supplies a number of built-in tasks allowing to compile, assemble, test and run Java applications. Ant can also be used effectively to build non Java applications, for instance C or C++ applications. More generally, Ant can be used to pilot any type of process which can be described in terms of targets and tasks.
Ant is written in Java. Users of Ant can develop their own "antlibs" containing Ant tasks and types, and are offered a large number of ready-made commercial or open-source "antlibs".
Ant is extremely flexible and does not impose coding conventions or directory layouts to the Java projects which adopt it as a build tool.
Software development projects looking for a solution combining build tool and dependency management can use Ant in combination with Ivy.
scmGalaxy.com is dedicated to software configuration, build and Release management. This covers CVS, VSS (Visual Source Safe),Perforce, SVN(Subversion) MKS Integrity, ClearCase,TFS,CM Synergy, Best Practices ,AnthillPro, Apache Ant, Maven, Bamboo, Cruise Control and many more tools.
File Can be downloaded from:
http://community.scmgalaxy.com/
Ant is a Java library and command-line tool. Ant's mission is to drive processes described in build files as targets and extension points dependent upon each other. The main known usage of Ant is the build of Java applications. Ant supplies a number of built-in tasks allowing to compile, assemble, test and run Java applications. Ant can also be used effectively to build non Java applications, for instance C or C++ applications. More generally, Ant can be used to pilot any type of process which can be described in terms of targets and tasks.
Ant is written in Java. Users of Ant can develop their own "antlibs" containing Ant tasks and types, and are offered a large number of ready-made commercial or open-source "antlibs".
Ant is extremely flexible and does not impose coding conventions or directory layouts to the Java projects which adopt it as a build tool.
Software development projects looking for a solution combining build tool and dependency management can use Ant in combination with Ivy.
Custom deployments with sbt-native-packagerGaryCoady
sbt-native-packager offers a comprehensive approach to packaging artifacts with SBT. The user describes a generic layout, which can then be extended for different types of software and deployments. For example, it is flexible enough to describe both a Zip-based archive format, and an RPM package with appropriate Systemd configuration for a service.
This talk will cover the essentials needed to understand the design of sbt-native-packager, and how to extend its structure to create custom layouts and deployments.
Once you're done coding, the project is all but finished. There are lots of tools to keep control over your code outside your IDE. Especially continuous integration tools are really helpfull for this purpose. Under the hood of a CI, or at commandline, Phing can be used for lots of PHP specific tasks that are usually executed within a CI. Phing is a sort of PHP version of the Apache Ant tool, which is neatly integrated with some handy PEAR packages. During this presentation you'll get a basic understanding about Phing and its features. We will walk through some examples and screens, so you get some basic knowledge about phing and in what type of fields it can be really usefull.
Simple Build Tool (sbt) is an open source build tool , It is a best choice for Scala projects that aims to do the basics well. It requires Java 1.6 or later.
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
Sudheer Mechineni, Head of Application Frameworks, Standard Chartered Bank
Discover how Standard Chartered Bank harnessed the power of Neo4j to transform complex data access challenges into a dynamic, scalable graph database solution. This keynote will cover their journey from initial adoption to deploying a fully automated, enterprise-grade causal cluster, highlighting key strategies for modelling organisational changes and ensuring robust disaster recovery. Learn how these innovations have not only enhanced Standard Chartered Bank’s data infrastructure but also positioned them as pioneers in the banking sector’s adoption of graph technology.
UiPath Test Automation using UiPath Test Suite series, part 5DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 5. In this session, we will cover CI/CD with devops.
Topics covered:
CI/CD with in UiPath
End-to-end overview of CI/CD pipeline with Azure devops
Speaker:
Lyndsey Byblow, Test Suite Sales Engineer @ UiPath, Inc.
Pushing the limits of ePRTC: 100ns holdover for 100 daysAdtran
At WSTS 2024, Alon Stern explored the topic of parametric holdover and explained how recent research findings can be implemented in real-world PNT networks to achieve 100 nanoseconds of accuracy for up to 100 days.
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfPaige Cruz
Monitoring and observability aren’t traditionally found in software curriculums and many of us cobble this knowledge together from whatever vendor or ecosystem we were first introduced to and whatever is a part of your current company’s observability stack.
While the dev and ops silo continues to crumble….many organizations still relegate monitoring & observability as the purview of ops, infra and SRE teams. This is a mistake - achieving a highly observable system requires collaboration up and down the stack.
I, a former op, would like to extend an invitation to all application developers to join the observability party will share these foundational concepts to build on:
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
Communications Mining Series - Zero to Hero - Session 1DianaGray10
This session provides introduction to UiPath Communication Mining, importance and platform overview. You will acquire a good understand of the phases in Communication Mining as we go over the platform with you. Topics covered:
• Communication Mining Overview
• Why is it important?
• How can it help today’s business and the benefits
• Phases in Communication Mining
• Demo on Platform overview
• Q/A
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
GridMate - End to end testing is a critical piece to ensure quality and avoid...ThomasParaiso2
End to end testing is a critical piece to ensure quality and avoid regressions. In this session, we share our journey building an E2E testing pipeline for GridMate components (LWC and Aura) using Cypress, JSForce, FakerJS…
GridMate - End to end testing is a critical piece to ensure quality and avoid...
Ant_quick_guide
1. ANT
Official ANT site:
− http://ant.apache.org
Wikipedia topic:
− http://en.wikipedia.org/wiki/Apache_Ant
2. ANT - Introduction
Apache Ant is a Java-based build tool. In
theory, it is kind of like make, without make's
wrinkles.
Don't worry about make if you don't know
what it is.
http://www.gnu.org/software/make/
− If you still want to know what make is.
3. ANT - Why?
Ant is cross-platform, you can use it any of
the commonly available OS like Windows,
Unix and Mac.
Ant can be extended by writing Java classes,
again the extensions are portable across
platform thanks to Java.
Configuration files are XML based –
commonly used configuration language.
4. ANT - Installation
The latest stable version of Ant is available
from the Ant web page http://ant.apache.org/
Setup
− Set the ANT_HOME environment variable to the
directory where you installed Ant.
− Add ANT_HOME/bin directory to your PATH
− Optionally, set the JAVA_HOME environment
variable. This should be set to the directory
where your JDK is installed.
5. Using ANT
Ant's build files are written in XML.
Each build file contains one project and at
least one (default) target.
Targets contain task elements.
Each task element of the build file can have
an id attribute and can later be referred to by
the value supplied to this (unique).
6. ANT buildfile
Ant's build file are named 'build.xml' and
stored in your project folder.
− NOTE: Ant's option -f or -buildfile can indicate
the build file with the name other than default
Example:
− /home/user/project_unix/build.xml
− C:Usersuserproject_winbuild.xml
ant -projecthelp
(prints all targets in build.xml)
7. buildfile <project> element
<project> is the root element. All build.xml
begins with this element.
<project name="MyProject" default="dist" basedir=".">
<description>
simple example build file
</description>
</project>
name, default and basedir are the 3
attributes of <project> element.
8. <project> element attributes
name
− The name of the project (can be anything)
default
− the default target to use when no target is
supplied.
basedir
− the base directory from which all path
calculations are done. If the property is not set,
the parent directory of the build file will be used.
9. buildfile <target> element
Each project defines one or more targets.
A target is a set of tasks you want to be
executed.
When starting Ant, you can select which
target(s) you want to have executed.
A target can depend on other targets.
10. buildfile <target> element
<project name="MyProject" default="dist" basedir=".">
<description>
simple example build file
</description>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure for compilation -->
<mkdir dir="${build}"/>
</target>
</project>
11. buildfile <property> element
A project can have a set of properties.
These might be set in the build file by the
property task, or might be set outside Ant.
A property has a name and a value; the
name is case-sensitive.
Value of a property may be used in the task
attributes by placing the property name
between "${" and "}" .
12. buildfile <property> element
<project name="MyProject" default="dist" basedir=".">
<description>simple example build file</description>
<!-- set global properties for this build -->
<property name="src" location="src"/>
<property name="build" location="build"/>
<property name="dist" location="dist"/>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used for compilation -->
<mkdir dir="${build}"/>
</target>
</project>
13. System Properties
Ant provides access to all system properties
as if they had been defined using a
<property> task.
System Properties such as..
− Key Description of Associated
Value
java.version Java Runtime Environment version
java.vendor Java Runtime Environment vendor
java.vendor.url Java vendor URL
java.home Java installation directory
− And many more system properties...
14. Built-in Properties
In addition, Ant has some built-in properties:
basedir = the absolute path of the project's basedir
(as set with the basedir attribute of <project>).
ant.file = the absolute path of the buildfile.
ant.version = the version of the executing Ant
ant.project.name = the value of the name attribute of
<project>.
ant.java.version = the JVM version Ant detected; for
example "1.4", "1.5" .
15. ANT Buildfile - Example
<project name="MyProj" default="dist" basedir="."> <target name="dist" depends="compile"
<description> description="generate the distribution" >
simple example build file <!-- Create the distribution directory -->
</description> <mkdir dir="${dist}/lib"/>
<!-- set global properties for this build -->
<property name="src" location="src"/> <!-- Put everything in ${build} into the Jar file -->
<property name="build" location="build"/> <jar jarfile="${dist}/lib/MyProj-20001128.jar"
<property name="dist" location="dist"/> basedir="${build}"/>
</target>
<target name="init">
<!-- Create the time stamp --> <target name="clean" description="clean up" >
<tstamp/> <!-- Delete the ${build} and ${dist} directory trees -->
<!-- Create the build directory structure for compiling --> <delete dir="${build}"/>
<mkdir dir="${build}"/> <delete dir="${dist}"/>
</target> </target>
</project>
<target name="compile" depends="init"
description="compile the source " >
<!-- Compile the java code from ${src} into ${build} -->
<javac srcdir="${src}" destdir="${build}"/>
</target>
16. Path-like structures
You can specify PATH and CLASSPATH
type references using both ":" and ";" as
separator characters. Ant will convert the
separator to the correct character of the
current operating system.
<classpath>
<pathelement path="${classpath}"/>
<pathelement location="lib/helper.jar"/>
</classpath>
17. Running ANT
running Ant from the command-line is simple:
just type ant .
− When no arguments are specified, Ant looks for a
build.xml file in the current directory and, if found,
uses that file as the build file and runs the target
specified in the default attribute of the <project> tag.
− To make Ant use a build file other than build.xml,
use the command-line option -buildfile
someFile.xml , where someFile.xml is the name of
the build file you want to use.
18. Running ANT - Options
ant [options] [target [target2 [target3] ...]] -buildfile <file> use given buildfile
-file <file> ''
Options: -f <file> ''
-help, -h print this message -D<property>=<value> use value for given
-projecthelp, -p print project help property
information -keep-going, -k execute all targets that
-version print the version information do not depend on failed target(s)
and exit -propertyfile <name> load all properties
-debug, -d print debugging from file with -D properties taking
information precedence
-lib <path> specifies a path to search -find <file> (s)earch for buildfile
for jars and classes towards the root of the filesystem and use
-logfile <file> use given file for log it
-l <file> '' -noclasspath Run ant without using
-logger <classname> the class which is to CLASSPATH
perform logging -main <class> override Ant's normal
entry point
19. Tasks
Task - a piece of code that can be executed.
− A task can have multiple attributes. The value of
an attribute might contain references to a
property. These references will be resolved
before the task is executed.
Tasks have a common structure:
<taskname attribute1="value1" attribute2="value2" ... />
− where taskname is the name of the task,
attributeN is the attribute name, and valueN is
the value for this attribute.
20. ANT Tasks - Categorized
Archive Tasks
Given the large
Audit/Coverage Tasks
Compile Tasks
number of tasks
Deployment Tasks
Documentation Tasks
available with Ant, it
EJB Tasks
Execution Tasks
may be difficult to
File Tasks
Java2 Extensions Tasks
get an overall view
Logging Tasks
Mail Tasks
of what each task
Miscellaneous Tasks
.NET Tasks
can do.
Pre-process Tasks
Property Tasks
Remote Tasks
SCM Tasks
Testing Tasks
21. ANT Tasks - Reference
Copy
Copy a single file
<copy file="myfile.txt"
− Copies a file or resource
tofile="mycopy.txt"/>
collection to a new file or
Copy a single file to a
directory.
directory
− By default, files are only <copy file="myfile.txt"
copied if the source file todir="../some/other/dir"/>
is newer than the
Copy a directory to another
destination file, or when directory
the destination file does <copy todir="../new/dir">
not exist. <fileset dir="src_dir"/>
− Note: overwrite attribute </copy>
will explicitly overwrite
files.
22. ANT Tasks - Reference
Delete
Delete a single file
<delete file="/lib/ant.jar"/>
− Deletes a single file, a
Delete a directory
specified directory and
<delete dir="lib"/>
all its files and
Deletes all files and
subdirectories, or a set
subdirectories of build,
of files specified by one
including build itself
or more resource <delete includeEmptyDirs="true">
collections. <fileset dir="build"/>
</delete>
23. ANT Core Tasks
Javac
Property
Java
LoadProperties
Copy
Import
Delete
Unzip
Mkdir
Unjar
Zip
Unwar
Jar
Tar
War
Untar
Ear
Signjar
Exec
Sleep
Echo
Sql
24. Tutorial – Hello World
Preparing the Hello World project
− We want to separate the source from the
generated files, so our java source files will be in
src folder. All generated files should be under
build, and there split into several sub-directories
for the individual steps: classes for our compiled
files and jar for our own JAR-file.
25. Hello World – Manual Steps
Manual not using Ant Compile :
javac -sourcepath src -d buildclasses
srctutorHelloWorld.java
Directory creation :
− mkdir src Run :
java -cp buildclasses tutor.HelloWorld
− mkdir buildclasses
Jar :
//HelloWorld.java echo Main-Class:
package tutor; tutor.HelloWorld>myManifest
public class HelloWorld { mkdir buildjar
public static void main(String[ ] args) { jar cfm buildjarHelloWorld.jar myManifest -C
System.out.println("Hello World"); buildclasses .
} java -jar buildjarHelloWorld.jar
}
26. Hello World – Manual to ANT
Manual to Ant - thinking the build process
Possible targets that evolved from the
previous example
− Compile
− Jar
− Run
Its a good practice to have a 'clean' target
− Clean
Let's write the build.xml in the next slides.
28. Hello World – Invoking Build
Now you can compile, package and run the
application via
− ant compile
− ant jar
− ant run
Or shorter with
− ant compile jar run
30. Hello World – Enhancing Build
Some for enhancements:
− many time referencing the same directories
− main-class and jar-name are hard coded
− the right order of build steps required to run.
The first and second point would be
addressed with properties, the third with a
special property - an attribute of the
<project>-tag and the fourth problem can be
solved using dependencies.
32. Hello World – Invoke New Build
Now it's easier, just do 'ant' and you will get
Buildfile: build.xml
clean:
compile:
[mkdir] Created dir: C:...buildclasses
[javac] Compiling 1 source file to C:...buildclasses
jar:
[mkdir] Created dir: C:...buildjar
[jar] Building jar: C:...buildjarHelloWorld.jar
run:
[java] Hello World
main:
BUILD SUCCESSFUL
33. ANT Core Types - PatternSet
PatternSet
− Patterns can be grouped to sets and later be
referenced by their id attribute. They are defined
via a patternset element, which can appear
nested into a FileSet or a DirSet.
− In addition, patternsets can be defined as a
stand-alone element at the same level as target -
i.e., as children of project as well as as children
of target.
34. ANT Core Types - PatternSet
PatternSet
<patternset id="non.test.sources">
<include name="**/*.java"/>
<exclude name="**/*Test*"/>
</patternset>
− Builds a set of patterns that matches all .java
files that do not contain the text Test in their
name. This set can be referred to via <patternset
refid="non.test.sources"/>, by tasks that support
this feature, or by FileSets.
35. ANT Core Types - Selectors
Selectors are a mechanism whereby the files
that make up a <fileset> can be selected
based on criteria other than filename as
provided by the <include> and <exclude>
tags.
− How to use a Selector - A selector is an element
of FileSet, and appears within it. It can also be
defined outside of any target by using the
<selector> tag and then using it as a reference.
36. Types – Available Selectors
<contains> - Select files that contain a
<present> - Select files that either do or
particular text string do not exist in some other location
<date> - Select files that have been
<containsregexp> - Select files that
modified either before or after a particular match a regular expression
date and time
<size> - Select files that are larger or
<depend> - Select files that have been smaller than a particular number of bytes.
modified more recently than equivalent
<type> - Select files that are either
files elsewhere regular files or directories.
<depth> - Select files that appear so
<modified> - Select files if the return
many directories down in a directory tree value of the configured algorithm is
<different> - Select files that are different different from that stored in a cache.
from those elsewhere
<signedselector> - Select files if they are
<filename> - Select files whose name signed, and optionally if they have a
matches a particular pattern. Equivalent signature of a certain name.
to the include and exclude elements of a
<scriptselector> - Use a BSF or JSR 223
patternset. scripting language to create your own
selector
37. Selector Examples - Contains
Here is an example of how to use the
Contains Selector:
<fileset dir="${doc.path}" includes="**/*.html">
<contains text="script" casesensitive="no"/>
</fileset>
− Selects all the HTML files that contain the string
script.
38. Selector Examples - Date
Here is an example of how to use the Date
Selector:
<fileset dir="${jar.path}" includes="**/*.jar">
<date datetime="01/01/2001 12:00 AM" when="before"/>
</fileset>
− Selects all JAR files which were last modified
before midnight January 1, 2001.
39. Selector Examples - Depend
Here is an example of how to use the
Depend Selector:
<fileset dir="${ant.1.5}/src/main" includes="**/*.java">
<depend targetdir="${ant.1.4.1}/src/main"/>
</fileset>
− Selects all the Java source files which were
modified in the 1.5 release.
40. ANT Core Types - FileSet
FileSet
− A FileSet is a group of files. These files can be
found in a directory tree starting in a base
directory and are matched by patterns taken
from a number of PatternSets and Selectors.
<fileset dir="${server.src}" casesensitive="yes">
<include name="**/*.java"/>
<exclude name="**/*Test*"/>
</fileset>
− Groups all files in directory ${server.src} that are Java source
files and don't have the text Test in their name.
41. FileSet using PatternSet
FileSet
− PatternSets can be specified as nested <patternset>
elements. In addition, FileSet holds an implicit PatternSet
and supports the nested <include>, <includesfile>,
<exclude> and <excludesfile> elements of PatternSet
directly, as well as PatternSet's attributes.
<fileset dir="${server.src}" casesensitive="yes">
<patternset id="non.test.sources">
<include name="**/*.java"/>
<exclude name="**/*Test*"/>
</patternset>
</fileset>
− Groups the same files as the above example, but also
establishes a PatternSet that can be referenced in other
<fileset> elements, rooted at a different directory.
42. FileSet using Selectors
FileSet
− Selectors are available as nested elements within the
FileSet. If any of the selectors within the FileSet do not
select the file, the file is not considered part of the
FileSet. This makes a FileSet equivalent to an <and>
selector container.
<fileset dir="${server.src}" casesensitive="yes">
<filename name="**/*.java"/>
<filename name="**/*Test*" negate="true"/>
</fileset>
− Groups all files in directory ${client.src}, using the
<filename> selector.
43. build.xml using build.properties
build.properties
JAVA_HOME=/usr/java/jdk1.6.0
NOTE:
PROJECT_PATH=.
− 'build.xml' can load
VERSION=0.73
SOURCE_PATH=${PROJECT_PATH}/src
BUILD_PATH=${PROJECT_PATH}/build
DIST_PATH=${PROJECT_PATH}/dist
'build.properties' by
CLASSES_PATH=$
property task
{BUILD_PATH}/classes/production/sted
TEST_CLASSES_PATH=$
<property file="build.properties"
{BUILD_PATH}/classes/test/sted
DEPLOY_PATH=${BUILD_PATH}/bin description="STED User Environment
STED.JAR_NAME=sted.jar
STED-WIDGETS.JAR_NAME=sted-widgets.jar Settings"/>
Or by using the
STED.JAR=${DEPLOY_PATH}/${STED.JAR_NAME}
−
STED-WIDGETS.JAR=${DEPLOY_PATH}/${STED-
WIDGETS.JAR_NAME}
STED.ZIP_NAME=sted-${VERSION}.zip
STED.ZIP=${DIST_PATH}/${STED.ZIP_NAME}
loadproperties task
STED-FULL.ZIP_NAME=sted-with-src-${VERSION}.zip <loadproperties
STED-FULL.ZIP=${DIST_PATH}/${STED-
FULL.ZIP_NAME} srcfile="build.properties" />
44. build.xml using build.properties
<project name="STED" default="init" basedir="."> <target name="copy.resource" depends="init">
<copy todir="${BUILD_PATH}" verbose="true">
<property file="build.properties" description="STED User <fileset dir="${PROJECT_PATH}" excludes="**/build/**,
Environment Settings"/> **/dist/**, **/test/**" defaultexcludes="true"/>
</copy>
<target name="init"> </target>
<tstamp/>
<!-- Create the directory structure for compile --> <target name="compile" depends="init"
<mkdir dir="${BUILD_PATH}"/> description="compiles source">
<mkdir dir="${CLASSES_PATH}"/> <javac srcdir="${SOURCE_PATH}" destdir="$
<echo message="Project Path: ${PROJECT_PATH}"/> {CLASSES_PATH}" deprecation="on" verbose="true">
<echo message="Source Path: ${SOURCE_PATH}"/> </javac>
<echo message="Classes Path: ${CLASSES_PATH}"/> <!-- HACK for development builds only -->
<echo message="Deploy Path: ${DEPLOY_PATH}"/> <!-- copy 'config' folder in classes. since ResourceBundle
<echo message="Jar Path: ${STED.JAR}"/> would fail -->
</target> <!-- Deployment does not require this hack, because
STED_HOME is set in classpath -->
<path id="SOURCE_PATH"> <copy todir="${CLASSES_PATH}" verbose="true">
<pathelement location="${SOURCE_PATH}"/> <fileset dir="${PROJECT_PATH}" includes="config/**"
</path> defaultexcludes="true"/>
</copy>
<path id="CLASS_PATH"> </target>
<pathelement location="${CLASSES_PATH}"/>
</path>
47. Summary
Ant is a cross-platform build tool for Java.
Ant uses XML based configuration file
typically named 'build.xml'.
Project, Targets and Tasks
− A build.xml would contain 1 project with one or
more targets and each of the target containing
one or more tasks.
Core and Optional tasks provided by Ant.
48. Resources
Official ANT site:
− http://ant.apache.org
ANT Manual:
− http://ant.apache.org/manual/index.html
Wikipedia topic:
− http://en.wikipedia.org/wiki/Apache_Ant
Example project:
− http://sted.svn.sf.net/viewvc/sted