prebuild: reformat

Reformat the prebuild file, which apparently decided to format
themselves with indents instead of spaces. Fun.
This commit is contained in:
OxygenCobalt 2022-01-09 18:59:26 -07:00
parent 2f190f1e0b
commit 5359c819bd
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
3 changed files with 34 additions and 34 deletions

View file

@ -19,7 +19,7 @@ import com.google.android.exoplayer2.MediaItem
import com.google.android.exoplayer2.MediaMetadata import com.google.android.exoplayer2.MediaMetadata
import com.google.android.exoplayer2.MetadataRetriever import com.google.android.exoplayer2.MetadataRetriever
import com.google.android.exoplayer2.metadata.id3.ApicFrame import com.google.android.exoplayer2.metadata.id3.ApicFrame
import com.google.android.exoplayer2.metadata.xiph.PictureFrame import com.google.android.exoplayer2.metadata.vorbis.PictureFrame
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext import kotlinx.coroutines.withContext
import okio.buffer import okio.buffer

View file

@ -26,7 +26,7 @@ import androidx.media.AudioFocusRequestCompat
import androidx.media.AudioManagerCompat import androidx.media.AudioManagerCompat
import com.google.android.exoplayer2.metadata.Metadata import com.google.android.exoplayer2.metadata.Metadata
import com.google.android.exoplayer2.metadata.id3.TextInformationFrame import com.google.android.exoplayer2.metadata.id3.TextInformationFrame
import com.google.android.exoplayer2.metadata.xiph.VorbisComment import com.google.android.exoplayer2.metadata.vorbis.VorbisComment
import org.oxycblt.auxio.playback.state.PlaybackStateManager import org.oxycblt.auxio.playback.state.PlaybackStateManager
import org.oxycblt.auxio.settings.SettingsManager import org.oxycblt.auxio.settings.SettingsManager
import org.oxycblt.auxio.util.getSystemServiceSafe import org.oxycblt.auxio.util.getSystemServiceSafe

View file

@ -20,53 +20,53 @@ system = platform.system()
# We do some shell scripting later on, so we can't support windows. # We do some shell scripting later on, so we can't support windows.
if system not in ["Linux", "Darwin"]: if system not in ["Linux", "Darwin"]:
print("fatal: unsupported platform " + system) print("fatal: unsupported platform " + system)
sys.exit(1) sys.exit(1)
def sh(cmd): def sh(cmd):
code = subprocess.call(["sh", "-c", "set -e; " + cmd]) code = subprocess.call(["sh", "-c", "set -e; " + cmd])
if code != 0: if code != 0:
print(FATAL + "fatal:" + NC + " command failed with exit code " + str(code)) print(FATAL + "fatal:" + NC + " command failed with exit code " + str(code))
sys.exit(1) sys.exit(1)
exoplayer_path = os.path.join(os.path.abspath(os.curdir), "deps", "exoplayer") exoplayer_path = os.path.join(os.path.abspath(os.curdir), "deps", "exoplayer")
if os.path.exists(exoplayer_path): if os.path.exists(exoplayer_path):
reinstall = input(INFO + "info:" + NC + " ExoPlayer is already installed. Would you like to reinstall it? [y/n] ") reinstall = input(INFO + "info:" + NC + " ExoPlayer is already installed. Would you like to reinstall it? [y/n] ")
if not re.match("[yY][eE][sS]|[yY]", reinstall): if not re.match("[yY][eE][sS]|[yY]", reinstall):
sys.exit(0) sys.exit(0)
ndk_path = os.getenv("NDK_PATH") ndk_path = os.getenv("NDK_PATH")
if ndk_path is None or not os.path.isfile(os.path.join(ndk_path, "ndk_build")): if ndk_path is None or not os.path.isfile(os.path.join(ndk_path, "ndk_build")):
# We don't have a proper path. Do some digging on the Android SDK directory # We don't have a proper path. Do some digging on the Android SDK directory
# to see if we can find it. # to see if we can find it.
if system == "Linux": if system == "Linux":
ndk_root = os.path.join(os.getenv("HOME"), "Android", "Sdk", "ndk") ndk_root = os.path.join(os.getenv("HOME"), "Android", "Sdk", "ndk")
elif system == "Darwin": elif system == "Darwin":
ndk_root = os.path.join(os.getenv("HOME"), "Library", "Android", "sdk", "ndk") ndk_root = os.path.join(os.getenv("HOME"), "Library", "Android", "sdk", "ndk")
candidates = [] candidates = []
for entry in os.scandir(ndk_root): for entry in os.scandir(ndk_root):
if entry.is_dir(): if entry.is_dir():
candidates.append(entry.path) candidates.append(entry.path)
if len(candidates) > 0: if len(candidates) > 0:
print(WARN + "warn:" + NC + " NDK_PATH was not set or invalid. Multiple candidates were found however:") print(WARN + "warn:" + NC + " NDK_PATH was not set or invalid. Multiple candidates were found however:")
for i, candidate in enumerate(candidates): for i, candidate in enumerate(candidates):
print("[" + str(i) + "] " + candidate) print("[" + str(i) + "] " + candidate)
try: try:
ndk_path = candidates[int(input("Enter the NDK to use [Default 0]: "))] ndk_path = candidates[int(input("Enter the NDK to use [Default 0]: "))]
except: except:
ndk_path = candidates[0] ndk_path = candidates[0]
else: else:
print(FATAL + "fatal:" + NC + " NDK_PATH is either invalid, or the Android NDK was not installed at a recognized location.") print(FATAL + "fatal:" + NC + " NDK_PATH is either invalid, or the Android NDK was not installed at a recognized location.")
system.exit(1) system.exit(1)
# Now try to install ExoPlayer. # Now try to install ExoPlayer.
sh("rm -rf deps") sh("rm -rf deps")
@ -82,4 +82,4 @@ os.chdir(flac_ext_jni_path)
sh('curl "https://ftp.osuosl.org/pub/xiph/releases/flac/flac-' + FLAC_VERSION + '.tar.xz" | tar xJ && mv "flac-' + FLAC_VERSION + '" flac') sh('curl "https://ftp.osuosl.org/pub/xiph/releases/flac/flac-' + FLAC_VERSION + '.tar.xz" | tar xJ && mv "flac-' + FLAC_VERSION + '" flac')
sh(ndk_path + "/ndk-build APP_ABI=all -j4") sh(ndk_path + "/ndk-build APP_ABI=all -j4")
print(OK + "Prebuild successful." + NC) print(OK + "success:" + NC + " Completed pre-build.")