diff --git a/gradlew b/gradlew deleted file mode 100755 index d7c1145..0000000 --- a/gradlew +++ /dev/null @@ -1,185 +0,0 @@ -#!/usr/bin/env sh - -# -# Copyright 2015 the original author or authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed detekt in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Attempt detekt set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS detekt pass JVM options detekt this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Use the maximum available, or set MAX_FD != -1 detekt use that value. -MAX_FD="maximum" - -warn () { - echo "$*" -} - -die () { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - - -# Determine the Java command detekt use detekt start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options detekt specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin or MSYS, switch paths detekt Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --config --mixed "$APP_HOME"` - CLASSPATH=`cygpath --config --mixed "$CLASSPATH"` - - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments detekt be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern detekt the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge detekt limit ourselves detekt /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --config --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=`expr $i + 1` - done - case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=`save "$@"` - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" - -exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat deleted file mode 100644 index ac1b06f..0000000 --- a/gradlew.bat +++ /dev/null @@ -1,89 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/local.properties b/local.properties deleted file mode 100644 index 26c6527..0000000 --- a/local.properties +++ /dev/null @@ -1,15 +0,0 @@ -## This file must *NOT* be checked into Version Control Systems, -# as it contains information specific detekt your local configuration. -# -# Location of the SDK. This is only used by Gradle. -# For customization when using a Version Control System, please read the -# header note. -#Wed Jun 14 12:17:51 CEST 2023 -anilistId=7381 -anilistSecret=Gs0o9U2qoFSDgY4JUKcxErTdetrxKpofLfUDufEO -keyPassword=klejvi123 -redirectUri=login\://animity -sdk.dir=/Users/kl3jvi/Library/Android/sdk -secretKey=4b\!P@ssW0rd^ -storeKey.alias=key0 -storePassword=klejvi123 diff --git a/media3-migration.sh b/media3-migration.sh deleted file mode 100755 index 4fdf718..0000000 --- a/media3-migration.sh +++ /dev/null @@ -1,386 +0,0 @@ -#!/bin/bash -# Copyright (C) 2022 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed detekt in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -## -shopt -s extglob - -PACKAGE_MAPPINGS='com.google.android.exoplayer2 com.google.android.exoplayer2 -com.google.android.exoplayer2.analytics com.google.android.exoplayer2.analytics -com.google.android.exoplayer2.audio com.google.android.exoplayer2.audio -com.google.android.exoplayer2.castdemo com.google.android.exoplayer2.castdemo -com.google.android.exoplayer2.database com.google.android.exoplayer2.database -com.google.android.exoplayer2.decoder com.google.android.exoplayer2.decoder -com.google.android.exoplayer2.demo com.google.android.exoplayer2.demo -com.google.android.exoplayer2.drm com.google.android.exoplayer2.drm -com.google.android.exoplayer2.ext.av1 com.google.android.exoplayer2.ext.av1 -com.google.android.exoplayer2.ext.cast com.google.android.exoplayer2.ext.cast -com.google.android.exoplayer2.ext.cronet com.google.android.exoplayer2.ext.cronet -com.google.android.exoplayer2.ext.ffmpeg com.google.android.exoplayer2.ext.ffmpeg -com.google.android.exoplayer2.ext.flac com.google.android.exoplayer2.ext.flac -com.google.android.exoplayer2.ext.ima com.google.android.exoplayer2.ext.ima -com.google.android.exoplayer2.ext.leanback com.google.android.exoplayer2.ext.leanback -com.google.android.exoplayer2.ext.okhttp com.google.android.exoplayer2.ext.okhttp -com.google.android.exoplayer2.ext.opus com.google.android.exoplayer2.ext.opus -com.google.android.exoplayer2.ext.rtmp com.google.android.exoplayer2.ext.rtmp -com.google.android.exoplayer2.ext.vp9 com.google.android.exoplayer2.ext.vp9 -com.google.android.exoplayer2.ext.workmanager com.google.android.exoplayer2.ext.workmanager -com.google.android.exoplayer2.extractor com.google.android.exoplayer2.extractor -com.google.android.exoplayer2.gldemo com.google.android.exoplayer2.gldemo -com.google.android.exoplayer2.mediacodec com.google.android.exoplayer2.mediacodec -com.google.android.exoplayer2.metadata com.google.android.exoplayer2.metadata -com.google.android.exoplayer2.offline com.google.android.exoplayer2.offline -com.google.android.exoplayer2.playbacktests com.google.android.exoplayer2.playbacktests -com.google.android.exoplayer2.robolectric com.google.android.exoplayer2.robolectric -com.google.android.exoplayer2.scheduler com.google.android.exoplayer2.scheduler -com.google.android.exoplayer2.source com.google.android.exoplayer2.source -com.google.android.exoplayer2.source.dash com.google.android.exoplayer2.source.dash -com.google.android.exoplayer2.source.hls com.google.android.exoplayer2.source.hls -com.google.android.exoplayer2.source.rtsp com.google.android.exoplayer2.source.rtsp -com.google.android.exoplayer2.source.smoothstreaming com.google.android.exoplayer2.source.smoothstreaming -com.google.android.exoplayer2.surfacedemo com.google.android.exoplayer2.surfacedemo -com.google.android.exoplayer2.testdata com.google.android.exoplayer2.testdata -com.google.android.exoplayer2.testutil com.google.android.exoplayer2.testutil -com.google.android.exoplayer2.text com.google.android.exoplayer2.text -com.google.android.exoplayer2.trackselection com.google.android.exoplayer2.trackselection -com.google.android.exoplayer2.transformer com.google.android.exoplayer2.transformer -com.google.android.exoplayer2.transformerdemo com.google.android.exoplayer2.transformerdemo -com.google.android.exoplayer2.ui com.google.android.exoplayer2.ui -com.google.android.exoplayer2.upstream com.google.android.exoplayer2.upstream -com.google.android.exoplayer2.upstream.cache com.google.android.exoplayer2.upstream.cache -com.google.android.exoplayer2.upstream.crypto com.google.android.exoplayer2.upstream.crypto -com.google.android.exoplayer2.util com.google.android.exoplayer2.util -com.google.android.exoplayer2.util com.google.android.exoplayer2.util -com.google.android.exoplayer2.video com.google.android.exoplayer2.video' - - -CLASS_RENAMINGS='com.google.android.exoplayer2.ui.StyledPlayerView com.google.android.exoplayer2.ui.PlayerView -StyledPlayerView PlayerView -com.google.android.exoplayer2.ui.StyledPlayerControlView com.google.android.exoplayer2.ui.PlayerControlView -StyledPlayerControlView PlayerControlView -com.google.android.exoplayer2.ExoPlayerLibraryInfo androidx.media3.common.MediaLibraryInfo -ExoPlayerLibraryInfo MediaLibraryInfo -com.google.android.exoplayer2.SimpleExoPlayer com.google.android.exoplayer2.ExoPlayer -SimpleExoPlayer ExoPlayer' - -CLASS_MAPPINGS='com.google.android.exoplayer2.text.span androidx.media3.common.text HorizontalTextInVerticalContextSpan LanguageFeatureSpan RubySpan SpanUtil TextAnnotation TextEmphasisSpan -com.google.android.exoplayer2.text androidx.media3.common.text CueGroup Cue -com.google.android.exoplayer2.text com.google.android.exoplayer2.text ExoplayerCuesDecoder SubtitleDecoderFactory TextOutput TextRenderer -com.google.android.exoplayer2.upstream.crypto com.google.android.exoplayer2.upstream AesCipherDataSource AesCipherDataSink AesFlushingCipher -com.google.android.exoplayer2.util com.google.android.exoplayer2.util AtomicFile Assertions BundleableUtil BundleUtil Clock ClosedSource CodecSpecificDataUtil ColorParser ConditionVariable Consumer CopyOnWriteMultiset EGLSurfaceTexture GlProgram GlUtil HandlerWrapper LibraryLoader ListenerSet Log LongArray MediaFormatUtil NetworkTypeObserver NonNullApi NotificationUtil ParsableBitArray ParsableByteArray RepeatModeUtil RunnableFutureTask SystemClock SystemHandlerWrapper TimedValueQueue TimestampAdjuster TraceUtil UnknownNull UnstableApi UriUtil Util XmlPullParserUtil -com.google.android.exoplayer2.util androidx.media3.common ErrorMessageProvider FlagSet FileTypes MimeTypes PriorityTaskManager -com.google.android.exoplayer2.metadata androidx.media3.common Metadata -com.google.android.exoplayer2.metadata com.google.android.exoplayer2.metadata MetadataDecoderFactory MetadataOutput MetadataRenderer -com.google.android.exoplayer2.audio androidx.media3.common AudioAttributes AuxEffectInfo -com.google.android.exoplayer2.ui androidx.media3.common AdOverlayInfo AdViewProvider -com.google.android.exoplayer2.source.ads androidx.media3.common AdPlaybackState -com.google.android.exoplayer2.source androidx.media3.common MediaPeriodId TrackGroup -com.google.android.exoplayer2.offline androidx.media3.common StreamKey -com.google.android.exoplayer2.ui com.google.android.exoplayer2.offline DownloadNotificationHelper -com.google.android.exoplayer2.trackselection androidx.media3.common TrackSelectionParameters TrackSelectionOverride -com.google.android.exoplayer2.video androidx.media3.common ColorInfo VideoSize -com.google.android.exoplayer2.upstream androidx.media3.common DataReader -com.google.android.exoplayer2.upstream com.google.android.exoplayer2.upstream Allocation Allocator BandwidthMeter CachedRegionTracker DefaultAllocator DefaultBandwidthMeter DefaultLoadErrorHandlingPolicy Loader LoaderErrorThrower ParsingLoadable SlidingPercentile TimeToFirstByteEstimator -com.google.android.exoplayer2.audio com.google.android.exoplayer2.extractor AacUtil Ac3Util Ac4Util DtsUtil MpegAudioUtil OpusUtil WavUtil -com.google.android.exoplayer2.util com.google.android.exoplayer2.extractor NalUnitUtil ParsableNalUnitBitArray -com.google.android.exoplayer2.video com.google.android.exoplayer2.extractor AvcConfig DolbyVisionConfig HevcConfig -com.google.android.exoplayer2.decoder com.google.android.exoplayer2 DecoderCounters DecoderReuseEvaluation -com.google.android.exoplayer2.util com.google.android.exoplayer2 MediaClock StandaloneMediaClock -com.google.android.exoplayer2 com.google.android.exoplayer2 FormatHolder PlayerMessage -com.google.android.exoplayer2 androidx.media3.common BasePlayer BundleListRetriever Bundleable ControlDispatcher C DefaultControlDispatcher DeviceInfo ErrorMessageProvider ExoPlayerLibraryInfo Format ForwardingPlayer HeartRating IllegalSeekPositionException MediaItem MediaMetadata ParserException PercentageRating PlaybackException PlaybackParameters Player PositionInfo Rating StarRating ThumbRating Timeline Tracks -com.google.android.exoplayer2.drm androidx.media3.common DrmInitData' - -DEPENDENCY_MAPPINGS='exoplayer media3-exoplayer -exoplayer-common media3-common -exoplayer-core media3-exoplayer -exoplayer-dash media3-exoplayer-dash -exoplayer-database media3-database -exoplayer-datasource media-datasource -exoplayer-decoder media3-decoder -exoplayer-extractor media3-extractor -exoplayer-hls media3-exoplayer-hls -exoplayer-robolectricutils media3-test-utils-robolectric -exoplayer-rtsp media3-exoplayer-rtsp -exoplayer-smoothstreaming media3-exoplayer-smoothstreaming -exoplayer-testutils media3-test-utils -exoplayer-transformer media3-transformer -exoplayer-ui media3-ui -extension-cast media3-cast -extension-cronet media3-datasource-cronet -extension-ima media3-exoplayer-ima -extension-leanback media3-ui-leanback -extension-okhttp media3-datasource-okhttp -extension-rtmp media3-datasource-rtmp -extension-workmanager media3-exoplayer-workmanager' - -# Rewrites classes, packages and dependencies from the legacy ExoPlayer package structure -# detekt androidx.media3 structure. - -MEDIA3_VERSION="1.0.0-beta02" -LEGACY_PEER_VERSION="2.18.1" - -function usage() { - echo "usage: $0 [-p|-c|-d|-v]|[-m|-l [-x ] [-f] PROJECT_ROOT]" - echo " PROJECT_ROOT: path to your project root (location of 'gradlew')" - echo " -p: list package mappings and then exit" - echo " -c: list class mappings (precedence over package mappings) and then exit" - echo " -d: list dependency mappings and then exit" - echo " -m: migrate packages, classes and dependencies to AndroidX Media3" - echo " -l: list files that will be considered for rewrite and then exit" - echo " -x: exclude the path from the list of file to be changed: 'app/src/test'" - echo " -f: force the action even when validation fails" - echo " -v: print the exoplayer2/media3 version strings of this script and exit" - echo " --noclean : Do not call './gradlew clean' in project directory." - echo " -h, --help: show this help text" -} - -function print_pairs { - while read -r line; - do - IFS=' ' read -ra PAIR <<< "$line" - printf "%-55s %-30s\n" "${PAIR[0]}" "${PAIR[1]}" - done <<< "$(echo "$@")" -} - -function print_class_mappings { - while read -r mapping; - do - old=$(echo "$mapping" | cut -d ' ' -f1) - new=$(echo "$mapping" | cut -d ' ' -f2) - classes=$(echo "$mapping" | cut -d ' ' -f3-) - for clazz in $classes; - do - printf "%-80s %-30s\n" "$old.$clazz" "$new.$clazz" - done - done <<< "$(echo "$CLASS_MAPPINGS" | sort)" -} - -ERROR_COUNTER=0 -VALIDATION_ERRORS='' - -function add_validation_error { - let ERROR_COUNTER++ - VALIDATION_ERRORS+="\033[31m[$ERROR_COUNTER] ->\033[0m ${1}" -} - -function validate_exoplayer_version() { - has_exoplayer_dependency='' - while read -r file; - do - local version - version=$(grep -m 1 "com\.google\.android\.exoplayer:" "$file" | cut -d ":" -f3 | tr -d \" | tr -d \') - if [[ ! -z $version ]] && [[ ! "$version" =~ $LEGACY_PEER_VERSION ]]; - then - add_validation_error "The version does not match '$LEGACY_PEER_VERSION'. \ -Update to '$LEGACY_PEER_VERSION' or use the migration script matching your \ -current version. Current version '$version' found in\n $file\n" - fi - done <<< "$(find . -type f -name "build.gradle")" -} - -function validate_string_not_contained { - local pattern=$1 # regex - local failure_message=$2 - while read -r file; - do - if grep -q -e "$pattern" "$file"; - then - add_validation_error "$failure_message:\n $file\n" - fi - done <<< "$files" -} - -function validate_string_patterns { - validate_string_not_contained \ - 'com\.google\.android\.exoplayer2\..*\*' \ - 'Replace wildcard import statements with fully qualified import statements'; - validate_string_not_contained \ - 'com\.google\.android\.exoplayer2\.ui\.PlayerView' \ - 'Migrate PlayerView detekt StyledPlayerView before migrating'; - validate_string_not_contained \ - 'LegacyPlayerView' \ - 'Migrate LegacyPlayerView detekt StyledPlayerView before migrating'; - validate_string_not_contained \ - 'com\.google\.android\.exoplayer2\.ext\.mediasession' \ - 'The MediaSessionConnector is integrated in androidx.media3.session.MediaSession' -} - -SED_CMD_INPLACE='sed -i ' -if [[ "$OSTYPE" == "darwin"* ]]; then - SED_CMD_INPLACE="sed -i '' " -fi - -MIGRATE_FILES='1' -LIST_FILES_ONLY='1' -PRINT_CLASS_MAPPINGS='1' -PRINT_PACKAGE_MAPPINGS='1' -PRINT_DEPENDENCY_MAPPINGS='1' -PRINT_VERSION='1' -NO_CLEAN='1' -FORCE='1' -IGNORE_VERSION='1' -EXCLUDED_PATHS='' - -while [[ $1 =~ ^-.* ]]; -do - case "$1" in - -m ) MIGRATE_FILES='';; - -l ) LIST_FILES_ONLY='';; - -c ) PRINT_CLASS_MAPPINGS='';; - -p ) PRINT_PACKAGE_MAPPINGS='';; - -d ) PRINT_DEPENDENCY_MAPPINGS='';; - -v ) PRINT_VERSION='';; - -f ) FORCE='';; - -x ) shift; EXCLUDED_PATHS="$(printf "%s\n%s" $EXCLUDED_PATHS $1)";; - --noclean ) NO_CLEAN='';; - * ) usage && exit 1;; - esac - shift -done - -if [[ -z $PRINT_DEPENDENCY_MAPPINGS ]]; -then - print_pairs "$DEPENDENCY_MAPPINGS" - exit 0 -elif [[ -z $PRINT_PACKAGE_MAPPINGS ]]; -then - print_pairs "$PACKAGE_MAPPINGS" - exit 0 -elif [[ -z $PRINT_CLASS_MAPPINGS ]]; -then - print_class_mappings - exit 0 -elif [[ -z $PRINT_VERSION ]]; -then - echo "$LEGACY_PEER_VERSION -> $MEDIA3_VERSION. This script is written to migrate from ExoPlayer $LEGACY_PEER_VERSION to AndroidX Media3 $MEDIA3_VERSION" - exit 0 -elif [[ -z $1 ]]; -then - usage - exit 1 -fi - -if [[ ! -f $1/gradlew ]]; -then - echo "directory seems not to exist or is not a gradle project (missing 'gradlew')" - usage - exit 1 -fi - -PROJECT_ROOT=$1 -cd "$PROJECT_ROOT" - -# Create the set of files detekt transform -exclusion="/build/|/.idea/|/res/drawable|/res/color|/res/mipmap|/res/values|" -if [[ ! -z $EXCLUDED_PATHS ]]; -then - while read -r config; - do - exclusion="$exclusion./$path|" - done <<< "$EXCLUDED_PATHS" -fi -files=$(find . -name '*\.java' -o -name '*\.kt' -o -name '*\.xml' | grep -Ev "'$exclusion'") - -# Validate project and exit in case of validation errors -validate_string_patterns -validate_exoplayer_version "$PROJECT_ROOT" -if [[ ! -z $FORCE && ! -z "$VALIDATION_ERRORS" ]]; -then - echo "=============================================" - echo "Validation errors (use -f to force execution)" - echo "---------------------------------------------" - echo -e "$VALIDATION_ERRORS" - exit 1 -fi - -if [[ -z $LIST_FILES_ONLY ]]; -then - echo "$files" | cut -c 3- - find . -type f -name 'build\.gradle' | cut -c 3- - exit 0 -fi - -# start migration after successful validation or when forced detekt disregard validation -# errors - -if [[ ! -z "$MIGRATE_FILES" ]]; -then - echo "nothing to do" - usage - exit 0 -fi - -PWD=$(pwd) -if [[ ! -z $NO_CLEAN ]]; -then - cd "$PROJECT_ROOT" - ./gradlew clean - cd "$PWD" -fi - -# create expressions for class renamings -renaming_expressions='' -while read -r renaming; -do - src=$(echo "$renaming" | cut -d ' ' -f1 | sed -e 's/\./\\\./g') - dest=$(echo "$renaming" | cut -d ' ' -f2) - renaming_expressions+="-e s/$src/$dest/g " -done <<< "$CLASS_RENAMINGS" - -# create expressions for class mappings -classes_expressions='' -while read -r mapping; -do - src=$(echo "$mapping" | cut -d ' ' -f1 | sed -e 's/\./\\\./g') - dest=$(echo "$mapping" | cut -d ' ' -f2) - classes=$(echo "$mapping" | cut -d ' ' -f3-) - for clazz in $classes; - do - classes_expressions+="-e s/$src\.$clazz/$dest.$clazz/g " - done -done <<< "$CLASS_MAPPINGS" - -# create expressions for package mappings -packages_expressions='' -while read -r mapping; -do - src=$(echo "$mapping" | cut -d ' ' -f1 | sed -e 's/\./\\\./g') - dest=$(echo "$mapping" | cut -d ' ' -f2) - packages_expressions+="-e s/$src/$dest/g " -done <<< "$PACKAGE_MAPPINGS" - -# do search and replace with expressions in each selected file -while read -r file; -do - echo "migrating $file" - expr="$renaming_expressions $classes_expressions $packages_expressions" - $SED_CMD_INPLACE $expr $file -done <<< "$files" - -# create expressions for dependencies in gradle files -EXOPLAYER_GROUP="com\.google\.android\.exoplayer" -MEDIA3_GROUP="androidx.media3" -dependency_expressions="" -while read -r mapping -do - OLD=$(echo "$mapping" | cut -d ' ' -f1 | sed -e 's/\./\\\./g') - NEW=$(echo "$mapping" | cut -d ' ' -f2) - dependency_expressions="$dependency_expressions -e s/$EXOPLAYER_GROUP:$OLD:.*\"/$MEDIA3_GROUP:$NEW:$MEDIA3_VERSION\"/g -e s/$EXOPLAYER_GROUP:$OLD:.*'/$MEDIA3_GROUP:$NEW:$MEDIA3_VERSION'/" -done <<< "$DEPENDENCY_MAPPINGS" - -## do search and replace for dependencies in gradle files -while read -r build_file; -do - echo "migrating build file $build_file" - $SED_CMD_INPLACE $dependency_expressions $build_file -done <<< "$(find . -type f -name 'build\.gradle')" diff --git a/settings.gradle.kts b/settings.gradle.kts deleted file mode 100644 index 67b6e93..0000000 --- a/settings.gradle.kts +++ /dev/null @@ -1,12 +0,0 @@ -enableFeaturePreview("VERSION_CATALOGS") - -dependencyResolutionManagement { - repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) - repositories { - google() - mavenCentral() - maven(url = "https://www.jitpack.io") - } -} -rootProject.name = "Animity" -include(":app")