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

Plugin include.gradle loses flavor properties #480

Closed
ddfreiling opened this issue Jun 14, 2016 · 0 comments
Closed

Plugin include.gradle loses flavor properties #480

ddfreiling opened this issue Jun 14, 2016 · 0 comments
Assignees

Comments

@ddfreiling
Copy link
Contributor

ddfreiling commented Jun 14, 2016

Overview of the issue:
When a nativescript plugin has an include.gradle file for Android, it seems to lose all the properties set within the android {} tags. Only the dependencies {} seems to be kept. Previously before version 2.0.0 this did not occur, and I used it to build my app for a specific android architecture. Primarily to speed up my development process when using libVLC for android through a plugin.

Motivation for or use case:
I want to specify the android architecture to build using ndk { abiFilters } from my plugin, since this is not currently possible through the CLI. See NativeScript/nativescript-cli#1392.

Telerik NativeScript version(s): CLI 2.0.1, android-runtime 2.0.0

Steps to reproduce:
Make a plugin with the following platforms/android/include.gradle file:

android {
    productFlavors {
        "nativescript-plugin-name" {
            dimension "nativescript-plugin-name"

            // Setting below requires 'android.useDeprecatedNdk=true' in gradle.properties
            ndk {
                abiFilters 'armeabi-v7a'
            }
        }
    }
}
dependencies {
    compile 'de.mrmaffen:vlc-android-sdk:1.9.8'
}

Now add it to an app and build it. In the platforms/android/configurations folder will now be the processed version of the above include.gradle file, which looks like this:

android {
    productFlavors {
              "F0" {
                dimension "nativescriptpluginname"
              }
            }
}
dependencies {
    compile 'de.mrmaffen:vlc-android-sdk:1.9.8'
}

Properties lost and it will no longer build to a specific architecture.

Suggest a fix:
In the generated build.gradle file for the android platform it seems that the function replaceProductFlavorInContent is reponsible for stripping out any properties within the android {} tags. Is it meant to be like this or is it a bug? I don't know what the intent of this is.

Preferrably I'd like to be able to set the build architecture through the CLI, but for now setting it through an include.gradle file would be nice.

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

No branches or pull requests

2 participants