Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android GitLab CI upload multiple buildTypes #187

Open
sebasira opened this issue Nov 17, 2019 · 0 comments
Open

Android GitLab CI upload multiple buildTypes #187

sebasira opened this issue Nov 17, 2019 · 0 comments

Comments

@sebasira
Copy link
Contributor

I have and Android Library that when building with Android Studio I can see two aar files, like:

  • myLib-1.0-debug.aar
  • myLIb-1.0-release.aar

But when using the gitlab-ci.yml example from this repo, after it concludes it says something lie:

> Task :clean UP-TO-DATE
> Task :app:clean
> Task :app:preBuild UP-TO-DATE
> Task :app:preReleaseBuild UP-TO-DATE
> Task :app:compileReleaseAidl NO-SOURCE
> Task :app:compileReleaseRenderscript NO-SOURCE
> Task :app:checkReleaseManifest
> Task :app:generateReleaseBuildConfig
> Task :app:generateReleaseResValues
> Task :app:generateReleaseResources
> Task :app:packageReleaseResources
> Task :app:parseReleaseLibraryResources
> Task :app:processReleaseManifest
> Task :app:generateReleaseRFile
> Task :app:javaPreCompileRelease
> Task :app:compileReleaseJavaWithJavac
> Task :app:extractReleaseAnnotations
> Task :app:mergeReleaseGeneratedProguardFiles UP-TO-DATE
> Task :app:mergeReleaseConsumerProguardFiles UP-TO-DATE
> Task :app:mergeReleaseShaders
> Task :app:compileReleaseShaders
> Task :app:generateReleaseAssets
> Task :app:packageReleaseAssets
> Task :app:packageReleaseRenderscript NO-SOURCE
> Task :app:prepareLintJarForPublish UP-TO-DATE
> Task :app:processReleaseJavaRes NO-SOURCE
> Task :app:mergeReleaseJavaResource
> Task :app:transformClassesAndResourcesWithSyncLibJarsForRelease
> Task :app:mergeReleaseJniLibFolders
> Task :app:mergeReleaseNativeLibs
> Task :app:stripReleaseDebugSymbols
> Task :app:transformNativeLibsWithSyncJniLibsForRelease
> Task :app:bundleReleaseAar
> Task :app:artifactoryPublish
> Task :artifactoryPublish
Deploying artifact: http://xxxxxxxxxx/artifactory/gradle-release/
package/myLib/1.0/myLib-1.0.aar
> Task :artifactoryDeploy

I would like/expect something like:

Deploying artifact: http://xxxxxxxxxx/artifactory/gradle-release/package/myLib/1.0/myLib-1.0-debug.aar

Deploying artifact: http://xxxxxxxxxx/artifactory/gradle-release/package/myLib/1.0/myLib-1.0-release.aar

This is part of my build.gradle:

group = 'ar.com.sebasira'
version = '1.0'
project.archivesBaseName = rootProject.name

android {
    compileSdkVersion 29
    defaultConfig {
        minSdkVersion 19
        targetSdkVersion 29
        versionName project.version
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    // How to Rename the output AAR file:
    //      - https://stackoverflow.com/questions/24728591/how-to-set-name-of-aar-output-from-gradle
    // Note that 'defaultConfig' references the above closure with that name
    // And rootProject.name is defined in settings.gradle
    libraryVariants.all { variant ->
        variant.outputs.all {
            // Do not add Variant (buildType) Name at the end
            outputFileName = "${rootProject.name}-${defaultConfig.versionName}-${variant.name}.aar"
        }
    }
}

Can you explain me how to achieve this? Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant