美文网首页
Android Plugin 3.0 构建变体输出API变化

Android Plugin 3.0 构建变体输出API变化

作者: Android_Dev | 来源:发表于2019-05-14 16:53 被阅读0次

    变体输出

    // If you use each() to iterate through the variant objects,

    // you need to start using all(). That's because each() iterates

    // through only the objects that already exist during configuration time—

    // but those object don't exist at configuration time with the new model.

    // However, all() adapts to the new model by picking up object as they are

    // added during execution.

    android.applicationVariants.all{ variant -> 

     variant.outputs.all{ 

     outputFileName = "${variant.name}-${variant.versionName}.apk" 

     }}

    迁移到 Android Plugin for Gradle 3.0.0

    相关文章

      网友评论

          本文标题:Android Plugin 3.0 构建变体输出API变化

          本文链接:https://www.haomeiwen.com/subject/itgrqqtx.html