Simplify your external dependency management - DPC11
Upcoming SlideShare
Loading in...5
×
 

Simplify your external dependency management - DPC11

on

  • 4,519 views

 

Statistics

Views

Total Views
4,519
Views on SlideShare
4,367
Embed Views
152

Actions

Likes
3
Downloads
38
Comments
0

3 Embeds 152

http://lanyrd.com 148
http://www.thewebhatesme.com 3
https://lanyrd.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Simplify your external dependency management - DPC11 Simplify your external dependency management - DPC11 Presentation Transcript

  • v Simplify your externaldependency management
  • Simplify your ext. dependency management About me  Stephan Hochdörfer, bitExpert AG  Department Manager Research Labs  enjoying PHP since 1999  S.Hochdoerfer@bitExpert.de  @shochdoerfer
  • Simplify your ext. dependency management Dependencies?
  • Simplify your ext. dependency management Dependencies? internal external Dependencies Dependencies
  • Simplify your ext. dependency management Dependencies? external Dependencies Extensions Systemtools Frameworks Libs
  • Simplify your ext. dependency management Our first project....
  • Simplify your ext. dependency management Our first project.... +
  • Simplify your ext. dependency management Our first project – the structure yourpoject |-application |-library |---Facebook |---Zend |-public |---js |---css |-tests
  • Simplify your ext. dependency management Maintenance nightmare!
  • Simplify your ext. dependency management Version control, anyone?
  • Simplify your ext. dependency management Subversion – svn:externals
  • Simplify your ext. dependency management Git - Submodules
  • Simplify your ext. dependency management Git - Subtree
  • Simplify your ext. dependency management Recap No overview of dependency configuration
  • Simplify your ext. dependency management Recap Externals must be of the same type as the repository!
  • Simplify your ext. dependency management Recap Commiting to Externals is possible!
  • Simplify your ext. dependency management Insight You cannot control dependencies with a VCS!
  • Simplify your ext. dependency management Insight A VCS is not made for dependency management!
  • Simplify your ext. dependency management Requirements first!
  • Simplify your ext. dependency management Do not hide dependency metadata!
  • Simplify your ext. dependency management Transitive dependencies
  • Simplify your ext. dependency management Do not reinvent the wheel v
  • Simplify your ext. dependency management Separation from VCS
  • Simplify your ext. dependency management Mind change: Build process needed!
  • Simplify your ext. dependency management Step 1: Building the build
  • Simplify your ext. dependency management Step 2: Package the software
  • Simplify your ext. dependency management Step 3: Deliver the software
  • Simplify your ext. dependency management Build automation
  • Simplify your ext. dependency management Build automation
  • Simplify your ext. dependency management Build automation with Phing <?xml version="1.0" encoding="UTF-8"?> <project name="MyProject" default="build"> <target name="prepare"> <echo msg="Creating dir ./build" /> <mkdir dir="./build" /> </target> <target name="build" depends="prepare"> <echo msg="Copying files..." /> <copy file="./info.php" tofile="./build/info.php" /> </target> </project>
  • Simplify your ext. dependency management Build automation with pear
  • Simplify your ext. dependency management Build automation with pear pantr pantr = project-based PEAR installer
  • Simplify your ext. dependency management Build automation with pantr 1. pantr pear:init lib
  • Simplify your ext. dependency management Build automation with pantr 2. pantr pear:channel-discover pear.pagosoft.com
  • Simplify your ext. dependency management Build automation with pantr 3. pantr pear:install pgs/parser
  • Simplify your ext. dependency management Packaging
  • Simplify your ext. dependency management *nix packages – 4 steps to enlightenment
  • Simplify your ext. dependency management *nix packages – 4 steps to enlightenment 1. Create directory yourproject-0.0.1
  • Simplify your ext. dependency management *nix packages – 4 steps to enlightenment 2. dh_make –createorig -s
  • Simplify your ext. dependency management *nix packages – 4 steps to enlightenment 3. Add a Makefile
  • Simplify your ext. dependency management *nix packages – 4 steps to enlightenment BINDIR = $(DESTDIR)/usr/bin clean: install: mkdir -p $(BINDIR) cp info.php $(BINDIR) uninstall: rm -f $(BINDIR)/info.php
  • Simplify your ext. dependency management *nix packages – 4 steps to enlightenment 4. fakeroot debian/rules binary
  • Simplify your ext. dependency management *nix packages – Dependencies?
  • Simplify your ext. dependency management *nix packages – Dependencies? Add them to debian/control file
  • Simplify your ext. dependency management *nix packages – Dependencies? Source: yourproject Section: unknown Priority: extra Maintainer: Stephan Hochdoerfer Build-Depends: debhelper (>= 7.0.50~) Standards-Version: 3.8.4 Package: yourproject Architecture: any Depends: php5-cgi php5-mysql Description: yourproject short description long description...
  • Simplify your ext. dependency management PEAR package – 3 steps to enlightenment
  • Simplify your ext. dependency management PEAR package – 3 steps to enlightenment 1. Create directory yourproject-0.0.1
  • Simplify your ext. dependency management PEAR package – 3 steps to enlightenment 2. Create package.xml
  • Simplify your ext. dependency management PEAR package – 3 steps to enlightenment <?xml version="1.0" encoding="UTF-8"?> <package packagerversion="1.8.0" version="2.0"> <name>Yourapp</name> <channel>pear.yourapp.com</channel> <summary>Yourapp summary</summary> <description>Yourapp description.</description> <lead> <name>Stephan Hochdoerfer</name> <user>sh</user> <email>S.Hochdoerfer@bitExpert.de</email> <active>yes</active> </lead> <date>2009-10-18</date> <time>16:00:00</time> <version> <release>0.9.0</release>
  • Simplify your ext. dependency management PEAR package – 3 steps to enlightenment <dependencies> <required> <php> <min>5.0.0</min> </php> <pearinstaller> <min>1.4.0</min> </pearinstaller> </required> </dependencies> <phprelease /></package>
  • Simplify your ext. dependency management PEAR package – 3 steps to enlightenment 3. pear package
  • Simplify your ext. dependency management How to deliver the packages?
  • Simplify your ext. dependency management How to deliver the packages? *nix repository vs. PEAR server
  • Simplify your ext. dependency management How to deliver the packages? pearhub, pearfarm, openPear
  • Simplify your ext. dependency management How to deliver the packages? PEAR Proxy needed?
  • Simplify your ext. dependency management Missing the glue!
  • Simplify your ext. dependency management Java anyone?
  • Simplify your ext. dependency management Maven – a project management tool
  • Simplify your ext. dependency management Maven Goal: Standardization
  • Simplify your ext. dependency management Maven Lifecycle archetype
  • Simplify your ext. dependency management Maven Lifecycle archetype validate
  • Simplify your ext. dependency management Maven Lifecycle archetype validate compile
  • Simplify your ext. dependency management Maven Lifecycle archetype validate compile test
  • Simplify your ext. dependency management Maven Lifecycle archetype validate compile test package
  • Simplify your ext. dependency management Maven Lifecycle archetype validate compile test integration-test package
  • Simplify your ext. dependency management Maven Lifecycle archetype validate compile verify test integration-test package
  • Simplify your ext. dependency management Maven Lifecycle archetype validate install compile verify test integration-test package
  • Simplify your ext. dependency management Maven Lifecycle archetype deploy validate install compile verify test integration-test package
  • Simplify your ext. dependency management Maven - Project Object Model <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <groupId>com.acme</groupId> <artifactId>myproject</artifactId> <packaging>jar</packaging> <version>0.0.1-SNAPSHOT</version> <name>My project</name> </project>
  • Simplify your ext. dependency management Maven - Dependencies <dependencies> <dependency> <groupId>com.zend</groupId> <artifactId>framework</artifactId> <version>1.11.6-SNAPSHOT</version> <type>jar</type> <scope>compile</scope> </dependency> </dependencies>
  • Simplify your ext. dependency management Maven Beginners guide Maven for PHP?
  • Simplify your ext. dependency management Maven Beginners guide 1. Download & install Maven
  • Simplify your ext. dependency management Maven Beginners guide 2. Edit settings.xml to add PHP for Maven repository
  • Simplify your ext. dependency management Maven Beginners guide <pluginRepository> <id>release-repo1.php-maven.org</id> <name>PHP-Maven 2 Release Repository</name> <url>http://repo1.php-maven.org/release</url> <releases> <enabled>true</enabled> </releases> </pluginRepository>
  • Simplify your ext. dependency management Maven Beginners guide 3. Create new Maven project
  • Simplify your ext. dependency management Maven Beginners guide mvn archetype:generate -DarchetypeGroupId=org.phpmaven -DarchetypeArtifactId=php5-lib-archetype -DarchetypeVersion=1.1 -DgroupId=org.yourproject -DartifactId=appname
  • Simplify your ext. dependency management Maven Beginners guide 2. Deploy your project
  • Simplify your ext. dependency management Maven Beginners guide mvn deploy
  • Simplify your ext. dependency management Maven Bonus points Can act as a proxy!
  • Simplify your ext. dependency management Maven Bonus points Plugins, Plugins, Plugins,...
  • Simplify your ext. dependency management Maven Bonus points Automatic release management
  • Simplify your ext. dependency management Maven Bonus points Automatic deployment
  • Simplify your ext. dependency management Maven Bonus points Build profiles
  • Simplify your ext. dependency management Maven Bonus points IDE support, e.g. Eclipse, Netbeans,...
  • http://joind.in/3232
  • Simplify your ext. dependency management Image Credits http://www.sxc.hu/photo/1092493 http://www.sxc.hu/photo/910278 http://www.sxc.hu/photo/766748