Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Commit

Permalink
Merge pull request #90 from Orange-OpenSource/develop
Browse files Browse the repository at this point in the history
2.0.3
  • Loading branch information
florentmaitre authored Dec 16, 2020
2 parents 85cb2dd + ae429be commit 381e20b
Show file tree
Hide file tree
Showing 51 changed files with 782 additions and 310 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: build
on: [push, pull_request]
defaults:
run:
shell: bash
jobs:
assemble:
runs-on: ubuntu-latest
name: Assemble
steps:
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Checkout code
uses: actions/checkout@v2
- name: Set up cache
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- run: ./gradlew assemble
verification:
runs-on: ubuntu-latest
needs: assemble
strategy:
matrix:
parameters:
- { job-name: 'Kotlin linter', gradle-command: './gradlew ktlint' }
- { job-name: 'Java linter', gradle-command: './gradlew checkstyleMain' }
- { job-name: 'Unit tests', gradle-command: './gradlew :sdk:test' }
name: ${{ matrix.parameters.job-name }}
steps:
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Checkout code
uses: actions/checkout@v2
- name: Set up cache
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- run: ${{ matrix.parameters.gradle-command }}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
.gradle
local.properties
.idea/caches
.idea/compiler.xml
.idea/jarRepositories.xml
.idea/libraries
.idea/markdown-navigator-enh.xml
.idea/markdown-navigator.xml
.idea/modules.xml
.idea/workspace.xml
.idea/navEditor.xml
Expand All @@ -11,3 +15,4 @@ local.properties
build
captures
.externalNativeBuild

3 changes: 3 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 0 additions & 34 deletions .travis.yml

