小编Mar*_*tes的帖子

Android库 - 使用Gradle将多个变体发布到本地Maven存储库

我使用的是Android Gradle插件0.13.2,Android Studio 0.8.11,Gradle 2.1和maven插件.

我想用一个命令(任务)将我的Android库的多个变体(flavor + build类型)安装到本地Maven存储库.

目前Android Gradle插件0.13.2允许我将publishNonDefault标志设置为发布所有变体,但正如文档所述,它将使用与Maven Repository不兼容的分类器发布变体.

我现在的解决方法是使用defaultPublishConfig"myVariant"并为我拥有的每个变体更改它.

apply plugin: 'com.android.library'
apply plugin: 'maven'

android {
    defaultPublishConfig "myVariant"
    .
    .
    .

}

task installArchives(type: Upload) {
    repositories.mavenInstaller {
        configuration = configurations.getByName(Dependency.DEFAULT_CONFIGURATION)
        pom.groupId = "com.company"
        pom.artifactId = "mylibrary"
        pom.version = "1.0.0-myVariant"
    }
}
Run Code Online (Sandbox Code Playgroud)

我想有一个任务可以正确地将所有变种发布到本地Maven存储库.

android publish gradle maven android-library

8
推荐指数
1
解决办法
2174
查看次数

Crashlytics Gradle插件 - 风味维度额外属性不起作用

我正在使用Crashlytics Gradle插件最新版本(09/03/2015).用于定义测试版的组,发行说明或电子邮件的风味维度的额外属性将被忽略.

flavorDimensions "source", "type"

productFlavors {
    network {
        flavorDimension "source"
    }

    simulator {
        versionName "-SIMULATOR"
        flavorDimension "beaconSource"
        buildConfigField "boolean", "IS_SIMULATOR_ENABLED", "true"
    }

    paid {
        flavorDimension "type"
        ext.betaDistributionReleaseNotes="My Paid Release Notes"
        ext.betaDistributionGroupAliases="my_paid_group_alias"
    }

    free {
        flavorDimension "type"
        ext.betaDistributionReleaseNotes="My Free Release Notes"
        ext.betaDistributionGroupAliases="my_free_group_alias"
    }
}
Run Code Online (Sandbox Code Playgroud)

当我运行以下命令时:

./gradlew assembleNetworkPaidRelease crashlyticsUploadDistributionNetworkPaidRelease
Run Code Online (Sandbox Code Playgroud)

crashlytics插件会忽略额外的属性信息.

如果我将额外的属性移动到BuildType它工作:

release {
    ext.betaDistributionReleaseNotes="My Universal Release Notes"
    ext.betaDistributionGroupAliases="my_universal_group_alias"
}
Run Code Online (Sandbox Code Playgroud)

android gradle crashlytics

6
推荐指数
0
解决办法
763
查看次数

实现iOS procotol - readonly属性

我有一个来自QuickLook框架的协议:

/*!
 * @abstract The QLPreviewItem protocol declares the methods that a QLPreviewController  instance uses to access the contents of a given item.
 */
@protocol QLPreviewItem <NSObject>

@required

/*!
 * @abstract The URL of the item to preview.
 * @discussion The URL must be a file URL. 
 */
@property(readonly) NSURL * previewItemURL;

@optional

/*!
 * @abstract The item's title this will be used as apparent item title.
 * @discussion The title replaces the default item display name. This property is …
Run Code Online (Sandbox Code Playgroud)

ios

5
推荐指数
1
解决办法
2101
查看次数

Square's Retrofit Android:Hash With Request of Contents

我想使用Square的Retrofit库创建一个包含我请求的某些部分的哈希.RequestInterceptor没有帮助我,因为它不提供有关请求的信息,它只是可以向它添加信息.我需要访问HTTP动词,所有标头和REST路径来创建哈希.哈希将添加到Authorization标头中.有任何想法吗?

hash android

5
推荐指数
1
解决办法
779
查看次数

标签 统计

android ×3

gradle ×2

android-library ×1

crashlytics ×1

hash ×1

ios ×1

maven ×1

publish ×1