diff --git a/Connect-SDK-Android/build.gradle b/Connect-SDK-Android/build.gradle index 535a15f6..2641caf5 100644 --- a/Connect-SDK-Android/build.gradle +++ b/Connect-SDK-Android/build.gradle @@ -1,19 +1,55 @@ + buildscript { repositories { + google() jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:1.2.3' + classpath 'com.android.tools.build:gradle:4.0.1' } } allprojects { repositories { + google() jcenter() } } apply plugin: 'com.android.library' +apply plugin: 'jacoco' + + +jacoco { + toolVersion = "0.8.5" +} + +task jacocoTestReport(type:JacocoReport, dependsOn: "check") { + group = "Reporting" + + description = "Generate Jacoco coverage reports" + + getClassDirectories().setFrom( + dir: 'build/intermediates/classes/debug', + excludes: ['**/R.class', + '**/R$*.class', + '**/*$ViewInjector*.*', + '**/BuildConfig.*', + '**/Manifest*.*'] + ) + + additionalSourceDirs.from = android.sourceSets.main.java.srcDirs + sourceDirectories.from = android.sourceSets.main.java.srcDirs + executionData.from = 'build/jacoco/testDebug.exec' + + reports { + xml.enabled = true + html.enabled = true + } + +} + +build.dependsOn jacocoTestReport android { compileSdkVersion 22 @@ -26,11 +62,6 @@ android { exclude 'META-INF/NOTICE' } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 - } - sourceSets { main { manifest.srcFile 'AndroidManifest.xml' @@ -46,9 +77,17 @@ android { res.srcDirs = ['res'] assets.srcDirs = ['assets'] } + test { + java.srcDirs = [ + 'core/test/src', + 'modules/google_cast/test/src', + 'modules/firetv/test/src', + ] + } } buildTypes { debug { + testCoverageEnabled = true } release { minifyEnabled false @@ -61,16 +100,30 @@ android { } } +android.testOptions.unitTests.all { + include '**/*Test.class' +} + dependencies { compile files('core/libs/Java-WebSocket-1.3.7.jar') compile files('core/libs/javax.jmdns_3.4.1-patch2.jar') - compile fileTree(dir: 'modules/firetv/libs', include: '*.jar') + api 'com.android.support:appcompat-v7:22.2.1' + + implementation fileTree(dir: 'modules/firetv/libs', include: '*.jar') + + implementation 'com.android.support:support-v4:22.2.1' + implementation 'com.android.support:mediarouter-v7:22.2.1' + implementation 'com.google.android.gms:play-services-cast:7.8.0' + implementation 'com.googlecode.plist:dd-plist:1.23' + implementation 'com.nimbusds:srp6a-android:2.0.2' + implementation 'net.i2p.crypto:eddsa:0.2.0' - compile 'com.android.support:support-v4:22.2.1' - compile 'com.android.support:appcompat-v7:22.2.1' - compile 'com.android.support:mediarouter-v7:22.2.1' - compile 'com.google.android.gms:play-services-cast:7.8.0' + testImplementation 'org.apache.maven:maven-ant-tasks:2.1.3' + testImplementation 'junit:junit:4.12' + testImplementation 'org.mockito:mockito-all:1.10.19' + testImplementation 'org.powermock:powermock-api-mockito:1.6.2' + testImplementation 'xmlunit:xmlunit:1.4' } -apply from: 'maven-push.gradle' +apply from: 'maven-push.gradle' \ No newline at end of file diff --git a/scripts/android-install.js b/scripts/android-install.js index 540eb29a..7daa6247 100644 --- a/scripts/android-install.js +++ b/scripts/android-install.js @@ -16,7 +16,7 @@ var commands = { var paths = { "ConnectSDK_Repository": "https://github.com/ConnectSDK/Connect-SDK-Android.git", - "ConnectSDK_Tag": "1.6.2", + "ConnectSDK_Tag": "master", "FlingSDK_URL": "https://s3-us-west-1.amazonaws.com/amazon-fling/AmazonFling-SDK.zip", "AmazonFling_Jar": "./csdk_tmp/android-sdk/lib/AmazonFling.jar", "WhisperPlay_Jar": "./csdk_tmp/android-sdk/lib/android/WhisperPlay.jar" @@ -38,35 +38,7 @@ AndroidInstall.prototype.steps = [ AndroidInstall.prototype.start = function () { console.log("Starting ConnectSDK Android install"); var self = this; - - var deferred = Q.defer(); - - // Check for updated install steps - console.log("Checking for updated configuration"); - http.get("http://ec2-54-201-108-205.us-west-2.compute.amazonaws.com/CordovaPlugin/1.6.0/Android/paths.json", function(res) { - var body = ''; - - res.on('data', function(chunk){ - body += chunk; - }); - - res.on('end', function() { - try { - var tmp_paths = JSON.parse(body); - paths = tmp_paths; - } catch(err) { - console.log("Error parsing updates, using default configuration (install might fail)"); - } - deferred.resolve(); - }); - }).on('error', function(e) { - console.log("Error checking for updates, using default configuration (install might fail)"); - deferred.resolve(); - }); - - deferred.promise.then(function () { - self.executeStep(0); - }); + self.executeStep(0); }; AndroidInstall.prototype.executeStep = function (step) { @@ -119,7 +91,7 @@ AndroidInstall.prototype.cloneConnectSDK = function () { } }) .then(function () { - return Q.nfcall(exec, "git clone --depth 1 " + paths.ConnectSDK_Repository + " " + safePath("./cordova-plugin-connectsdk/" + csdkDirectory)); + return Q.nfcall(exec, "git clone " + paths.ConnectSDK_Repository + " " + safePath("./cordova-plugin-connectsdk/" + csdkDirectory)); }) .then(function () { return Q.nfcall(exec, "git checkout " + paths.ConnectSDK_Tag, {cwd: safePath("./cordova-plugin-connectsdk/" + csdkDirectory)}); diff --git a/scripts/ios-install.js b/scripts/ios-install.js index 2f27a106..e790a8ce 100644 --- a/scripts/ios-install.js +++ b/scripts/ios-install.js @@ -45,37 +45,8 @@ if (!isMac) { iOSInstall.prototype.start = function () { console.log("Starting ConnectSDK iOS install"); - var self = this; - - var deferred = Q.defer(); - - // Check for updated install steps - console.log("Checking for updated configuration values"); - http.get("http://ec2-54-201-108-205.us-west-2.compute.amazonaws.com/CordovaPlugin/1.6.0/iOS/paths.json", function(res) { - var body = ''; - - res.on('data', function(chunk){ - body += chunk; - }); - - res.on('end', function() { - try { - var tmp_paths = JSON.parse(body); - paths = tmp_paths; - } catch(err) { - console.log("Error parsing updates, using default configuration (install might fail)"); - } - deferred.resolve(); - }); - }).on('error', function(e) { - console.log("Error checking for updates, using default configuration (install might fail)"); - deferred.resolve(); - }); - - deferred.promise.then(function () { - self.executeStep(0); - }); + self.executeStep(0); }; iOSInstall.prototype.executeStep = function (step) {