This file was deleted.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</tr>
<tr>
<td>Build status</td>
<td><a href="https://travis-ci.org/Orange-OpenSource/OCast-JVM"><img src="https://travis-ci.org/Orange-OpenSource/OCast-JVM.svg?branch=master"></a></td>
<td><a href="https://github.com/Orange-OpenSource/OCast-JVM/actions?query=workflow%3Abuild"><img src="https://github.com/Orange-OpenSource/OCast-JVM/workflows/build/badge.svg"></a></td>
</tr>
<tr>
<td>OCast SDK</td>
Expand All @@ -20,7 +20,7 @@
</tr>
<tr>
<td>Documentation</td>
<td><a href="https://orange-opensource.github.io/OCast-JVM/"><img src="https://img.shields.io/badge/javadoc-2.0.2-brightgreen"></a></td>
<td><a href="https://orange-opensource.github.io/OCast-JVM/"><img src="https://img.shields.io/badge/javadoc-2.0.3-brightgreen"></a></td>
</tr>
</tbody>
</table>
Expand All @@ -42,10 +42,10 @@ repositories {
}
dependencies {
implementation "org.ocast:sdk:2.0.2"
implementation "org.ocast:sdk:2.0.3"
// The following line is only needed if you are using OCast on Android
// and want to take advantage of the MediaRouter framework
implementation "org.ocast:mediaroute:2.0.2"
implementation "org.ocast:mediaroute:2.0.3"
}
```

Expand Down
25 changes: 12 additions & 13 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,27 @@ ext {
compile_sdk_version = 29
min_sdk_version = 19
target_sdk_version = 29
build_tools_version = '29.0.2'
build_tools_version = '29.0.3'

android_gradle_plugin_version = '3.5.1'
annotations_version = '12.0'
android_gradle_plugin_version = '4.1.1'
bintray_plugin_version = '1.8.4'
checkstyle_version = '8.23'
constraint_layout_version = '1.1.3'
constraint_layout_version = '2.0.4'
dokka_version = '0.9.18'
espresso_version = '3.2.0'
espresso_version = '3.3.0'
harmcrest_version = '1.3'
jackson_version = '2.9.6' // Keep this version for compatibility with Android 4.4 (API level 19)
json_version = '20180813'
junit_version = '4.12'
kotlin_version = '1.3.50'
ktlint_version = '0.34.2'
lifecycle_version = '2.1.0'
material_version = '1.0.0'
junit_version = '4.13.1'
kotlin_version = '1.4.20'
ktlint_version = '0.40.0'
lifecycle_version = '2.2.0'
material_version = '1.2.1'
media_router_version = '1.1.0'
mockito_core_version = '2.27.0'
mockito_kotlin_version = '2.1.0'
mockito_core_version = '3.5.7'
mockito_kotlin_version = '2.2.0'
multidex_version = '2.0.1'
okhttp_version = '3.14.0'
powermock_version = '2.0.2'
runner_version = '1.2.0'
runner_version = '1.3.0'
}
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 @@
#Fri Aug 23 10:34:23 CEST 2019
#Tue Dec 08 15:41:37 CET 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
5 changes: 0 additions & 5 deletions mediaroute/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'org.jetbrains.dokka-android'
apply plugin: 'maven-publish'
apply from: project.file('../ktlint.gradle')
apply from: project.file('../bintray.gradle')

androidExtensions {
experimental = true
}

buildscript {
apply from: project.file('../dependencies.gradle')
apply from: project.file('../publish.gradle')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ import androidx.mediarouter.media.MediaRouteDescriptor
import androidx.mediarouter.media.MediaRouteDiscoveryRequest
import androidx.mediarouter.media.MediaRouteProvider
import androidx.mediarouter.media.MediaRouteProviderDescriptor
import java.util.Collections
import org.ocast.sdk.core.Device
import org.ocast.sdk.core.DeviceCenter
import org.ocast.sdk.core.DeviceListener
import java.util.Collections

/**
* This class is a concrete implementation of [MediaRouteProvider] to discover OCast devices with the Android media route framework.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ internal class AndroidUIThreadCallbackWrapper : CallbackWrapper {
/** A handler on the main thread. */
private val mainHandler = Handler(Looper.getMainLooper())

override fun <T> wrap(consumer: Consumer<T>): Consumer<T> {
override fun <T : Any> wrap(consumer: Consumer<T>): Consumer<T> {
return Consumer { mainHandler.post { consumer.run(it) } }
}

Expand Down
4 changes: 2 additions & 2 deletions publish.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ext {
version_name = '2.0.2'
version_code = 202
version_name = '2.0.3'
version_code = 203
vendor_name = 'Orange'
group_name = 'org.ocast'
url_name = 'http://ocast.org'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@

package org.ocast.sample.desktop.kotlin

import java.io.FileInputStream
import java.util.concurrent.CountDownLatch
import java.util.logging.Level
import java.util.logging.LogManager
import java.util.logging.Logger
import kotlin.system.exitProcess
import org.ocast.sdk.core.Device
import org.ocast.sdk.core.DeviceCenter
import org.ocast.sdk.core.DeviceListener
Expand All @@ -31,6 +25,12 @@ import org.ocast.sdk.core.models.Media
import org.ocast.sdk.core.models.MediaPlaybackStatus
import org.ocast.sdk.core.models.PrepareMediaCommandParams
import org.ocast.sdk.core.utils.OCastLog
import java.io.FileInputStream
import java.util.concurrent.CountDownLatch
import java.util.logging.Level
import java.util.logging.LogManager
import java.util.logging.Logger
import kotlin.system.exitProcess

class AppKotlin : EventListener, DeviceListener {

Expand Down Expand Up @@ -77,14 +77,14 @@ class AppKotlin : EventListener, DeviceListener {
private fun startApplication(device: Device) {
device.applicationName = "Orange-DefaultReceiver-DEV"
device.connect(
null, {
null,
{
device.startApplication(
{ prepareMedia(device) },
{ logger.log(Level.WARNING, "startApplication error: ${it.message}") }
)
}, { error ->
logger.log(Level.WARNING, "connect error: ${error.message}")
}
},
{ logger.log(Level.WARNING, "connect error: ${it.message}") }
)
}

Expand Down
11 changes: 5 additions & 6 deletions sample/mobile/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply from: project.file('../../ktlint.gradle')
apply from: project.file('../../dependencies.gradle')
Expand All @@ -15,9 +14,8 @@ android {
targetSdkVersion target_sdk_version
versionCode 2
versionName "2.0"

multiDexEnabled true
vectorDrawables.useSupportLibrary = true

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

Expand All @@ -44,8 +42,8 @@ android {
}
}

dataBinding {
enabled = true
buildFeatures {
dataBinding = true
}
}

Expand All @@ -55,8 +53,9 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
implementation "com.google.android.material:material:$material_version"
implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-viewmodel:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
implementation "androidx.constraintlayout:constraintlayout:$constraint_layout_version"
implementation "androidx.multidex:multidex:$multidex_version"

testImplementation "junit:junit:$junit_version"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.app.AppCompatDelegate
import androidx.core.view.MenuItemCompat
import androidx.databinding.DataBindingUtil
import androidx.lifecycle.ViewModelProviders
import androidx.lifecycle.ViewModelProvider
import androidx.mediarouter.app.MediaRouteActionProvider
import androidx.mediarouter.media.MediaRouter
import java.util.logging.LogManager
import org.ocast.mediaroute.OCastMediaRouteHelper
import org.ocast.sample.mobile.R
import org.ocast.sample.mobile.databinding.ActivityMainBinding
Expand All @@ -39,6 +38,7 @@ import org.ocast.sdk.core.models.MediaMetadata
import org.ocast.sdk.core.models.MediaPlaybackStatus
import org.ocast.sdk.core.models.PrepareMediaCommandParams
import org.ocast.sdk.core.utils.OCastLog
import java.util.logging.LogManager

class MainActivity : AppCompatActivity(), EventListener {

Expand All @@ -54,7 +54,7 @@ class MainActivity : AppCompatActivity(), EventListener {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

mainViewModel = ViewModelProviders.of(this).get(MainViewModel::class.java)
mainViewModel = ViewModelProvider(this).get(MainViewModel::class.java)
binding = DataBindingUtil.setContentView<ActivityMainBinding>(this, R.layout.activity_main).apply {
lifecycleOwner = this@MainActivity
viewModel = mainViewModel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@

package org.ocast.sdk.common.extensions

import java.io.IOException
import okhttp3.Call
import okhttp3.Callback
import okhttp3.Headers
import okhttp3.Response
import org.ocast.sdk.common.models.HttpException
import java.io.IOException

/**
* Schedules the OkHttp request to be executed at some point in the future.
Expand Down
Loading

0 comments on commit 381e20b

Please sign in to comment.