Browse Source

Create the new remote access client module and setup maven and CI

Fixes #3131
merge-requests/2174/head
Nicolas Pomepuy 1 year ago
parent
commit
f0ee7f30a5
  1. 5
      application/app/build.gradle
  2. 1
      application/remote-access-client/.gitignore
  3. 126
      application/remote-access-client/build.gradle
  4. 0
      application/remote-access-client/consumer-rules.pro
  5. 4
      application/remote-access-client/gradle.properties
  6. 21
      application/remote-access-client/proguard-rules.pro
  7. 28
      application/remote-access-client/src/main/AndroidManifest.xml
  8. 60
      application/remote-access-server/build.gradle
  9. 2
      buildsystem/gitlab/.gitlab-ci.yml
  10. 1
      settings.gradle

5
application/app/build.gradle

@ -162,10 +162,7 @@ android {
dependencies {
implementation project(':application:vlc-android')
implementation project(':application:television')
devImplementation project(':application:remote-access-server')
debugImplementation project(':application:remote-access-server')
releaseImplementation "org.videolan.android:remote-access:$rootProject.ext.remoteAccessVersion"
vlcBundleImplementation "org.videolan.android:remote-access:$rootProject.ext.remoteAccessVersion"
implementation project(':application:remote-access-server')
testImplementation project(':application:television')
testImplementation project(':application:remote-access-server')

1
application/remote-access-client/.gitignore

@ -0,0 +1 @@
/build

126
application/remote-access-client/build.gradle

@ -0,0 +1,126 @@
/*
* ************************************************************************
* build.gradle
* *************************************************************************
* Copyright © 2025 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.
* **************************************************************************
*
*
*/
plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
id 'com.vanniktech.maven.publish'
}
ext {
library_version = "$rootProject.ext.remoteAccessVersion"
}
android {
namespace 'org.videolan.vlc.remoteaccessclient'
defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
compileSdk rootProject.ext.compileSdkVersion
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
resValue "string", "build_remote_access_revision", remoteAccessRevision()
resValue "string", "remote_access_version", remoteAccessVersion()
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
task webCopy(type: Copy) {
from '../../remoteaccess/dist'
into 'assets/dist'
}
sourceSets.main {
assets.srcDirs = ['assets']
}
sourceSets.main {
assets.srcDirs = ['assets']
}
// Make per-variant version code
libraryVariants.all { variant ->
//Custom APK name
variant.outputs.each { output ->
if (output.outputFileName != null && output.outputFileName.endsWith('.aar')) {
output.outputFileName = "vlc-android-remote-access-${library_version}.aar"
}
}
}
}
preBuild.dependsOn(webCopy)
def remoteAccessVersion() {
def code = new ByteArrayOutputStream()
try {
if (file("../../remoteaccess/package.json").exists()) {
exec {
commandLine = ['bash', '-c', 'grep -m1 "version" ../../remoteaccess/package.json']
standardOutput = code
}
return code.toString().split("\"")[3]
}
} catch (Exception e) {
}
return "unknown"
}
def remoteAccessRevision() {
try {
def hash = new ByteArrayOutputStream()
exec {
commandLine = ['bash', '-c', 'git -C ../../remoteaccess rev-parse --short HEAD']
standardOutput = hash
}
return hash.toString()
} catch (Exception e) {
}
return "unknown"
}
dependencies {
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
}
apply from: '../../buildsystem/publish.gradle'

0
application/remote-access-client/consumer-rules.pro

4
application/remote-access-server/gradle.properties → application/remote-access-client/gradle.properties

@ -2,7 +2,7 @@
# *************************************************************************
# gradle.properties
# **************************************************************************
# Copyright © 2024 VLC authors and VideoLAN
# Copyright © 2025 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
@ -28,4 +28,4 @@ POM_ARTIFACT_ID=remote-access
POM_NAME=VLC-Android-RemoteAccess
POM_DESCRIPTION=Android port of VLC's Remote Access
POM_INCEPTION_YEAR=2021
POM_INCEPTION_YEAR=2024

21
application/remote-access-client/proguard-rules.pro

@ -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

28
application/remote-access-client/src/main/AndroidManifest.xml

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ *************************************************************************
~ AndroidManifest.xml
~ **************************************************************************
~ Copyright © 2025 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">
</manifest>

60
application/remote-access-server/build.gradle

@ -1,12 +1,8 @@
plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
id 'com.vanniktech.maven.publish'
}
ext {
library_version = "$rootProject.ext.remoteAccessVersion"
}
android {
namespace 'org.videolan.vlc.remoteaccessserver'
@ -23,8 +19,6 @@ android {
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
buildConfigField 'Boolean', 'VLC_REMOTE_ACCESS_DEBUG', project.hasProperty("vlc_remote_access_debug") ? vlc_remote_access_debug : "false"
resValue "string", "build_remote_access_revision", remoteAccessRevision()
resValue "string", "remote_access_version", remoteAccessVersion()
}
@ -43,11 +37,6 @@ android {
}
}
task webCopy(type: Copy) {
from '../../remoteaccess/dist'
into 'assets/dist'
}
sourceSets.main {
assets.srcDirs = ['assets']
}
@ -68,51 +57,14 @@ android {
buildConfig true
}
// Make per-variant version code
libraryVariants.all { variant ->
//Custom APK name
variant.outputs.each { output ->
if (output.outputFileName != null && output.outputFileName.endsWith('.aar')) {
output.outputFileName = "vlc-android-remote-access-${library_version}.aar"
}
}
}
}
def remoteAccessVersion() {
def code = new ByteArrayOutputStream()
try {
if (file("../../remoteaccess/package.json").exists()) {
exec {
commandLine = ['bash', '-c', 'grep -m1 "version" ../../remoteaccess/package.json']
standardOutput = code
}
return code.toString().split("\"")[3]
}
} catch (Exception e) {
}
return "unknown"
}
def remoteAccessRevision() {
try {
def hash = new ByteArrayOutputStream()
exec {
commandLine = ['bash', '-c', 'git -C ../../remoteaccess rev-parse --short HEAD']
standardOutput = hash
}
return hash.toString()
} catch (Exception e) {
}
return "unknown"
}
preBuild.dependsOn(webCopy)
dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'
devImplementation project(':application:remote-access-client')
debugImplementation project(':application:remote-access-client')
releaseImplementation "org.videolan.android:remote-access:$rootProject.ext.remoteAccessVersion"
vlcBundleImplementation "org.videolan.android:remote-access:$rootProject.ext.remoteAccessVersion"
implementation project(':application:vlc-android')
implementation "io.ktor:ktor:$rootProject.ext.ktorVersion"
implementation "io.ktor:ktor-server-netty:$rootProject.ext.ktorVersion"
@ -130,6 +82,4 @@ dependencies {
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}
apply from: '../../buildsystem/publish.gradle'
}

2
buildsystem/gitlab/.gitlab-ci.yml

@ -466,7 +466,7 @@ publish_remote_access_lib:
script:
- mkdir -p $M2_REPO
- ./buildsystem/compile.sh --init -b
- GRADLE_ABI=ALL RELEASE_SIGNING_ENABLED=false ./gradlew -Dmaven.repo.local=$M2_REPO -p application/webserver publishToMavenLocal
- GRADLE_ABI=ALL RELEASE_SIGNING_ENABLED=false ./gradlew -Dmaven.repo.local=$M2_REPO -p application/remote-access-client publishToMavenLocal
artifacts:
name: "${CI_COMMIT_TAG}"
paths:

1
settings.gradle

@ -2,3 +2,4 @@ include ':libvlcjni:libvlc', ':medialibrary'
include ':application:tools', ':application:resources', ':application:mediadb', ':application:app', ':application:live-plot-graph', ':application:television', ':application:donations', ':application:remote-access-server'
include ':application:vlc-android'
include ':application:moviepedia'
include ':application:remote-access-client'

Loading…
Cancel
Save