SlideShare ist ein Scribd-Unternehmen logo
1 von 35
GradleFx
Flex Build Tool
By Yennick Trevels & Steven Dick
Yennick Trevels
iDA MediaFoundry
Java & Flex


                   @SlevinBE




                        Free Time
                         Programming
                              Reading
                              Gaming
Gradle
An introduction
Features
Convention over Configuration

Gradle
Multi-project support
Dependency Management
Groovy scripting
Source file change detection
Gradle
Example
subprojects {
  apply plugin: 'gradlefx'

    version = '1.0-SNAPSHOT'

    repositories {
      mavenCentral()
      mavenRepo name: 'yoolab-releases', url: "http://projects.yoolab.org/maven/content/repositories/releases"
      mavenRepo name: 'yoolab-snapshots', url: "http://projects.yoolab.org/maven/content/repositories/snapshots"
    }

    dependencies {
      external group: 'org.springextensions.actionscript', name: 'spring-actionscript-core', version: '1.2-SNAPSHOT', ext: 'swc'
      external group: 'org.as3commons', name: 'as3commons-collections', version: '1.1', ext: 'swc'
      external group: 'org.as3commons', name: 'as3commons-lang', version: ‘0.3.2', ext: 'swc'


        external group: 'org.graniteds', name: 'granite-swc', version: '2.2.0.SP1', ext: 'swc'
        external group: 'org.graniteds', name: 'granite-essentials-swc', version: ‘2.2.0.SP1', ext: 'swc'
    }
}
Gradle
Projects
One or more projects per build
One or more tasks per project
One build.gradle file per project
Gradle
Subprojects
Project structure




Settings file (settings.gradle)
    include 'client', 'domain', 'util', 'assets‘


Configuration Injection
subprojects {
                 apply plugin: 'gradlefx'
                 version = '1.0-SNAPSHOT'
                 repositories {
                                 mavenCentral()
                 }
}
Gradle
Tasks
Block of code that defines part of a build

Create a new task
task(showText, dependsOn: ‘projectB:compile’) << ,
              println “I’m executing after the compile task"
}

Configure an existing Task
task(copy, type: Copy) {
               from(file('srcDir'))
               into(buildDir)
}
Gradle
Tasks
Adding behaviour
compile.doLast {
              println “Compilation complete"
}

Executing a task
>gradle showText
Gradle
Methods
Structure build logic

task(showText) << {
              printList(*‘john’, ‘Alfred’, ‘Elise’+)
}

def printList(names) {
               names.each() { name ->
                             println name
               }
}
Gradle
Classes
Defined in
         build script
         rootProjectDir/buildSrc/src/main/
         standalone project
Gradle
Custom task class
class CopyResources extends DefaultTask {

    public CopyResources() {
      description = 'copies the resources to the build directory'
    }

    @TaskAction
    def copyResources() {
      project.resourceDirs.each { resourceDir ->
         def fromLocation = project.file(resourceDir).path
         def toLocation = project.buildDir.path

            logger.info('from ' + fromLocation + ' to ' + toLocation)

            project.copy {
              from fromLocation
              into toLocation
            }
        }
    }
}
Gradle
Convention properties
Properties exposed by plugins
Simple or complex properties
Have a default value (convention)
Can be overridden

Example:
srcDirs = ['src/main/flex']  convention = [‘src/main/actionscript’]
htmlWrapper.title = ‘My html wrapper page title‘  default = project name
Gradle
Repositories

repositories {
    mavenCentral()
    mavenLocal()
    mavenRepo name: 'yoolab-releases', url: "http://projects.yoolab.org/maven/content/repositories/releases"
    mavenRepo name: 'yoolab-snapshots', url: "http://projects.yoolab.org/maven/content/repositories/snapshots"
}
Gradle
Dependencies
Libraries/other projects used by a project

Library Dependency
dependencies {
             merged group: 'org.graniteds', name: 'granite-swc', version: graniteds_version, ext: 'swc‘
}

Project Dependency
merged project(':projectname')
Gradle
Configurations
Bundles a set of dependencies
Varies between plugins

merged group: 'org.graniteds', name: 'granite-swc', version: graniteds_version, ext: 'swc‘



               ‘merged’ configuration
