作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个Gradle任务publish
使用curl
上传我的应用程序:
task publish(dependsOn: assembleRelease) << {
def apkName = group + "-" + revision + "-" + android.defaultConfig.versionName + "-release";
println "Publishing $project.buildDir/apk/" + apkName + ".apk to mobileappstore.com";
exec {
executable "/bin/sh"
args "-c", "curl -k -u 'CD:w2'" +
" -F upload=@$project.buildDir/apk/" + apkName +
".apk -F tags=" + apkName + " http://mobileappstore.com/AE/Build/Upload";
}
}
Publishing [...]/main/build/apk/null-1.0-release.apk to mobileappstore.com
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (26) failed creating formpost data
:main:publish FAILED
FAILURE: Build failed with an exception.
* Where:
Build file '[...]/main/build.gradle' line: 103
* What went wrong:
Execution failed for task ':main:publish'.
> Process 'command '/bin/sh'' finished with non-zero exit value 26
task publish(dependsOn: assembleRelease) << {
def apkName = android.defaultConfig.versionName + "-release";
println "Publishing $project.buildDir/apk/" + apkName + ".apk to mobileappstore.com";
exec {
executable "/bin/sh"
args "-c", "curl -k -u ", "-F upload=@$project.buildDir/apk/Ae-0.0.1-test.apk", "-F tags=AutoBuild" "https://mobileappstore.com/AE/Build/Upload";
}
}
* What went wrong:
Execution failed for task ':main:publish'.
> No such property: https://mobileapptore.com/AE/Build/Upload for class: org.gradle.process.internal.DefaultExecAction_Decorated
最佳答案
URL前面的args
行缺少逗号。另外,每个参数都需要单独传递(通常是在命令行上任何空格的位置)。另外,为什么不直接执行curl
?
关于android - Gradle执行curl不上传文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23932953/
我有以下正则表达式 /[a-zA-Z0-9_-]/ 当字符串只包含从 a 到z 大小写、数字、_ 和 -。 我的代码有什么问题? 能否请您向我提供一个简短的解释和有关如何修复它的代码示例? //var
我是一名优秀的程序员,十分优秀!