17 changed files with 225 additions and 36 deletions
@ -0,0 +1 @@ |
|||
/build |
|||
@ -0,0 +1,48 @@ |
|||
plugins { |
|||
id 'com.android.library' |
|||
id 'org.jetbrains.kotlin.android' |
|||
} |
|||
|
|||
android { |
|||
namespace 'org.videolan.vlc.webserver' |
|||
compileSdkVersion rootProject.ext.compileSdkVersion |
|||
|
|||
defaultConfig { |
|||
minSdkVersion rootProject.ext.minSdkVersion |
|||
targetSdkVersion rootProject.ext.targetSdkVersion |
|||
|
|||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" |
|||
consumerProguardFiles "consumer-rules.pro" |
|||
} |
|||
|
|||
buildTypes { |
|||
release { |
|||
minifyEnabled false |
|||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' |
|||
} |
|||
} |
|||
sourceSets.main { |
|||
assets.srcDirs = ['assets'] |
|||
} |
|||
compileOptions { |
|||
sourceCompatibility JavaVersion.VERSION_1_8 |
|||
targetCompatibility JavaVersion.VERSION_1_8 |
|||
} |
|||
kotlinOptions { |
|||
jvmTarget = '1.8' |
|||
} |
|||
} |
|||
|
|||
dependencies { |
|||
|
|||
implementation project(':application:vlc-android') |
|||
implementation "io.ktor:ktor:2.1.2" |
|||
implementation "io.ktor:ktor-server-netty:2.1.2" |
|||
implementation "io.ktor:ktor-gson:1.6.8" |
|||
implementation "io.ktor:ktor-server-websockets:2.1.2" |
|||
|
|||
|
|||
testImplementation 'junit:junit:4.13.2' |
|||
androidTestImplementation 'androidx.test.ext:junit:1.1.3' |
|||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' |
|||
} |
|||
@ -0,0 +1,21 @@ |
|||
# Add project specific ProGuard rules here. |
|||
# You can control the set of applied configuration files using the |
|||
# proguardFiles setting in build.gradle. |
|||
# |
|||
# For more details, see |
|||
# http://developer.android.com/guide/developing/tools/proguard.html |
|||
|
|||
# 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 |
|||
@ -0,0 +1,48 @@ |
|||
/* |
|||
* ************************************************************************ |
|||
* ExampleInstrumentedTest.kt |
|||
* ************************************************************************* |
|||
* Copyright © 2022 VLC authors and VideoLAN |
|||
* Author: Nicolas POMEPUY |
|||
* This program is free software; you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation; either version 2 of the License, or |
|||
* (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program; if not, write to the Free Software |
|||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. |
|||
* ************************************************************************** |
|||
* |
|||
* |
|||
*/ |
|||
|
|||
package org.videolan.vlc.webserver |
|||
|
|||
import androidx.test.platform.app.InstrumentationRegistry |
|||
import androidx.test.ext.junit.runners.AndroidJUnit4 |
|||
|
|||
import org.junit.Test |
|||
import org.junit.runner.RunWith |
|||
|
|||
import org.junit.Assert.* |
|||
|
|||
/** |
|||
* Instrumented test, which will execute on an Android device. |
|||
* |
|||
* See [testing documentation](http://d.android.com/tools/testing). |
|||
*/ |
|||
@RunWith(AndroidJUnit4::class) |
|||
class ExampleInstrumentedTest { |
|||
@Test |
|||
fun useAppContext() { |
|||
// Context of the app under test. |
|||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext |
|||
assertEquals("org.videolan.vlc.webserver.test", appContext.packageName) |
|||
} |
|||
} |
|||
@ -0,0 +1,39 @@ |
|||
<?xml version="1.0" encoding="utf-8"?><!-- |
|||
~ ************************************************************************* |
|||
~ AndroidManifest.xml |
|||
~ ************************************************************************** |
|||
~ Copyright © 2022 VLC authors and VideoLAN |
|||
~ Author: Nicolas POMEPUY |
|||
~ This program is free software; you can redistribute it and/or modify |
|||
~ it under the terms of the GNU General Public License as published by |
|||
~ the Free Software Foundation; either version 2 of the License, or |
|||
~ (at your option) any later version. |
|||
~ |
|||
~ This program is distributed in the hope that it will be useful, |
|||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
~ GNU General Public License for more details. |
|||
~ |
|||
~ You should have received a copy of the GNU General Public License |
|||
~ along with this program; if not, write to the Free Software |
|||
~ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. |
|||
~ *************************************************************************** |
|||
~ |
|||
~ |
|||
--> |
|||
|
|||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> |
|||
|
|||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" /> |
|||
<application> |
|||
<service |
|||
android:name=".WebServerService" |
|||
android:exported="true" |
|||
android:foregroundServiceType="specialUse"> |
|||
<property |
|||
android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE" |
|||
android:value="HTTP server" /> |
|||
</service> |
|||
</application> |
|||
|
|||
</manifest> |
|||
@ -0,0 +1,41 @@ |
|||
/* |
|||
* ************************************************************************ |
|||
* ExampleUnitTest.kt |
|||
* ************************************************************************* |
|||
* Copyright © 2022 VLC authors and VideoLAN |
|||
* Author: Nicolas POMEPUY |
|||
* This program is free software; you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation; either version 2 of the License, or |
|||
* (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program; if not, write to the Free Software |
|||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. |
|||
* ************************************************************************** |
|||
* |
|||
* |
|||
*/ |
|||
|
|||
package org.videolan.vlc.webserver |
|||
|
|||
import org.junit.Test |
|||
|
|||
import org.junit.Assert.* |
|||
|
|||
/** |
|||
* Example local unit test, which will execute on the development machine (host). |
|||
* |
|||
* See [testing documentation](http://d.android.com/tools/testing). |
|||
*/ |
|||
class ExampleUnitTest { |
|||
@Test |
|||
fun addition_isCorrect() { |
|||
assertEquals(4, 2 + 2) |
|||
} |
|||
} |
|||
@ -1,4 +1,4 @@ |
|||
include ':libvlcjni:libvlc', ':medialibrary' |
|||
include ':application:tools', ':application:resources', ':application:mediadb', ':application:app', ':application:live-plot-graph', ':application:television', ':application:donations' |
|||
include ':application:tools', ':application:resources', ':application:mediadb', ':application:app', ':application:live-plot-graph', ':application:television', ':application:donations', ':application:webserver' |
|||
include ':application:vlc-android' |
|||
include ':application:moviepedia' |
|||
|
|||
Loading…
Reference in new issue