目录

Android开发-多渠道处理修改aar输出目录和名称

目录

   libraryVariants.all { variant ->
          if (variant.buildType.name == "debug") {
              variant.getPackageLibrary().destinationDir = new File(project.rootDir.absolutePath + "/xxx")
          }

          if (variant.buildType.name == 'debug') {
              variant.outputs.all { output ->
                  def outputFile = output.outputFile
                  if (outputFile != null && outputFile.name.endsWith('debug.aar')) {
                     outputFileName = "${project.name}-${variant.flavorName}-${variant.buildType.name}.aar"
                  }
              }
          }
      }