Gradle
Three-phase build
Initialization                       ProjectInstance {
Determines projects for build                    name;
Project instance creation            }




Configuration phase                  ProjectInstance {
Runs build script of every project               name = “my project” ;
Configures project objects
                                     }


Execution phase
Execute the tasks
Gradle
Three-phase build
AfterEvaluate
Runs after project is configured

project.afterEvaluate {
               project.description = project.name + “ is my sample project”
}
Gradle
Ant support
Ant project import
Support for Ivy repositories
Run Ant tasks with Gradle

Example
ant.java(jar: project.flexHome + '/lib/mxmlc.jar',
        dir: project.flexHome + '/frameworks',
        fork: true,
        resultproperty: ‘antResultProperty’,
        outputproperty: ‘antOutputProperty’) ,
                arg(value: ‘-keep-as3-metadata+=Autowired,RemoteClass’)
}

println ant.properties*‘antOutputProperty’+
Gradle
Maven support
Support for Maven repositories
Maven plugin for Java based projects
Gradle
Gradle wrapper
Run Gradle without installing Gradle
batch/shell script

How?
task wrapper(type: Wrapper) {
              gradleVersion = ‘1.0’
}


simple/
  gradlew
  gradlew.bat
  gradle/wrapper/
    gradle-wrapper.jar
    gradle-wrapper.properties
GradleFx
Flex builds just got easier!
Features
SWC, SWF & AIR
GradleFx
Clean & copy resources tasks
Html wrapper generation
FlexUnit support
GradleFx
Tasks
clean
compile
package
copyResources
publish
createHtmlWrapper
test
GradleFx
Setup
Flex SDK
Create FLEX_HOME environment variable  convention
OR
Set flexHome convention property  custom configuration



Apply Plugin
buildscript {
  repositories {
     mavenCentral()
  }

    dependencies {
      classpath group: 'org.gradlefx', name: 'gradlefx', version: '0.4.1'
    }
}

apply plugin: 'gradlefx'
GradleFx
Project type
Defines to which type of archive the sources will be compiled to
Convention property  type
Possible values  ‘swc’, ‘swf’ or ‘air’

Example
type = ‘swc’
GradleFx
Basic conventions
sources  src/main/actionscript (srcDirs property)
resources  src/main/resources (resourceDirs property)
test sources  src/test/actionscript (testDirs property)
test resources  src/test/resources (testResourceDirs property)

mxml main class  Main.mxml in src/main/actionscript/ (mainClass property)
build directory  build (project.buildDir property)
GradleFx
Some advanced properties
Compiler options
additionalCompilerOptions property
One item per compiler option
            additionalCompilerOptions = [
              '-use-network=true',
              '-locale=en_US',
              '-keep-as3-metadata+=Autowired,RemoteClass‘
            ]

JVM options
jvmArguments property
            jvmArguments = ['-Xmx1024m','-Xms512m']
GradleFx
Dependency management
Configurations
Merged (-compiler.library-path)
Internal (-compiler.include-libraries)
External (-compiler.external-library-path)
Rsl (-runtime-shared-library-path)
Test

Example
external group: 'org.as3commons', name: 'as3commons-eventbus', version: '1.1', ext: 'swc'
merged group: 'org.graniteds', name: 'granite-swc', version: '2.2.0.SP1', ext: 'swc'
GradleFx
AIR project required steps
Create AIR descriptor file
Convention
             "/src/main/actionscript/$,project.name-.xml“
Custom value
             air.applicationDescriptor: "/src/main/flex/airdescriptor.xml“


Certificate
Needed to sign the AIR package
PKCS12 format
Password required

Convention
             "$,project.name-.p12“
Custom value
             air.keystore: "certificate.p12“
             air.storepass = "mypassword"
GradleFx
FlexUnit required steps
Specify FlexUnit home
Convention
             FLEXUNIT_HOME environment variable
Custom value
             flexUnit.home = 'c:/flexunit/4.1'


Specify Flash Player executable
Convention
             FLASH_PLAYER_EXE environment variable
Custom value
             flexunit.command = ‘c:/flashplayer/flashplayer_10.exe’


