Skip to content

Commit

Permalink
Updates all of the library dependencies and tests to API 27
Browse files Browse the repository at this point in the history
Bug: 77224738
Change-Id: I26849d7b70addbda4326c7c11a982ce94b204969
  • Loading branch information
Fleker committed Apr 2, 2018
1 parent f279da5 commit 8610eb7
Show file tree
Hide file tree
Showing 14 changed files with 75 additions and 51 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ build/
local.properties
*.iml
.DS_Store
keystore.properties
20 changes: 12 additions & 8 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 24
buildToolsVersion '23.0.3'
compileSdkVersion 27
buildToolsVersion "27.0.3"

defaultConfig {
applicationId "com.example.android.sampletvinput"
minSdkVersion 21
targetSdkVersion 24
versionCode 2
versionName "1.1"
targetSdkVersion 27
versionCode 3
versionName "1.2"
}

buildTypes {
Expand All @@ -20,10 +20,14 @@ android {
}
}

ext {
appCompatVersion = '27.1.0'
}

dependencies {
compile project(':library')
compile 'com.android.support:recyclerview-v7:24.0.0'
compile 'com.android.support:leanback-v17:24.0.0'
compile 'com.android.support:appcompat-v7:24.0.0'
compile "com.android.support:recyclerview-v7:$appCompatVersion"
compile "com.android.support:leanback-v17:$appCompatVersion"
compile "com.android.support:appcompat-v7:$appCompatVersion"
compile 'com.google.android.exoplayer:exoplayer:r1.5.14'
}
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
classpath 'com.android.tools.build:gradle:3.1.0'
}
}

allprojects {
repositories {
jcenter()
google()
}
}
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Aug 22 14:19:34 PDT 2016
#Wed Mar 28 17:53:17 PDT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-bin.zip
49 changes: 32 additions & 17 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ apply plugin: 'com.android.library'
apply plugin: 'maven-publish'

android {
compileSdkVersion 24
buildToolsVersion "23.0.3"
compileSdkVersion 27

defaultConfig {
minSdkVersion 21
targetSdkVersion 24
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand All @@ -21,33 +20,44 @@ android {
minifyEnabled false
}
}
sourceSets {
instrumentTest.setRoot('src/androidTest/')

packagingOptions {
exclude 'error_prone/Annotations.gwt.xml'
exclude 'third_party/java_src/error_prone/project/annotations/Annotations.gwt.xml'
exclude 'third_party/java_src/error_prone/project/annotations/Google_internal.gwt.xml'
exclude 'jsr305_annotations/Jsr305_annotations.gwt.xml'
}
}

configurations {
doclava
}

ext {
appCompatVersion = '27.1.0'
playServicesVersion = '12.0.0'
supportTestVersion = '1.0.1'
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:24.0.0'
compile 'com.android.support:leanback-v17:24.0.0'
compile "com.android.support:appcompat-v7:$appCompatVersion"
compile "com.android.support:leanback-v17:$appCompatVersion"
compile 'com.google.ads.interactivemedia.v3:interactivemedia:3.2.1'
compile 'com.google.android.gms:play-services-ads:8.4.0'
compile "com.google.android.gms:play-services-ads:$playServicesVersion"

testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.10.19'
testCompile "org.robolectric:robolectric:3.1"
androidTestCompile 'com.android.support:support-annotations:24.0.0'
androidTestCompile 'com.android.support.test:runner:0.4.1'
androidTestCompile 'com.android.support.test:rules:0.4.1'
androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
testCompile 'org.mockito:mockito-core:2.8.9'
testCompile "org.robolectric:robolectric:3.8"

androidTestCompile "com.android.support:support-annotations:$appCompatVersion"
androidTestCompile "com.android.support.test:runner:$supportTestVersion"
androidTestCompile "com.android.support.test:rules:$supportTestVersion"
androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.3'
doclava 'com.google.doclava:doclava:1.0.6'
}

def packageVersion = '0.3'
def packageVersion = '0.4'

task sourceJar(type: Jar) {
classifier = 'sources'
Expand Down Expand Up @@ -99,9 +109,14 @@ publishing {
}
}

// Load keystore
def keystorePropertiesFile = rootProject.file("keystore.properties");
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))

