Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

SF Gradle Meetup - Netflix OSS


Published on

Published in: Technology
  • Be the first to comment

SF Gradle Meetup - Netflix OSS

  1. 1. Netflix OSS With Gradle@netflixoss
  2. 2. @NetflixOSS ProgressionCuratorAutoScalingAstyanaxServoPriamJmeterforC*ExhibitorArchaiusAsgardChaosMonkeyEurekaGovernatorBlitz4JHystrixTurbineJanitorMonkeyRibbonRxJavaEVCacheDenominatorKaryonNeJlixGraphRecipeAppCI/CloudbeesAminator2012 2013
  3. 3.
  4. 4. My Role• Engineering Tools• We help, when and where we can• Build, Bake, Deploy, Monkey• Lead on internal Gradle and Ant builds
  5. 5. EnvironmentsAll of Maven CentralPublish to SonatypeMaven On The OutsideDone in the publicSetup everythingNo Maven CentralPublish to ArtifactoryIvy On The InsideLegacy ConventionsMinimal Setup
  6. 6. Phase 0: Use Gradle
  7. 7. Phase 1: Naive Approach• Copyable build• build.gradle• gradle/conventions.gradle• gradle/maven.gradle• gradle/netflix-oss.gradle• Decent examples online
  8. 8. ext.releaseVersion = 1.1.3 // TEMPLATEext.githubName = // TEMPLATEapply from: file(gradle/convention.gradle)apply from: file(gradle/maven.gradle)apply from: file(gradle/check.gradle)group = com.netflixrepositories {mavenCentral()}dependencies { // TEMPLATEcompile com.sun.jersey:jersey-core:1.11testCompile org.testng:testng:6.1.1testCompile org.mockito:mockito-core:1.8.5}build.gradle
  9. 9. ext.performingRelease = project.hasProperty(release) &&Boolean.parseBoolean(project.release)def versionPostfix = performingRelease?:-SNAPSHOTversion = "${releaseVersion}${versionPostfix}"status = performingRelease?release:snapshotapply plugin: java // Plugin as major conventionssourceCompatibility = 1.6// GRADLE-2087 workaround, perform after java pluginstatus = rootProject.statustask sourcesJar(type: Jar, dependsOn:classes) {classifier = sourcesfrom sourceSets.main.allSource}task javadocJar(type: Jar, dependsOn:javadoc) {classifier = javadoc  from javadoc.destinationDir}convention.gradle
  10. 10. apply plugin: mavenapply plugin: signingsigning { sign configurations.archives}task uploadMavenCentral(type:Upload) {configuration = configurations.archivesdependsOn signArchivesdoFirst.repositories.mavenDeployer {beforeDeployment { signing.signPom(it) }repository(url: {authentication(userName: rroject.sonatypeUsername, password:project.sonatypePassword)}pom.project {url "${project.githubName}"...}}}maven.gradle
  11. 11. apply from:
  12. 12. gradle-template• Be as visible as possible• Meant to be synced with (#git #ftw)• Templates for multiple-module and single-moduleprojects• Used by other companies•
  13. 13. Phase 2: Full Build• Release plugin [gradle-release]• Publish snapshots, candidates and releases• Simpler signing in Jenkins• License and Copyright Headers [license-gradle-plugin]• Any plugins in Bintray• Publishing Javadoc• More code quality checks
  14. 14. Continuous Integration• Jenkins Internally• Performs releases• Has Keys• Access to AWS• CloudBees DEV@CLOUD Externally• Builds Pull Requests• Shows Code Quality Metrics
  15. 15. Problem Areas• Java plugin required for conf2scope mappings to work• Java plugin resets status [GRADLE-2087]• Parent poms caused problems, but aren’t needed• Sonatype username/password• Signing keys needed locally with special properties• Not all plugins were available
  16. 16. Future• Roll features into plugins• Merge with internal build• Hire more engineers to work on Gradle
  17. 17. @quidryan@quidryan YouQuestions?@netflixoss #cloudprize