Specify FlexUnit ant task jar name
Located in FlexUnit home directory
Custom value
             flexUnit.antTasksJar = 'flexUnitTasks-4.1.0-8.jar'
GradleFx
FlexUnit required steps
Specify FlexUnit dependencies
dependencies {
  test files( "${flexUnit.home}/flexunit-4.1.0-8-flex_4.1.0.16076.swc",
              "${flexUnit.home}/flexunit-uilistener-4.1.0-8-4.1.0.16076.swc",
              "${flexUnit.home}/flexunit-cilistener-4.1.0-8-4.1.0.16076.swc“)
}

Specify testRunner class
testClass = 'MyTestRunner.mxml'
GradleFx


DEMO
GradleFx
What’s to come?
IDEA and Eclipse project generation support
AS3Doc generation
Flex SDK maven artifact support?
GradleFx
Where to go next
GradleFx site: https://github.com/GradleFx/GradleFx
Source: https://github.com/GradleFx/GradleFx
Documentation: https://github.com/GradleFx/GradleFx/wiki
Examples: https://github.com/GradleFx/GradleFx-Examples
Help & Support: http://gradlefx.tenderapp.com/home
Bug tracker: https://github.com/GradleFx/GradleFx/issues
Changelog: https://github.com/GradleFx/GradleFx/blob/master/CHANGELOG.textile

Weitere Àhnliche Inhalte

Was ist angesagt?

In the Brain of Hans Dockter: Gradle
In the Brain of Hans Dockter: GradleIn the Brain of Hans Dockter: Gradle
In the Brain of Hans Dockter: GradleSkills Matter
 
SBT Crash Course
SBT Crash CourseSBT Crash Course
SBT Crash CourseMichal Bigos
 
Gradle Introduction
Gradle IntroductionGradle Introduction
Gradle IntroductionDmitry Buzdin
 
DevOps Odessa #TechTalks 21.01.2020
DevOps Odessa #TechTalks 21.01.2020DevOps Odessa #TechTalks 21.01.2020
DevOps Odessa #TechTalks 21.01.2020Lohika_Odessa_TechTalks
 
Sbt Concepts - Tips, Tricks, Sandbox, ... 02/2013
Sbt Concepts - Tips, Tricks, Sandbox, ... 02/2013Sbt Concepts - Tips, Tricks, Sandbox, ... 02/2013
Sbt Concepts - Tips, Tricks, Sandbox, ... 02/2013Roland Tritsch
 
SBT Concepts, part 2
SBT Concepts, part 2SBT Concepts, part 2
SBT Concepts, part 2Renat Bekbolatov
 
Basic Gradle Plugin Writing
Basic Gradle Plugin WritingBasic Gradle Plugin Writing
Basic Gradle Plugin WritingSchalk Cronjé
 
Jenkins' shared libraries in action
Jenkins' shared libraries in actionJenkins' shared libraries in action
Jenkins' shared libraries in actionLohika_Odessa_TechTalks
 
Ship your Scala code often and easy with Docker
Ship your Scala code often and easy with DockerShip your Scala code often and easy with Docker
Ship your Scala code often and easy with DockerMarcus Lönnberg
 
Simple Build Tool
Simple Build ToolSimple Build Tool
Simple Build ToolDavid Galichet
 
Idiomatic gradle plugin writing
Idiomatic gradle plugin writingIdiomatic gradle plugin writing
Idiomatic gradle plugin writingSchalk Cronjé
 
Idiomatic Gradle Plugin Writing
Idiomatic Gradle Plugin WritingIdiomatic Gradle Plugin Writing
Idiomatic Gradle Plugin WritingSchalk Cronjé
 
Building Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And TricksBuilding Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And TricksMike Hugo
 
Spring Boot Revisited with KoFu and JaFu
Spring Boot Revisited with KoFu and JaFuSpring Boot Revisited with KoFu and JaFu
Spring Boot Revisited with KoFu and JaFuVMware Tanzu
 
Idiomatic Gradle Plugin Writing
Idiomatic Gradle Plugin WritingIdiomatic Gradle Plugin Writing
Idiomatic Gradle Plugin WritingSchalk Cronjé
 
Custom deployments with sbt-native-packager
Custom deployments with sbt-native-packagerCustom deployments with sbt-native-packager
Custom deployments with sbt-native-packagerGaryCoady
 
Continous delivery with sbt
Continous delivery with sbtContinous delivery with sbt
Continous delivery with sbtWojciech PituƂa
 

Was ist angesagt? (19)

In the Brain of Hans Dockter: Gradle
In the Brain of Hans Dockter: GradleIn the Brain of Hans Dockter: Gradle
In the Brain of Hans Dockter: Gradle
 
Spring4 whats up doc?
Spring4 whats up doc?Spring4 whats up doc?
Spring4 whats up doc?
 
SBT Crash Course
SBT Crash CourseSBT Crash Course
SBT Crash Course
 
Gradle Introduction
Gradle IntroductionGradle Introduction
Gradle Introduction
 
DevOps Odessa #TechTalks 21.01.2020
DevOps Odessa #TechTalks 21.01.2020DevOps Odessa #TechTalks 21.01.2020
DevOps Odessa #TechTalks 21.01.2020
 
Sbt Concepts - Tips, Tricks, Sandbox, ... 02/2013
Sbt Concepts - Tips, Tricks, Sandbox, ... 02/2013Sbt Concepts - Tips, Tricks, Sandbox, ... 02/2013
Sbt Concepts - Tips, Tricks, Sandbox, ... 02/2013
 
SBT Concepts, part 2
SBT Concepts, part 2SBT Concepts, part 2
SBT Concepts, part 2
 
Basic Gradle Plugin Writing
Basic Gradle Plugin WritingBasic Gradle Plugin Writing
Basic Gradle Plugin Writing
 
Jenkins' shared libraries in action
Jenkins' shared libraries in actionJenkins' shared libraries in action
Jenkins' shared libraries in action
 
Ship your Scala code often and easy with Docker
Ship your Scala code often and easy with DockerShip your Scala code often and easy with Docker
Ship your Scala code often and easy with Docker
 
Simple Build Tool
Simple Build ToolSimple Build Tool
Simple Build Tool
 
Idiomatic gradle plugin writing
Idiomatic gradle plugin writingIdiomatic gradle plugin writing
Idiomatic gradle plugin writing
 
Idiomatic Gradle Plugin Writing
Idiomatic Gradle Plugin WritingIdiomatic Gradle Plugin Writing
Idiomatic Gradle Plugin Writing
 
Everything as a code
Everything as a codeEverything as a code
Everything as a code
 
Building Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And TricksBuilding Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And Tricks
 
Spring Boot Revisited with KoFu and JaFu
Spring Boot Revisited with KoFu and JaFuSpring Boot Revisited with KoFu and JaFu
Spring Boot Revisited with KoFu and JaFu
 
Idiomatic Gradle Plugin Writing
Idiomatic Gradle Plugin WritingIdiomatic Gradle Plugin Writing
Idiomatic Gradle Plugin Writing
 
Custom deployments with sbt-native-packager
Custom deployments with sbt-native-packagerCustom deployments with sbt-native-packager
Custom deployments with sbt-native-packager
 
Continous delivery with sbt
Continous delivery with sbtContinous delivery with sbt
Continous delivery with sbt
 

Ähnlich wie GradleFX

Gradleintroduction 111010130329-phpapp01
Gradleintroduction 111010130329-phpapp01Gradleintroduction 111010130329-phpapp01
Gradleintroduction 111010130329-phpapp01Tino Isnich
 
Gradle: The Build system you have been waiting for
Gradle: The Build system you have been waiting forGradle: The Build system you have been waiting for
Gradle: The Build system you have been waiting forCorneil du Plessis
 
Faster Java EE Builds with Gradle
Faster Java EE Builds with GradleFaster Java EE Builds with Gradle
Faster Java EE Builds with GradleRyan Cuprak
 
Faster Java EE Builds with Gradle
Faster Java EE Builds with GradleFaster Java EE Builds with Gradle
Faster Java EE Builds with GradleRyan Cuprak
 
Improving your Gradle builds
Improving your Gradle buildsImproving your Gradle builds
Improving your Gradle buildsPeter Ledbrook
 
Idiomatic Gradle Plugin Writing
Idiomatic Gradle Plugin WritingIdiomatic Gradle Plugin Writing
Idiomatic Gradle Plugin WritingSchalk Cronjé
 
Making the Most of Your Gradle Build
Making the Most of Your Gradle BuildMaking the Most of Your Gradle Build
Making the Most of Your Gradle BuildAndres Almiray
 
OpenCms Days 2012 - Developing OpenCms with Gradle
OpenCms Days 2012 - Developing OpenCms with GradleOpenCms Days 2012 - Developing OpenCms with Gradle
OpenCms Days 2012 - Developing OpenCms with GradleAlkacon Software GmbH & Co. KG
 
Making the most of your gradle build - Gr8Conf 2017
Making the most of your gradle build - Gr8Conf 2017Making the most of your gradle build - Gr8Conf 2017
Making the most of your gradle build - Gr8Conf 2017Andres Almiray
 
Mastering Grails 3 Plugins - G3 Summit 2016
Mastering Grails 3 Plugins - G3 Summit 2016Mastering Grails 3 Plugins - G3 Summit 2016
Mastering Grails 3 Plugins - G3 Summit 2016Alvaro Sanchez-Mariscal
 
Gradle - Build system evolved
Gradle - Build system evolvedGradle - Build system evolved
Gradle - Build system evolvedBhagwat Kumar
 
Making the most of your gradle build - Greach 2017
Making the most of your gradle build - Greach 2017Making the most of your gradle build - Greach 2017
Making the most of your gradle build - Greach 2017Andres Almiray
 
Gradle plugin, take control of the build
Gradle plugin, take control of the buildGradle plugin, take control of the build
Gradle plugin, take control of the buildEyal Lezmy
 
Single Page JavaScript WebApps... A Gradle Story
Single Page JavaScript WebApps... A Gradle StorySingle Page JavaScript WebApps... A Gradle Story
Single Page JavaScript WebApps... A Gradle StoryKon Soulianidis
 
Anatomy of a Gradle plugin
Anatomy of a Gradle pluginAnatomy of a Gradle plugin
Anatomy of a Gradle pluginDmytro Zaitsev
 
Integration tests: use the containers, Luke!
Integration tests: use the containers, Luke!Integration tests: use the containers, Luke!
Integration tests: use the containers, Luke!Roberto Franchini
 
Introduction to Apache Ant
Introduction to Apache AntIntroduction to Apache Ant
Introduction to Apache AntShih-Hsiang Lin
 
Making the Most of Your Gradle Build
Making the Most of Your Gradle BuildMaking the Most of Your Gradle Build
Making the Most of Your Gradle BuildAndres Almiray
 

Ähnlich wie GradleFX (20)

Gradleintroduction 111010130329-phpapp01
Gradleintroduction 111010130329-phpapp01Gradleintroduction 111010130329-phpapp01
Gradleintroduction 111010130329-phpapp01
 
Gradle
GradleGradle
Gradle
 
Gradle: The Build system you have been waiting for
Gradle: The Build system you have been waiting forGradle: The Build system you have been waiting for
Gradle: The Build system you have been waiting for
 
Faster Java EE Builds with Gradle
Faster Java EE Builds with GradleFaster Java EE Builds with Gradle
Faster Java EE Builds with Gradle
 
Faster Java EE Builds with Gradle
Faster Java EE Builds with GradleFaster Java EE Builds with Gradle
Faster Java EE Builds with Gradle
 
Improving your Gradle builds
Improving your Gradle buildsImproving your Gradle builds
Improving your Gradle builds
 
Idiomatic Gradle Plugin Writing
Idiomatic Gradle Plugin WritingIdiomatic Gradle Plugin Writing
Idiomatic Gradle Plugin Writing
 
Making the Most of Your Gradle Build
Making the Most of Your Gradle BuildMaking the Most of Your Gradle Build
Making the Most of Your Gradle Build
 
OpenCms Days 2012 - Developing OpenCms with Gradle
OpenCms Days 2012 - Developing OpenCms with GradleOpenCms Days 2012 - Developing OpenCms with Gradle
OpenCms Days 2012 - Developing OpenCms with Gradle
 
Making the most of your gradle build - Gr8Conf 2017
Making the most of your gradle build - Gr8Conf 2017Making the most of your gradle build - Gr8Conf 2017
Making the most of your gradle build - Gr8Conf 2017
 
Mastering Grails 3 Plugins - G3 Summit 2016
Mastering Grails 3 Plugins - G3 Summit 2016Mastering Grails 3 Plugins - G3 Summit 2016
Mastering Grails 3 Plugins - G3 Summit 2016
 
Gradle - Build system evolved
Gradle - Build system evolvedGradle - Build system evolved
Gradle - Build system evolved
 
Making the most of your gradle build - Greach 2017
Making the most of your gradle build - Greach 2017Making the most of your gradle build - Greach 2017
Making the most of your gradle build - Greach 2017
 
Gradle plugin, take control of the build
Gradle plugin, take control of the buildGradle plugin, take control of the build
Gradle plugin, take control of the build
 
Single Page JavaScript WebApps... A Gradle Story
Single Page JavaScript WebApps... A Gradle StorySingle Page JavaScript WebApps... A Gradle Story
Single Page JavaScript WebApps... A Gradle Story
 
Dart Workshop
Dart WorkshopDart Workshop
Dart Workshop
 
Anatomy of a Gradle plugin
Anatomy of a Gradle pluginAnatomy of a Gradle plugin
Anatomy of a Gradle plugin
 
Integration tests: use the containers, Luke!
Integration tests: use the containers, Luke!Integration tests: use the containers, Luke!
Integration tests: use the containers, Luke!
 
Introduction to Apache Ant
Introduction to Apache AntIntroduction to Apache Ant
Introduction to Apache Ant
 
Making the Most of Your Gradle Build
Making the Most of Your Gradle BuildMaking the Most of Your Gradle Build
Making the Most of Your Gradle Build
 

Mehr von Christophe Herreman

De kathedraal en de bazaar
De kathedraal en de bazaarDe kathedraal en de bazaar
De kathedraal en de bazaarChristophe Herreman
 
Stuff you didn't know about action script
Stuff you didn't know about action scriptStuff you didn't know about action script
Stuff you didn't know about action scriptChristophe Herreman
 
How to build an AOP framework in ActionScript
How to build an AOP framework in ActionScriptHow to build an AOP framework in ActionScript
How to build an AOP framework in ActionScriptChristophe Herreman
 
Spring Actionscript at Devoxx
Spring Actionscript at DevoxxSpring Actionscript at Devoxx
Spring Actionscript at DevoxxChristophe Herreman
 

Mehr von Christophe Herreman (7)

De kathedraal en de bazaar
De kathedraal en de bazaarDe kathedraal en de bazaar
De kathedraal en de bazaar
 
Stuff you didn't know about action script
Stuff you didn't know about action scriptStuff you didn't know about action script
Stuff you didn't know about action script
 
How to build an AOP framework in ActionScript
How to build an AOP framework in ActionScriptHow to build an AOP framework in ActionScript
How to build an AOP framework in ActionScript
 
AS3Commons Introduction
AS3Commons IntroductionAS3Commons Introduction
AS3Commons Introduction
 
Spring Actionscript at Devoxx
Spring Actionscript at DevoxxSpring Actionscript at Devoxx
Spring Actionscript at Devoxx
 
Spring ActionScript
Spring ActionScriptSpring ActionScript
Spring ActionScript
 
The Prana IoC Container
The Prana IoC ContainerThe Prana IoC Container
The Prana IoC Container
 

KĂŒrzlich hochgeladen

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 WorkerThousandEyes
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
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...Miguel AraĂșjo
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 

KĂŒrzlich hochgeladen (20)

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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
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...
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 

GradleFX

  • 1. GradleFx Flex Build Tool By Yennick Trevels & Steven Dick
  • 2. Yennick Trevels iDA MediaFoundry Java & Flex @SlevinBE Free Time Programming Reading Gaming
  • 4. Features Convention over Configuration Gradle Multi-project support Dependency Management Groovy scripting Source file change detection
  • 5. Gradle Example subprojects { apply plugin: 'gradlefx' version = '1.0-SNAPSHOT' repositories { mavenCentral() mavenRepo name: 'yoolab-releases', url: "http://projects.yoolab.org/maven/content/repositories/releases" mavenRepo name: 'yoolab-snapshots', url: "http://projects.yoolab.org/maven/content/repositories/snapshots" } dependencies { external group: 'org.springextensions.actionscript', name: 'spring-actionscript-core', version: '1.2-SNAPSHOT', ext: 'swc' external group: 'org.as3commons', name: 'as3commons-collections', version: '1.1', ext: 'swc' external group: 'org.as3commons', name: 'as3commons-lang', version: ‘0.3.2', ext: 'swc' external group: 'org.graniteds', name: 'granite-swc', version: '2.2.0.SP1', ext: 'swc' external group: 'org.graniteds', name: 'granite-essentials-swc', version: ‘2.2.0.SP1', ext: 'swc' } }
  • 6. Gradle Projects One or more projects per build One or more tasks per project One build.gradle file per project
  • 7. Gradle Subprojects Project structure Settings file (settings.gradle) include 'client', 'domain', 'util', 'assets‘ Configuration Injection subprojects { apply plugin: 'gradlefx' version = '1.0-SNAPSHOT' repositories { mavenCentral() } }
  • 8. Gradle Tasks Block of code that defines part of a build Create a new task task(showText, dependsOn: ‘projectB:compile’) << , println “I’m executing after the compile task" } Configure an existing Task task(copy, type: Copy) { from(file('srcDir')) into(buildDir) }
  • 9. Gradle Tasks Adding behaviour compile.doLast { println “Compilation complete" } Executing a task >gradle showText
  • 10. Gradle Methods Structure build logic task(showText) << { printList(*‘john’, ‘Alfred’, ‘Elise’+) } def printList(names) { names.each() { name -> println name } }
  • 11. Gradle Classes Defined in build script rootProjectDir/buildSrc/src/main/ standalone project
  • 12. Gradle Custom task class class CopyResources extends DefaultTask { public CopyResources() { description = 'copies the resources to the build directory' } @TaskAction def copyResources() { project.resourceDirs.each { resourceDir -> def fromLocation = project.file(resourceDir).path def toLocation = project.buildDir.path logger.info('from ' + fromLocation + ' to ' + toLocation) project.copy { from fromLocation into toLocation } } } }
  • 13. Gradle Convention properties Properties exposed by plugins Simple or complex properties Have a default value (convention) Can be overridden Example: srcDirs = ['src/main/flex']  convention = [‘src/main/actionscript’] htmlWrapper.title = ‘My html wrapper page title‘  default = project name
  • 14. Gradle Repositories repositories { mavenCentral() mavenLocal() mavenRepo name: 'yoolab-releases', url: "http://projects.yoolab.org/maven/content/repositories/releases" mavenRepo name: 'yoolab-snapshots', url: "http://projects.yoolab.org/maven/content/repositories/snapshots" }
  • 15. Gradle Dependencies Libraries/other projects used by a project Library Dependency dependencies { merged group: 'org.graniteds', name: 'granite-swc', version: graniteds_version, ext: 'swc‘ } Project Dependency merged project(':projectname')
  • 16. Gradle Configurations Bundles a set of dependencies Varies between plugins merged group: 'org.graniteds', name: 'granite-swc', version: graniteds_version, ext: 'swc‘ ‘merged’ configuration
  • 17. Gradle Three-phase build Initialization ProjectInstance { Determines projects for build name; Project instance creation } Configuration phase ProjectInstance { Runs build script of every project name = “my project” ; Configures project objects } Execution phase Execute the tasks
  • 18. Gradle Three-phase build AfterEvaluate Runs after project is configured project.afterEvaluate { project.description = project.name + “ is my sample project” }
  • 19. Gradle Ant support Ant project import Support for Ivy repositories Run Ant tasks with Gradle Example ant.java(jar: project.flexHome + '/lib/mxmlc.jar', dir: project.flexHome + '/frameworks', fork: true, resultproperty: ‘antResultProperty’, outputproperty: ‘antOutputProperty’) , arg(value: ‘-keep-as3-metadata+=Autowired,RemoteClass’) } println ant.properties*‘antOutputProperty’+
  • 20. Gradle Maven support Support for Maven repositories Maven plugin for Java based projects
  • 21. Gradle Gradle wrapper Run Gradle without installing Gradle batch/shell script How? task wrapper(type: Wrapper) { gradleVersion = ‘1.0’ } simple/ gradlew gradlew.bat gradle/wrapper/ gradle-wrapper.jar gradle-wrapper.properties
  • 23. Features SWC, SWF & AIR GradleFx Clean & copy resources tasks Html wrapper generation FlexUnit support
  • 25. GradleFx Setup Flex SDK Create FLEX_HOME environment variable  convention OR Set flexHome convention property  custom configuration Apply Plugin buildscript { repositories { mavenCentral() } dependencies { classpath group: 'org.gradlefx', name: 'gradlefx', version: '0.4.1' } } apply plugin: 'gradlefx'
  • 26. GradleFx Project type Defines to which type of archive the sources will be compiled to Convention property  type Possible values  ‘swc’, ‘swf’ or ‘air’ Example type = ‘swc’
  • 27. GradleFx Basic conventions sources  src/main/actionscript (srcDirs property) resources  src/main/resources (resourceDirs property) test sources  src/test/actionscript (testDirs property) test resources  src/test/resources (testResourceDirs property) mxml main class  Main.mxml in src/main/actionscript/ (mainClass property) build directory  build (project.buildDir property)
  • 28. GradleFx Some advanced properties Compiler options additionalCompilerOptions property One item per compiler option additionalCompilerOptions = [ '-use-network=true', '-locale=en_US', '-keep-as3-metadata+=Autowired,RemoteClass‘ ] JVM options jvmArguments property jvmArguments = ['-Xmx1024m','-Xms512m']
  • 29. GradleFx Dependency management Configurations Merged (-compiler.library-path) Internal (-compiler.include-libraries) External (-compiler.external-library-path) Rsl (-runtime-shared-library-path) Test Example external group: 'org.as3commons', name: 'as3commons-eventbus', version: '1.1', ext: 'swc' merged group: 'org.graniteds', name: 'granite-swc', version: '2.2.0.SP1', ext: 'swc'
  • 30. GradleFx AIR project required steps Create AIR descriptor file Convention "/src/main/actionscript/$,project.name-.xml“ Custom value air.applicationDescriptor: "/src/main/flex/airdescriptor.xml“ Certificate Needed to sign the AIR package PKCS12 format Password required Convention "$,project.name-.p12“ Custom value air.keystore: "certificate.p12“ air.storepass = "mypassword"
  • 31. GradleFx FlexUnit required steps Specify FlexUnit home Convention FLEXUNIT_HOME environment variable Custom value flexUnit.home = 'c:/flexunit/4.1' Specify Flash Player executable Convention FLASH_PLAYER_EXE environment variable Custom value flexunit.command = ‘c:/flashplayer/flashplayer_10.exe’ Specify FlexUnit ant task jar name Located in FlexUnit home directory Custom value flexUnit.antTasksJar = 'flexUnitTasks-4.1.0-8.jar'
  • 32. GradleFx FlexUnit required steps Specify FlexUnit dependencies dependencies { test files( "${flexUnit.home}/flexunit-4.1.0-8-flex_4.1.0.16076.swc", "${flexUnit.home}/flexunit-uilistener-4.1.0-8-4.1.0.16076.swc", "${flexUnit.home}/flexunit-cilistener-4.1.0-8-4.1.0.16076.swc“) } Specify testRunner class testClass = 'MyTestRunner.mxml'
  • 34. GradleFx What’s to come? IDEA and Eclipse project generation support AS3Doc generation Flex SDK maven artifact support?
  • 35. GradleFx Where to go next GradleFx site: https://github.com/GradleFx/GradleFx Source: https://github.com/GradleFx/GradleFx Documentation: https://github.com/GradleFx/GradleFx/wiki Examples: https://github.com/GradleFx/GradleFx-Examples Help & Support: http://gradlefx.tenderapp.com/home Bug tracker: https://github.com/GradleFx/GradleFx/issues Changelog: https://github.com/GradleFx/GradleFx/blob/master/CHANGELOG.textile