Getting package name of application variant in gradle plugin

后端 未结 3 844
感情败类
感情败类 2021-02-19 08:53

I\'m building a gradle plugin that adds a new task for every application variant. This new task needs the package name of the application variant.

This is my current cod

3条回答
  •  我在风中等你
    2021-02-19 09:20

    This will handle nullable applicationIdSuffix for you:

    android.applicationVariants.all { variant ->
        def applicationId = [variant.mergedFlavor.applicationId, variant.buildType.applicationIdSuffix].findAll().join()
        println applicationId 
    }
    

提交回复
热议问题