ninetwozero / gradle-to-js

A quick & dirty Gradle build file to JavaScript object parser
Apache License 2.0
47 stars 21 forks source link

read value of some property in gradle file #22

Closed iadcg closed 5 years ago

iadcg commented 5 years ago

Can this lib ready the value of a property or key in a gradle file?

For example: android { compileSdkVersion rootProject.ext.compileSdkVersion buildToolsVersion rootProject.ext.buildToolsVersion

compileOptions {
    sourceCompatibility 1.8
    targetCompatibility 1.8
}

defaultConfig {
    applicationId "com.axinan.galadriel"
    minSdkVersion rootProject.ext.minSdkVersion
    targetSdkVersion rootProject.ext.targetSdkVersion
    versionCode 1
    versionName "1.0.0"
    multiDexEnabled true
    ndk {
        abiFilters "armeabi-v7a", "x86"
    }

}

i want to get the value of multiDexEnabled. Btw, Im working on a react native android app here

karllindmark commented 5 years ago

Yeah, should be achievable with something like:

parsedResult['android']['defaultConfig']['multiDexEnabled']

If I'm not mistaken. 🤔

Can you verify?

karllindmark commented 5 years ago

Hey @iadcg, did my proposed solution work? :-)