Software Building (Sestavování aplikací)

Similar documents
Software Building (Sestavování aplikací)

Autotools and GNU Build system

July 8, 2007 Jim Huang (jserv)

How To Create a GNU Autoconf / Automake Based Configure Script for Your Application Under Construction

Beyond Makefiles: Autotools and the GNU Build System

Build automation. CSE260, Computer Science B: Honors Stony Brook University

COMP 2400 UNIX Tools

JAVA V Tools in JDK Java, winter semester ,2017 1

Construction: version control and system building

gradle : Building Android Apps Mobel Meetup

The Makefile utility. (Extract from the slides by Terrance E. Boult

Maven POM project modelversion groupid artifactid packaging version name

Why Use the Autotools?...xviii Acknowledgments... xx I Wish You the Very Best... xx

Autotools Tutorial. Mengke HU. ASPITRG Group Meeting. ECE Department Drexel University

... Fisheye Crucible Bamboo

DevOps and Maven. Eamonn de Leastar Dr. Siobhán Drohan Produced by:

Make was originally a Unix tool from 1976, but it has been re-implemented several times, notably as GNU Make.

Build Automation Kurt Christensen

GNU Automake. For version , 1 February David MacKenzie Tom Tromey Alexandre Duret-Lutz

Package Management and Build Tools

JAVA V Annotations Java, winter semester ,2016 1

Software Building (Sestavování aplikací)

The WAF build system

JAVA. Java Management Extensions JMX

Produced by. Agile Software Development. Eamonn de Leastar

NetCDF Build and Test System. Ed Hartnett, 1/25/8

MAVEN MOCK TEST MAVEN MOCK TEST I

Simplified Build Management with Maven

ESTABLISHED Paul Kunz SLAC. Overview. Examples. Expose the downsides. Benefits. Risks and Costs. Building with Automake 1 Paul F.

The GNU configure and build system

GUI Programming with GTK+

Maven in the wild. An introduction to Maven

... Maven.... The Apache Maven Project

FOLLOW ALONG WITH THE EXAMPLES


GNU Autotools Tutorial

Study of tools used in build process

EPL451: Data Mining on the Web Lab 6

CS354R: Game Technology

These steps may include:

Session 24. Spring Framework Introduction. Reading & Reference. dev.to/lechatthecat/how-to-use-spring-boot-java-web-framework-withintellij-idea-202p

Maven Introduction to Concepts: POM, Dependencies, Plugins, Phases

Development Tools. Akim D le Roland Levillain June 14, 2012

Autoconf Tutorial. Mark Galassi

MAVEN MOCK TEST MAVEN MOCK TEST IV

Maven. INF5750/ Lecture 2 (Part II)

MAVEN INTERVIEW QUESTIONS

MANUAL DO ALUNO DE ENGENHARIA DE SOFTWARE

Set up Maven plugins in Eclipse. Creating a new project

4. Check the site specified in previous step to work with, expand Maven osgi-bundles, and select slf4j.api,

maven Build System Making Projects Make Sense

Hello Maven. TestNG, Eclipse, IntelliJ IDEA. Óbuda University, Java Enterprise Edition John von Neumann Faculty of Informatics Lab 2.

Software Engineering - Development Infrastructure 2. Kristjan Talvar Nortal

Code Generators for MySQL Plugins and User Defined Functions. Hartmut Holzgraefe

CONFIGURING YOUR PROJECT WITH AUTOCONF

Build Tools. Software Engineering SS 2007

AUTOMATION TESTING FRAMEWORK FOR LUMINOUS LMS

What is Maven? Apache Maven is a software project management and comprehension tool (build, test, packaging, reporting, site, deploy).

GLIMMER, Version Control and Build Systems

DePloying an embedded ERLANG System

C++ Binary Dependency Management with Gradle. Hugh Greene

Managing Code Variants

Managing Code Variants

DataTAG Advance Reservation WP2 Database Management in GARA

Build Tools. Software Engineering SS A tool was needed. Agenda for today. Build tools. Software complexity. Build tools

Construction: version control and system building

Introducere in Maven. Information Type: Working Standard, Disclosure Range:, Information Owner: mihai.hulea, NTT DATA Romania

Apache Maven. Created by anova r&d bvba

Maemo Diablo Reference Manual for maemo 4.1. GNU Build System

Action Developers Guide

Setting up a Maven Project

Packaging, automation, Continuous Integration

Make: a build automation tool 1/23

Content. Development Tools 2(57)

Developing ONOS Apps

Introduction to Supercomputing

Topics covered. Introduction to Maven Maven for Dependency Management Maven Lifecycles and Plugins Hands on session. Maven 2

simple software flow analysis using GNU cflow

Make: a build automation tool

Unit Testing. CS 240 Advanced Programming Concepts

CMPT 300. Operating Systems. Brief Intro to UNIX and C

Struts 2 Maven Archetypes

Pour aller plus loin : Programmation outillée

Why switch exist-db from Ant to Maven?

Effective Testing of Local Git Branches Using Remote Execution

Hello Gradle. TestNG, Eclipse, IntelliJ IDEA. Óbuda University, Java Enterprise Edition John von Neumann Faculty of Informatics Lab 2.

Functional Testing (Testování funkčnosti)

AUTOTOOLS GNU AUTOCONF, AUTOMAKE, A N D LIBTOOL JOHN CALCOTE.

Build. System building

Component based Development. Table of Contents. Notes. Notes. Notes. Web Application Development. Zsolt Tóth

COSC345 Software Engineering. Make

HP Operations Orchestration

Groovy. Extending Java with scripting capabilities. Last updated: 10 July 2017

2 Compiling a C program

Unable To The Artifact From Any Repository Maven-clean-plugin

STQA Mini Project No. 1

Multiple file project management & Makefile

CS 326 Operating Systems C Programming. Greg Benson Department of Computer Science University of San Francisco

Auto-Generating Documentation & Source Code

Introduction to Supercomputing

Transcription:

Software Building (Sestavování aplikací) http://d3s.mff.cuni.cz Pavel Parízek parizek@d3s.mff.cuni.cz CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics

Outline Maven NuGet Gradle GNU build system Nástroje pro vývoj software Software Building 2

Nástroje pro vývoj software Software Building 3 Maven Project management and building tool mainly for Java Typical usage scenarios made simpler for users Encourages best-practices and conventions Directory layout Naming of tests Web: http://maven.apache.org/

Nástroje pro vývoj software Software Building 4 Best-practice guidelines Directory tree (layout) my-app -- pom.xml -- src -- main -- java `-- com `-- mycompany `-- app `-- App.java `-- resources `-- test `-- java `-- com `-- mycompany `-- app `-- AppTest.java `-- target `-- classes Test case names **/*Test.java, **/Test*.java Example taken from http://maven.apache.org/ guides/getting-started/maven-in-five-minutes.html

Nástroje pro vývoj software Software Building 5 Key concepts Goal Single action to be executed Construction of directory layout Compilation of Java sources Similar to task in Ant Phase Step in the build lifecycle generate-sources, compile, deploy Sequence of goals Similar to target in Ant Build lifecycle Ordered sequence of phases Similar to dependencies between targets in Ant

Typical build lifecycle 1. validate 2. compile 3. test 4. package 5. integration-test 6. verify 7. install 8. deploy to local repository Nástroje pro vývoj software Software Building 6

Nástroje pro vývoj software Software Building 7 Project Object Model (POM) Project s configuration (build script) Stored in the pom.xml file <project> <modelversion>4.0.0</modelversion> <groupid>com.mycompany.app</groupid> <artifactid>my-app</artifactid> <packaging>jar</packaging> <version>1.0-snapshot</version> <name>maven Quick Start Archetype</name> <url>http://maven.apache.org</url> <dependencies> <dependency> <groupid>junit</groupid> <artifactid>junit</artifactid> <version>4.8.2</version> <scope>test</scope> </dependency> </dependencies> </project> Example taken from http://maven.apache.org/ guides/getting-started/maven-in-five-minutes.html

Nástroje pro vývoj software Software Building 8 Usage Project setup mvn archetype:generate \ -DarchetypeArtifactId=maven-archetype-quickstart \ -DgroupId=com.mycompany.app -DartifactId=my-app Build lifecycle: mvn <name of a phase> Compilation: mvn compile Packaging: mvn package Web-site generation: mvn site Rebuild into local repository: mvn clean install Default remote repository (central) http://repo1.maven.org/maven2/

Nástroje pro vývoj software Software Building 9 Advanced features Creating local repositories Creating packages with metadata To be stored into repository Modifications of standard workflow Project inheritance (modules) Extensibility via plugins Plugin implements a set of related goals

Example http://d3s.mff.cuni.cz/teaching/software_dev elopment_tools/files/maven-ex.tgz DSI Utilities: original sources, build.xml, pom.xml Project home page: http://dsiutils.di.unimi.it/ Nástroje pro vývoj software Software Building 10

Want to know more about Maven? Read the guide http://maven.apache.org/guides/ Try it yourself Create new project Add source files Run compilation Nástroje pro vývoj software Software Building 11

NuGet Package manager for.net Similar concepts to Maven Integration to Visual Studio Web: https://www.nuget.org/ Docs: https://docs.microsoft.com/en-us/nuget/ Nástroje pro vývoj software Software Building 12

Nástroje pro vývoj software Software Building 13 Gradle Another popular general-purpose build tool Java, Scala, C, C++, Android Encourages best practices (like Maven) Script language (DSL) based on Groovy Web: https://gradle.org/ Examples https://docs.gradle.org/current/userguide/tutorial_java_projects.html (section 46.2.6) https://docs.gradle.org/current/userguide/tutorial_using_tasks.html (section 16.5) Running: gradle build

Nástroje pro vývoj software Software Building 14 Motivation for GNU build system Portability of programs over different UNIX-like systems existing standards (C, POSIX) define only core aspects System-specific configuration e.g., use of KDE instead of Gnome Complexity of Make files unreadable, hard to maintain writing all the rules is tedious Portability of Make files Make is standardized by POSIX, but not all UNIX-like systems are 100% compliant

Selected portability and compatibility issues Programs in C exit(): may return void or int (error code) free(null): sometimes does nothing malloc(0): returns NULL or valid pointer (and many more) Functions in different headers and libraries Shell and utilities: Awk, Grep, Sed,... Multiple implementations (not all compatible) Nástroje pro vývoj software Software Building 15

Solutions for portability and compatibility Virtualized environment (Java, C#/.NET) GNU build system (Autotools) De-facto standard in Unix/Linux world Explicit support for different flavors Database of known portability issues Resolves issues during configuration Uses only features available everywhere Nástroje pro vývoj software Software Building 16

Nástroje pro vývoj software Software Building 17 GNU build system (Autotools) Autoconf Configuration detector Automake Makefile generator Libtool Abstracts creation of libraries Gettext Support for localization

End user s perspective 1. Download the source code 2../configure Automatically tests the target system e.g. for presence of required libraries Detects system configuration (OS, HW) Automatically generates Make files 3. make 4. make install Nástroje pro vývoj software Software Building 18

Nástroje pro vývoj software Software Building 19 End user s perspective configuration Installation root directory configure --prefix=/opt Cross-compilation configure --host Optional features of the software configure --enable-feature configure --disable-feature Optional packages (libraries) to build with configure --with-package configure --without-package

Nástroje pro vývoj software Software Building 20 What is behind the scenes shell scripts with many system tests config.cache cache for test results between restarts configure config.log autoheader config.h.in Makefile.in automake Makefile.am config.status script which generates make files, taking test results from the cache config.h Makefile

Nástroje pro vývoj software Software Building 21 Autoconf & the configure script configure.ac autoconf configure, config.status autoheader config.h.in Very portable shell script Uses features in the lowest-common-denominator of known shells (no functions,...) Generated from a template (configure.ac) Based on a library of tests of well-known portability and compatibility issues

Nástroje pro vývoj software Software Building 22 configure.ac script template AC_INIT(package, version, bug-report-address) information about the package checks for programs checks for libraries checks for header files checks for types checks for structures checks for compiler characteristics checks for library functions checks for system services AC_CONFIG_FILES([output file,...]) AC_OUTPUT

Nástroje pro vývoj software Software Building 23 configure.ac example AC_INIT([GNU cflow], [1.2], [bug-cflow@gnu.org]) AC_CONFIG_HEADER([config.h]) # Checks for programs. AC_PROG_CC AC_PROG_LEX # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([stdlib.h string.h unistd.h locale.h]) AC_OUTPUT macros a single argument to a macro multiple arguments to a macro

configure another example http://d3s.mff.cuni.cz/teaching/software_dev elopment_tools/files/sockets-auto.tgz configure.ac src/config.h.in src/client.cpp Achieving support for multiple platforms Nástroje pro vývoj software Software Building 24

Generating configure.ac Autoscan Inspects source files (C/C++) to detect common portability issues Generates skeleton of configure.ac Ifnames Reports variables used in preprocessor conditionals Often used to solve platform dependency issues Example: #if HAVE_LOCALE_H Nástroje pro vývoj software Software Building 25

Nástroje pro vývoj software Software Building 26 Automake creating portable Makefiles configure.ac Makefile.am automake Makefile.in config.status Makefile

Nástroje pro vývoj software Software Building 27 Supported targets install, install-exec, install-data uninstall clean distclean clean to what is distributed removes also files generated by configure check run test of compiled binaries installcheck run test of installed program dist creates source code distribution package (tarball)

Nástroje pro vývoj software Software Building 28 Makefile.am template Makefile.am SUBDIRS = src dist_doc_data = README directories to be processed before this directory install README into docdir and put it into distribution src/makefile.am bin_programs = hello hello_sources = main.c

Nástroje pro vývoj software Software Building 29 Makefile.am template Makefile.am SUBDIRS = src dist_doc_data = README hello is a program to be installed into bindir program hello can be built from source main.c src/makefile.am bin_programs = hello hello_sources = main.c since main.c is a source file, it will also be put into distribution (by make dist )

Nástroje pro vývoj software Software Building 30 Autotools the whole picture again autoscan config.log ifnames autoconf configure.ac config.cache configure autoheader config.h.in Makefile.in config.status config.h Makefile automake Makefile.am

Further reading http://www.sourceware.org/autobook/ https://www.gnu.org/software/autoconf/ https://www.gnu.org/software/automake/ Nástroje pro vývoj software Software Building 31

Nástroje pro vývoj software Software Building 32 Other build tools Ivy https://ant.apache.org/ivy/ Scons http://www.scons.org/ CMake http://www.cmake.org/ Bazel http://bazel.io/