Use freeImplementation for including conscrypt in Free builds.

This removes the need for the -PfreeBuild flag to gradle, and makes
assemblePlay and assembleDebug build all flavours without errors again.
Changed circleci config back accordingly and removed comment about
-PfreeBuild. Based on #4457.
This commit is contained in:
Mats Wahlberg 2020-10-02 14:39:02 +02:00
parent 468acab8f4
commit 06d212b911
3 changed files with 6 additions and 12 deletions

View File

@ -38,7 +38,7 @@ workflows:
build-steps:
- run:
name: Build debug
command: ./gradlew assemblePlayDebug -PdisablePreDex
command: ./gradlew assembleDebug -PdisablePreDex
- run:
name: Execute debug unit tests
command: ./gradlew :core:testPlayDebugUnitTest -PdisablePreDex
@ -47,7 +47,7 @@ workflows:
build-steps:
- run:
name: Build release
command: ./gradlew assemblePlayRelease -PdisablePreDex
command: ./gradlew assembleRelease -PdisablePreDex
- run:
name: Execute release unit tests
command: ./gradlew :core:testPlayReleaseUnitTest -PdisablePreDex

View File

@ -88,10 +88,12 @@ dependencies {
api "com.google.android.support:wearable:$wearableSupportVersion"
compileOnly "com.google.android.wearable:wearable:$wearableSupportVersion"
} else {
System.out.println("core: free build hack, skipping some dependencies and bundling conscrypt ($conscryptVersion)")
implementation "org.conscrypt:conscrypt-android:$conscryptVersion"
System.out.println("core: free build hack, skipping some dependencies")
}
// bundle conscrypt with free builds
freeImplementation "org.conscrypt:conscrypt-android:$conscryptVersion"
testImplementation "org.awaitility:awaitility:$awaitilityVersion"
testImplementation 'junit:junit:4.13'
testImplementation 'org.mockito:mockito-core:1.10.19'

View File

@ -2,14 +2,6 @@ package de.danoeh.antennapod.core;
import android.content.Context;
import java.security.Security;
/*
* If you get an error here ("package org.conscrypt does not exist"), you are probably doing a free
* build and didn't pass "-PfreeBuild" to gradle (e.g. "./gradlew assembleFreeRelease -PfreeBuild").
*
* If you are doing a non-free build using "assembleRelease" or "assembleDebug" and get this error,
* use "assemblePlayRelease" or "assemblePlayDebug" instead (e.g. "./gradlew assemblePlayRelease").
*/
import org.conscrypt.Conscrypt;
import de.danoeh.antennapod.core.preferences.PlaybackPreferences;