Exception is thrown when dependencies are added
Hi
I am trying to generate my Flash builder project by running "gradle flashbuilder" but instead I get the following error
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/jhon/Projects/GradleTest/build.gradle' line: 13
* What went wrong:
A problem occurred evaluating root project 'GradleTest'.
> No signature of method: org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.external() is applicable for argument types: (java.util.LinkedHashMap) values: [[group:org.as3commons, name:as3commons-collections, ...]]
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 3.335 secs
### Here is my build file. Any idea what might be wrong?
Thanks
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath group: 'org.gradlefx', name: 'gradlefx', version: '0.5'
external group: 'org.as3commons', name: 'as3commons-collections', version: '1.1', ext: 'swc'
external group: 'org.as3commons', name: 'as3commons-eventbus', version: '1.1', ext: 'swc'
}
}
apply plugin: 'gradlefx'
apply plugin: 'flashbuilder'
type = 'swf'
srcDirs = ['src/']
resourceDirs = ['assets/']
testDirs = ['test']
testResourceDirs = ['test/testresources']
// Option necessary to embed configuration file to cuePoint class.
additionalCompilerOptions = [
'-static-link-runtime-shared-libraries=true'
]
mainClass = 'CallToAction.as'
dependencies {
//merged files('lib/as3corelib.swc')
merged fileTree(dir: 'lib/', include: '*.swc')
}
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Maxime Cowez on 25 Sep, 2013 09:58 PM
Hi Jhon,
At first glance it looks like you've misplaced your as3commons dependencies. The
buildscript.dependencies
node should contain only those dependencies required to run the Gradle build script, i.e. just the GradleFx plugin artifact in this case.Those as3commons
external
dependencies should go into the projectdependencies
node together with themerged
libraries you've already got there.2 Posted by Jhon on 26 Sep, 2013 05:10 PM
Thanks for you prompt response. I moved as3commons to the project dependency node and now I am getting the following error :
Thanks
gradle compile
:copyresources
:compileFlex
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileFlex'.
> Could not resolve all dependencies for configuration ':external'.
> Could not find group:org.as3commons, module:as3commons-collections, version:1.1.
Required by:
:TestGradleProject:unspecified
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 6.196 secs
xinexus2:TestGradleProject
/**
* Build File: follow the directions in the README.txt to build
* this plug-in from the source.
*
*/
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath group: 'org.gradlefx', name: 'gradlefx', version: '0.6.4'
}
}
apply plugin: 'gradlefx'
apply plugin: 'flashbuilder'
type = 'swf'
srcDirs = ['src/']
testDirs = ['test']
testResourceDirs = ['test/testresources']
resourceDirs = ['assets/']
// Option necessary to embed configuration file to cuePoint class.
additionalCompilerOptions = [
'-static-link-runtime-shared-libraries=true'
]
mainClass = 'CallToAction.as'
dependencies {
//merged files('lib/as3corelib.swc')
merged fileTree(dir: 'lib/', include: '*.swc')
external group: 'org.as3commons', name: 'as3commons-collections', version: '1.1', ext: 'swc'
}
Support Staff 3 Posted by Maxime Cowez on 27 Sep, 2013 01:58 PM
You didn't define any repositories where Gradle(Fx) is supposed to look for your dependencies. Usually you'd pull dependencies from Maven central:
however I think as3commons is not available on Maven central. So you have three options:
merged
dependenciesFor option number 2 you'll have to add the URL to your self-hosted repo:
4 Posted by Jhon on 27 Sep, 2013 03:20 PM
Thanks Maxime. You guys have the best technical support.