发布一个利用图书馆ship.io(持续集成框架) [英] Release a library using ship.io (continues integration framework)

查看:204
本文介绍了发布一个利用图书馆ship.io(持续集成框架)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下应用下的模块中的build.gradle任务,以释放出库作为的jar文件以及的javadoc

I have following tasks in build.gradle under app module in order to release a library as a jar file as well as javadoc.

apply plugin: 'com.android.library'

def filename = 'myLib.jar'
def output = "build/Lib-MobileFramework-Android.${version}/"

task javadoc(type: Javadoc) {
    source = android.sourceSets.main.java.srcDirs
    classpath += project.files(project.android.getBootClasspath())
    destinationDir = file("$output javadoc/")
    //Suppress warnings that can cause fail build on continuous integration tools
    failOnError false
}

task clearJar(type: Delete) {
    delete "$output $filename"
}

task makeJar(type: Copy) {
    from('build/intermediates/bundles/release/')
    into("$output")
    include('classes.jar')
    rename('classes.jar', "$filename")
}

//Dependent tasks will be executed first before executing requested task
makeJar.dependsOn(javadoc, clearJar, ':app:packageReleaseJar')

task copyApk(type: Copy, dependsOn: ':test:assembleRelease') {
    from(project(':test').file('build/outputs/apk/'))
    into("${output}TestApp/")
    include('test-release.apk')
    rename('test-release.apk', 'TestApp.apk')
}

task releaseLib(type: Delete, dependsOn: [makeJar, copyApk]) {
   delete project(':test').file('build/generated/')
   delete project(':test').file('build/outputs/')
   delete project(':test').file('build/tmp/')
   delete project(':test').file('build/intermediates/')
   delete 'build/generated/'
   delete 'build/intermediates/'
   delete 'build/outputs/'
   delete 'build/tmp/'
}

通过执行使用 ReleaseLib 任务摇篮包装从终端,我将有库 - MobileFramework-的Andr​​oid 文件夹包括的javadoc myLib.jar 。这正是我的预期。

By executing ReleaseLib task using Gradle wrapper from terminal, I will have Lib-MobileFramework-Android folder includes javadoc and myLib.jar. That is exactly what I expected.

MobileFramework-Android.zip -> javadoc, myLib.jar, MyApp -> TestApp.apk

我用 ship.io 作为继续集成框架。当我从那里执行任务releaseLib,javadoc中正在MobileFramework,Android的文件夹作为预期,但.jar文件不是在文件夹,而外面。所以,我有以下:

I use ship.io as continues integration framework. When I execute releaseLib task from there, javadoc is under MobileFramework-Android folder as expected, but .jar file is not under folder rather outside it. So I have following:

MobileFramework-Android.zip -> javadoc, TestApp (Empty folder)
myLib.jar
TestApp.apk

这是为什么和如何解决?

Why is that and what is the solution?

推荐答案

我们做一些文件移动到文物目录,包括.jar文件。我在最近的版本在您的帐户证实了这一点,在libMobileTagging.jar文件是在文物目录。如果您有兴趣将其移动到特定的位置,你可以在你的任务的gradle移动创建/移动要保存的目录中运行命令。

We do move some files to the artifacts directory, including the .jar file. I confirmed this in the most recent build on your account, the 'libMobileTagging.jar' file is in the artifacts directory. If you're interested in moving it to a specific location, you can run a command in your gradle task to move create/move the directory you want to save.

让我知道,如果这有助于。

Let me know if this helps.

这篇关于发布一个利用图书馆ship.io(持续集成框架)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