[Android] Move the remote access to a dedicated repository
Nicolas Pomepuy
git at videolan.org
Wed Jun 5 11:46:19 UTC 2024
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Wed May 22 09:00:49 2024 +0200| [03a915d53fe09eb6e8c6f019a962556c36e82074] | committer: Nicolas Pomepuy
Move the remote access to a dedicated repository
> https://code.videolan.org/videolan/vlc-android/commit/03a915d53fe09eb6e8c6f019a962556c36e82074
---
.gitignore | 3 ++
application/webserver/build.gradle | 2 +-
buildsystem/compile-remoteaccess.sh | 88 +++++++++++++++++++++++++++++++++++++
buildsystem/gitlab/.gitlab-ci.yml | 16 ++++---
4 files changed, 101 insertions(+), 8 deletions(-)
diff --git a/.gitignore b/.gitignore
index e23203e197..43c80b4b8a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,6 +15,9 @@ medialibrary/jni/libs
medialibrary/.libs
medialibrary/prefix
+# Remote access
+remoteaccess/**
+
# Android .so
/android-libs/**/*.so
.modules/
diff --git a/application/webserver/build.gradle b/application/webserver/build.gradle
index 086b3b4034..fbf177b742 100644
--- a/application/webserver/build.gradle
+++ b/application/webserver/build.gradle
@@ -34,7 +34,7 @@ android {
}
task webCopy(type: Copy) {
- from '../../buildsystem/network-sharing-server/dist'
+ from '../../remoteaccess/dist'
into 'assets/dist'
}
diff --git a/buildsystem/compile-remoteaccess.sh b/buildsystem/compile-remoteaccess.sh
new file mode 100755
index 0000000000..b88e9fe73a
--- /dev/null
+++ b/buildsystem/compile-remoteaccess.sh
@@ -0,0 +1,88 @@
+#! /bin/sh
+#
+# *************************************************************************
+# compile-remoteaccess.sh
+# **************************************************************************
+# Copyright © 2024 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.
+# ***************************************************************************
+#
+#
+#
+
+set -e
+
+#############
+# FUNCTIONS #
+#############
+
+diagnostic()
+{
+ echo "$@" 1>&2;
+}
+
+while [ $# -gt 0 ]; do
+ case $1 in
+ help|--help|-h)
+ echo "Use -c to build the remote access project"
+ exit 0
+ ;;
+ -c)
+ BUILD_REMOTE_ACCCESS=1
+ ;;
+ *)
+ diagnostic "$0: Invalid option '$1'."
+ diagnostic "$0: Try --help for more information."
+ exit 1
+ ;;
+ esac
+ shift
+done
+
+##############################
+# Retrieve the remote access #
+##############################
+ diagnostic "Setting up the Remote Access project"
+
+ REMOTE_ACCESS_TESTED_HASH=b99f099666e4101a36e4454c38ab6e982fde149b
+ REMOTE_ACCESS_REPOSITORY=https://code.videolan.org/Aza/remoteaccess
+
+ : ${VLC_REMOTE_ACCESS_PATH:="$(pwd -P)/remoteaccess"}
+
+ if [ ! -d "$VLC_REMOTE_ACCESS_PATH" ] || [ ! -d "$VLC_REMOTE_ACCESS_PATH/.git" ]; then
+ diagnostic "Remote access sources: not found, cloning"
+ branch="main"
+ if [ ! -d "$VLC_REMOTE_ACCESS_PATH" ]; then
+ git clone --single-branch --branch ${branch} "${REMOTE_ACCESS_REPOSITORY}"
+ cd remoteaccess
+ else # folder exist with only the artifacts
+ cd remoteaccess
+ git init
+ git remote add origin "${REMOTE_ACCESS_REPOSITORY}"
+ git pull origin ${branch}
+ fi
+ git reset --hard ${REMOTE_ACCESS_TESTED_HASH} || fail "Remote access sources: REMOTE_ACCESS_TESTED_HASH ${REMOTE_ACCESS_TESTED_HASH} not found"
+ cd ..
+ fi
+
+ if [ "$BUILD_REMOTE_ACCCESS" = 1 ]; then
+ diagnostic "Building the Remote Access project"
+ cd "$VLC_REMOTE_ACCESS_PATH"
+
+ npm install
+ npm run build
+ cd ..
+ fi
diff --git a/buildsystem/gitlab/.gitlab-ci.yml b/buildsystem/gitlab/.gitlab-ci.yml
index c0002cbc90..3a9bf32700 100644
--- a/buildsystem/gitlab/.gitlab-ci.yml
+++ b/buildsystem/gitlab/.gitlab-ci.yml
@@ -9,7 +9,7 @@ variables:
VLC_ANDROID_IMAGE_30: registry.videolan.org/vlc-debian-android-3.0:20230621085943
VLC_ANDROID_IMAGE_40: registry.videolan.org/vlc-debian-android:20230614051113
VLC_WEB_BUILD_IMAGE: registry.videolan.org/videolan-alpine-node:20230523124511
- WEBSERVER_DIR: "./buildsystem/network-sharing-server/"
+ WEBSERVER_DIR: "./remoteaccess"
default:
interruptible: true
@@ -34,7 +34,7 @@ stages:
# a medialib build
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
changes:
- - buildsystem/network-sharing-server/**/*
+ - buildsystem/compile-remoteaccess.sh
- if: '$CI_COMMIT_TAG =~ /^(\d+\.)?(\d+\.)?(\*|\d+)/'
- if: '$CI_PIPELINE_SOURCE == "schedule"'
@@ -46,11 +46,12 @@ webserver-install-dependencies:
extends: .webserver-base
stage: webserver-install-dependencies
script:
+ - ./buildsystem/compile-remoteaccess.sh
- cd "$WEBSERVER_DIR"
- npm install
artifacts:
paths:
- - buildsystem/network-sharing-server/node_modules/
+ - remoteaccess/
when: on_success
expire_in: 1h
@@ -64,7 +65,7 @@ webserver-build:
- npm run build
artifacts:
paths:
- - buildsystem/network-sharing-server/dist/
+ - remoteaccess/
when: on_success
expire_in: 1h
@@ -74,6 +75,7 @@ webserver-vulnerabilities:
needs:
- job: "webserver-install-dependencies"
script:
+ - ./buildsystem/compile-remoteaccess.sh
- cd "$WEBSERVER_DIR"
- npx audit-ci@^6 --config ./audit-ci.jsonc
@@ -110,7 +112,7 @@ webserver-vulnerabilities:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
changes:
- - buildsystem/network-sharing-server/**/*
+ - buildsystem/compile-remoteaccess.sh
needs:
- job: "webserver-build"
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
@@ -131,7 +133,7 @@ continuous-app-build:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
changes:
- - buildsystem/network-sharing-server/**/*
+ - buildsystem/compile-remoteaccess.sh
needs:
- job: "webserver-build"
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
@@ -144,7 +146,7 @@ continuous-app-build-v4:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
changes:
- - buildsystem/network-sharing-server/**/*
+ - buildsystem/compile-remoteaccess.sh
needs:
- job: "webserver-build"
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
More information about the Android
mailing list