为androidTest定义buildConfigField

栏目: IOS · Android · 发布时间: 5年前

内容简介:Android Studio标记为红色但有效.翻译自:https://stackoverflow.com/questions/33909021/define-buildconfigfield-for-androidtest

我在BuildConfig中定义了一个特定字段,用于在运行时获取URL.因此,对于每种构建类型,我使用不同的字符串:

prod {
        buildConfigField "String", "BASE_URL", "\"abc.com\""
    }

    debug {
        buildConfigField "String", "BASE_URL", "\"efg.com\""
    }

在运行android测试时是否可以定义不同的URL?我尝试将此设置放在sourceSets-> androidTest下,但它不被接受.

Android Studio标记为红色但有效.

翻译自:https://stackoverflow.com/questions/33909021/define-buildconfigfield-for-androidtest


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Lighttpd

Lighttpd

Andre Bogus / Packt Publishing / 2008-10 / 39.99

This is your fast guide to getting started and getting inside the Lighttpd web server. Written from a developer's perspective, this book helps you understand Lighttpd, and get it set up as securely an......一起来看看 《Lighttpd》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具