diff --git a/examples/BUILD.gn b/examples/BUILD.gn index 7c933f0122..7bbd933b08 100644 --- a/examples/BUILD.gn +++ b/examples/BUILD.gn @@ -125,7 +125,6 @@ if (is_android) { deps = [ ":AppRTCMobile_javalib", "../sdk/android:libjingle_peerconnection_java", - "//base:base_java_test_support", "//third_party/android_support_test_runner:runner_java", "//third_party/junit", ] diff --git a/examples/aarproject/.gitignore b/examples/aarproject/.gitignore new file mode 100644 index 0000000000..bb4d3352c5 --- /dev/null +++ b/examples/aarproject/.gitignore @@ -0,0 +1,15 @@ +# Default ignores by Android Studio +*.iml +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build +/captures +.externalNativeBuild + +# Additional ignores +/gradlew +/gradlew.bat +/gradle diff --git a/examples/aarproject/.idea/encodings.xml b/examples/aarproject/.idea/encodings.xml new file mode 100644 index 0000000000..97626ba454 --- /dev/null +++ b/examples/aarproject/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/examples/aarproject/.idea/gradle.xml b/examples/aarproject/.idea/gradle.xml new file mode 100644 index 0000000000..7ac24c777f --- /dev/null +++ b/examples/aarproject/.idea/gradle.xml @@ -0,0 +1,18 @@ + + + + + + \ No newline at end of file diff --git a/examples/aarproject/.idea/misc.xml b/examples/aarproject/.idea/misc.xml new file mode 100644 index 0000000000..635999df1e --- /dev/null +++ b/examples/aarproject/.idea/misc.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/aarproject/.idea/modules.xml b/examples/aarproject/.idea/modules.xml new file mode 100644 index 0000000000..74cd28bec0 --- /dev/null +++ b/examples/aarproject/.idea/modules.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/examples/aarproject/.idea/runConfigurations.xml b/examples/aarproject/.idea/runConfigurations.xml new file mode 100644 index 0000000000..7f68460d8b --- /dev/null +++ b/examples/aarproject/.idea/runConfigurations.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/examples/aarproject/app/.gitignore b/examples/aarproject/app/.gitignore new file mode 100644 index 0000000000..796b96d1c4 --- /dev/null +++ b/examples/aarproject/app/.gitignore @@ -0,0 +1 @@ +/build diff --git a/examples/aarproject/app/build.gradle b/examples/aarproject/app/build.gradle new file mode 100644 index 0000000000..2d10aca171 --- /dev/null +++ b/examples/aarproject/app/build.gradle @@ -0,0 +1,53 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 26 + buildToolsVersion "26.0.1" + defaultConfig { + applicationId "org.appspot.apprtc" + minSdkVersion 16 + targetSdkVersion 21 + versionCode 1 + versionName "1.0" + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + sourceSets { + main { + manifest.srcFile "../../androidapp/AndroidManifest.xml" + java.srcDirs = [ + "../../androidapp/src" + ] + res.srcDirs = [ + "../../androidapp/res" + ] + } + androidTest { + manifest.srcFile "../../androidtests/AndroidManifest.xml" + java.srcDirs = [ + "../../androidtests/src" + ] + // This test doesn't work in Android Studio. + java.exclude('**/CallActivityStubbedInputOutputTest.java') + } + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar']) + implementation fileTree(dir: '../../androidapp/third_party/autobanh/lib', include: ['autobanh.jar']) + implementation 'com.android.support:appcompat-v7:26.1.0' + implementation 'org.webrtc:google-webrtc:1.0.+' + testImplementation 'junit:junit:4.12' + androidTestImplementation 'com.android.support.test:runner:1.0.1' + androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' +} diff --git a/examples/aarproject/app/proguard-rules.pro b/examples/aarproject/app/proguard-rules.pro new file mode 100644 index 0000000000..d6cc4c5eba --- /dev/null +++ b/examples/aarproject/app/proguard-rules.pro @@ -0,0 +1,25 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in /usr/local/google/home/sakal/Android/Sdk/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/examples/aarproject/build.gradle b/examples/aarproject/build.gradle new file mode 100644 index 0000000000..5a016efb7e --- /dev/null +++ b/examples/aarproject/build.gradle @@ -0,0 +1,27 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + + repositories { + google() + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:3.0.0-beta2' + + + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } +} + +allprojects { + repositories { + google() + jcenter() + } +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/examples/aarproject/gradle.properties b/examples/aarproject/gradle.properties new file mode 100644 index 0000000000..aac7c9b461 --- /dev/null +++ b/examples/aarproject/gradle.properties @@ -0,0 +1,17 @@ +# Project-wide Gradle settings. + +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. + +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html + +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx1536m + +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true diff --git a/examples/aarproject/settings.gradle b/examples/aarproject/settings.gradle new file mode 100644 index 0000000000..e7b4def49c --- /dev/null +++ b/examples/aarproject/settings.gradle @@ -0,0 +1 @@ +include ':app' diff --git a/examples/androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java b/examples/androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java index dda16ad390..8f97dd5846 100644 --- a/examples/androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java +++ b/examples/androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java @@ -16,6 +16,7 @@ import static org.junit.Assert.fail; import android.os.Build; import android.support.test.InstrumentationRegistry; import android.support.test.filters.SmallTest; +import android.support.test.runner.AndroidJUnit4; import android.util.Log; import java.util.LinkedList; import java.util.List; @@ -27,7 +28,6 @@ import org.appspot.apprtc.AppRTCClient.SignalingParameters; import org.appspot.apprtc.PeerConnectionClient; import org.appspot.apprtc.PeerConnectionClient.PeerConnectionEvents; import org.appspot.apprtc.PeerConnectionClient.PeerConnectionParameters; -import org.chromium.base.test.BaseJUnit4ClassRunner; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -46,7 +46,7 @@ import org.webrtc.VideoFrame; import org.webrtc.VideoRenderer; import org.webrtc.VideoSink; -@RunWith(BaseJUnit4ClassRunner.class) +@RunWith(AndroidJUnit4.class) public class PeerConnectionClientTest implements PeerConnectionEvents { private static final String TAG = "RTCClientTest"; private static final int ICE_CONNECTION_WAIT_TIMEOUT = 10000;