机器人工作室0.8 - 不再运行自定义任务

机器人工作室0.8  - 不再运行自定义任务

问题描述:

我刚刚从Android的工作室0.6到0.8.3(在Linux Mint的15),现在我的体型是工作不正常升级。在我的摇篮文件,我有很多的自定义任务里面做prebuild步骤(复制文件,调整图像大小等)。

I have just upgraded from Android Studio 0.6 to 0.8.3 (on Linux Mint 15) and now my build is not working as expected. In my gradle file I have lots of custom Tasks which do prebuild steps (copying files, resizing images, etc).

// lots of tasks snipped  
task convertToOGG(type:Exec) {
    ext.srcDir = 'bb/src/main/buildAssets/wavs/'
    ext.destDir = 'bb/src/main/res/raw/'
    workingDir '..'
    commandLine 'python', 'scripts/convertToOGG.py', srcDir, destDir
}

gradle.projectsEvaluated {
    copyRes.dependsOn resizeImageIcon
    convertToOGG.dependsOn copyRes

    preBuild.dependsOn copyRes, convertToOGG
}

这些默认不IDE中的任何更多的运行。他们是preBuild一步的依赖关系,但不跑,如果我手动运行在IDE中preBuild步:

These don't run by default in the IDE any more. They are dependencies of the preBuild step, but don't run if I manually run the preBuild step in the IDE:

Executing tasks: [preBuild]

Configuration on demand is an incubating feature.
Relying on packaging to define the extension of the main artifact has been deprecated and is scheduled to be removed in Gradle 2.0
:Bb:preBuild
:libraries:bbengine:preBuild
:libraries:facebook:preBuild

BUILD SUCCESSFUL

Total time: 2.296 secs

它像gradle.projectsEvaluated块不再运行。奇怪的是,如果我在终端运行它的工作原理:

Its like the gradle.projectsEvaluated block is no longer run. Strangely if I run it in a terminal it works:

pickles@sirius /workspace/bb/code/trunk/bb $ ./gradlew preBuild
Relying on packaging to define the extension of the main artifact has been deprecated and is scheduled to be removed in Gradle 2.0
:Bb:resizeImageIcon
/workspace/babybot/code/trunk/BbProject
RESIZE IMAGE:  Bb/src/main/buildAssets/oversize/image_icon.png
(1024, 1024) RGBA
Targets:  5
Bb/src/main/buildAssets/res/drawable-xxhdpi/ic_launcher.png (144, 144)
Saved a (144, 144) version to Bb/src/main/buildAssets/res/drawable-xxhdpi/ic_launcher.png
Bb/src/main/buildAssets/res/drawable-xhdpi/ic_launcher.png (96, 96)
Saved a (96, 96) version to Bb/src/main/buildAssets/res/drawable-xhdpi/ic_launcher.png
Bb/src/main/buildAssets/res/drawable-hdpi/ic_launcher.png (72, 72)
Saved a (72, 72) version to Bb/src/main/buildAssets/res/drawable-hdpi/ic_launcher.png
Bb/src/main/buildAssets/res/drawable-mdpi/ic_launcher.png (48, 48)
Saved a (48, 48) version to Bb/src/main/buildAssets/res/drawable-mdpi/ic_launcher.png
Bb/src/main/buildAssets/res/drawable-ldpi/ic_launcher.png (36, 36)
Saved a (36, 36) version to Bb/src/main/buildAssets/res/drawable-ldpi/ic_launcher.png
:Bb:copyRes UP-TO-DATE
:Bb:convertToOGG
Skipping chunk of type "LIST", length 106
Opening with wav module: WAV file reader
Encoding "audio_robot_jump.wav" to 
         "audio_robot_jump.ogg" 
at quality 3.00
    [ 79.6%] [ 0m00s remaining] / 

Done encoding file "audio_robot_jump.ogg"

    File length:  0m 02.0s
    Elapsed time: 0m 00.1s
    Rate:         39.5641
    Average bitrate: 48.3 kb/s

:Bb:preBuild
:libraries:bbengine:preBuild
:libraries:facebook:preBuild

BUILD SUCCESSFUL

Total time: 15.619 secs

谁能帮助?谢谢

Can anyone help? Thanks

我固定它通过改变:

gradle.projectsEvaluated {
    copyRes.dependsOn resizeImageIcon
    convertToOGG.dependsOn copyRes

    preBuild.dependsOn copyRes, convertToOGG
}

copyRes.dependsOn resizeImageIcon
convertToOGG.dependsOn copyRes

preBuild.dependsOn copyRes, convertToOGG