Basic Setup¶
Requirements¶
- Gradle v2.4
- Minimum Flex 4.x
Using the plugin in your project¶
To use the plugin in your project, you’ll have to add the following to your build.gradle file:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath group: 'org.gradlefx', name: 'gradlefx', version: '1.4.0'
}
}
apply plugin: 'gradlefx'
Make sure that the buildscript structure is at the top of your build file.
Setting up the Flex/Air SDK¶
- Depending on your project, you’ll need the Flex and/or AIR SDK. GradleFx gives you several options to specify the Flex/AIR SDK:
set the FLEX_HOME environment variable (convention), this should point to your Flex/AIR SDK installation.
set the flexHome convention property to the location of your Flex/AIR SDK
flexHome = "C:/my/path/to/the/flex/sdk"
specify the Flex/AIR SDK as a dependency. See Flex/AIR SDK Auto Install
Defining the project type¶
example project type definition:
type = 'swc'
Flex or pure Actionscript?¶
GradleFx also needs to know whether you want to use the Flex framework, since you can also create an Actionscript-only project. Several situations are possible here:
When you only use the AIR SDK it’s easy, you don’t have to do anything special. It will be an Actionscript-only project by default and no Flex framework linkage will happen. GradleFx will also use the ASC 2.0 compiler provided in the new AIR SDKs by default.
When using the Flex SDK (with or without the AIR SDK), by default GradleFx (and the compiler) will assume you’ll use the Flex framework. However, when you want to build an Actionscript-only project that just uses the Flex SDK compilers, then you have to set framework linkage to ‘none’ as follows:
frameworkLinkage = 'none'