bintray {
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_API_KEY')
user = keystoreProperties['BINTRAY_USER']
key = keystoreProperties['BINTRAY_API_KEY']
publications = ['libraryPublish']
publish = true
pkg {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@
import static org.junit.Assert.fail;

import com.google.android.media.tv.companionlibrary.BuildConfig;
import org.robolectric.RobolectricGradleTestRunner;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;

/**
* Test {@link Advertisement} can be properly generated with builder pattern, copied from another
* {@link Advertisement} instance and parsed by {@link InternalProviderData}.
*/
@RunWith(RobolectricGradleTestRunner.class)
@RunWith(RobolectricTestRunner.class)
@Config(constants = BuildConfig.class, sdk = 21,
manifest = "src/main/AndroidManifest.xml")
public class AdvertisementTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@
import android.os.Build;
import android.support.annotation.RequiresApi;
import com.google.android.media.tv.companionlibrary.BuildConfig;
import org.robolectric.RobolectricGradleTestRunner;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;

/**
* Tests that channels can be created using the Builder pattern and correctly obtain
* values from them
*/
@RunWith(RobolectricGradleTestRunner.class)
@RunWith(RobolectricTestRunner.class)
@Config(constants = BuildConfig.class, sdk = 23,
manifest = "src/main/AndroidManifest.xml")
@RequiresApi(api = Build.VERSION_CODES.M)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@
import static org.junit.Assert.fail;

import com.google.android.media.tv.companionlibrary.BuildConfig;
import org.robolectric.RobolectricGradleTestRunner;
import java.util.ArrayList;
import junit.framework.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;

/**
* Tests that core and custom data objects can be created using the InternalProviderData class and
* retrieved successfully with proper error handling
*/
@RunWith(RobolectricGradleTestRunner.class)
@RunWith(RobolectricTestRunner.class)
@Config(
constants = BuildConfig.class,
sdk = 23,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@
import android.support.annotation.RequiresApi;
import com.google.android.media.tv.companionlibrary.BuildConfig;
import com.google.android.media.tv.companionlibrary.utils.TvContractUtils;
import org.robolectric.RobolectricGradleTestRunner;
import java.util.Arrays;
import java.util.Objects;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;

/**
* Tests that programs can be created using the Builder pattern and correctly obtain
* values from them
*/
@RunWith(RobolectricGradleTestRunner.class)
@RunWith(RobolectricTestRunner.class)
@Config(constants = BuildConfig.class, sdk = 23,
manifest = "src/main/AndroidManifest.xml")
public class ProgramTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
import android.os.Build;
import android.support.annotation.RequiresApi;
import com.google.android.media.tv.companionlibrary.BuildConfig;
import org.robolectric.RobolectricGradleTestRunner;
import java.util.Arrays;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;

@RunWith(RobolectricGradleTestRunner.class)
@RunWith(RobolectricTestRunner.class)
@Config(constants = BuildConfig.class, sdk = 23,
manifest = "src/main/AndroidManifest.xml")
public class RecordedProgramTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,28 @@
import com.google.android.media.tv.companionlibrary.model.Channel;
import com.google.android.media.tv.companionlibrary.model.Program;
import com.google.android.media.tv.companionlibrary.sync.EpgSyncJobService;
import org.robolectric.RobolectricGradleTestRunner;
import java.util.List;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.Robolectric;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.android.controller.FragmentController;
import org.robolectric.annotation.Config;
import org.robolectric.shadows.ShadowLooper;
import org.robolectric.shadows.ShadowToast;
import org.robolectric.util.FragmentController;

/** Tests for {@link ChannelSetupStepFragment} */
@RunWith(RobolectricGradleTestRunner.class)
/**
* Tests for {@link ChannelSetupStepFragment}
*
* Make sure to go to 'Edit Configurations' and set the 'Working Directory' to '$MODULE_DIR$'
*/
@RunWith(RobolectricTestRunner.class)
@Config(
constants = BuildConfig.class,
sdk = 23,
manifest =
"//third_party/java_src/android_libs/tif_companion_library/src/test/java/"
+ "com/google/android/media/tv/companionlibrary/setup:test_lib/AndroidManifest.xml"
manifest = "../../../../../src/test/java/com/google/android/media/tv/companionlibrary/setup/AndroidManifest.xml"
)
public class ChannelSetupStepFragmentTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@
import android.content.Intent;
import com.google.android.media.tv.companionlibrary.BuildConfig;
import com.google.android.media.tv.companionlibrary.sync.SyncStatusBroadcastReceiver.SyncListener;
import org.robolectric.RobolectricGradleTestRunner;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;

/**
* Tests that channels can be created using the Builder pattern and correctly obtain values from
* them
*/
@RunWith(RobolectricGradleTestRunner.class)
@RunWith(RobolectricTestRunner.class)
@Config(
constants = BuildConfig.class,
sdk = 23,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
import com.google.android.media.tv.companionlibrary.model.Channel;
import com.google.android.media.tv.companionlibrary.model.InternalProviderData;
import com.google.android.media.tv.companionlibrary.model.Program;
import org.robolectric.RobolectricGradleTestRunner;
import java.io.InputStream;
import java.text.ParseException;
import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;

@RunWith(RobolectricGradleTestRunner.class)
@RunWith(RobolectricTestRunner.class)
@Config(constants = BuildConfig.class, sdk = 21, manifest = "src/main/AndroidManifest.xml")
public class XmlTvAdvertisementTest {
@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@
import com.google.android.media.tv.companionlibrary.BuildConfig;
import com.google.android.media.tv.companionlibrary.model.InternalProviderData;
import com.google.android.media.tv.companionlibrary.utils.TvContractUtils;
import org.robolectric.RobolectricGradleTestRunner;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import junit.framework.TestCase;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;

/** Tests for {@link XmlTvParser}. */
@RunWith(RobolectricGradleTestRunner.class)
@RunWith(RobolectricTestRunner.class)
@Config(constants = BuildConfig.class, sdk = 23,
manifest = "src/main/AndroidManifest.xml")
@RequiresApi(api = Build.VERSION_CODES.M)
Expand Down

0 comments on commit 8610eb7

Please sign in to comment.