mirror of
https://github.com/ivabus/pantry
synced 2024-11-26 02:15:06 +03:00
690b3b7329
* new file: projects/android.com/cmdline-tools/package.yml * add runtime env * better test * use ANDROID_HOME var in test * maybe version 31 will work with linux arm * sdkmanager --install "tools" * just install android platform and check version
62 lines
2 KiB
YAML
62 lines
2 KiB
YAML
distributable: ~
|
|
|
|
versions:
|
|
url: https://developer.android.com/studio
|
|
match: /commandlinetools-mac-\d+_latest\.zip/
|
|
strip:
|
|
- /^commandlinetools-mac-/
|
|
- /_latest\.zip/
|
|
|
|
warnings:
|
|
- vendored
|
|
|
|
dependencies:
|
|
openjdk.org: '>=17'
|
|
|
|
runtime:
|
|
env:
|
|
ANDROID_HOME: ${{prefix}}/libexec
|
|
PATH: $PATH:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/emulator
|
|
|
|
build:
|
|
dependencies:
|
|
info-zip.org/unzip: '*'
|
|
curl.se: '*'
|
|
script:
|
|
- curl -L "$DIST_URL" -o android-commandlinetools.zip
|
|
- unzip android-commandlinetools.zip
|
|
# we need to use `cmdline-tools/latest` path to avoid:
|
|
# Error: Either specify it explicitly with --sdk_root=
|
|
- run: mkdir -p libexec/cmdline-tools/latest
|
|
working-directory: ${{prefix}}
|
|
- run: cp -r * {{prefix}}/libexec/cmdline-tools/latest/
|
|
working-directory: cmdline-tools
|
|
- run: |
|
|
ln -s ../libexec/cmdline-tools/latest/bin/apkanalyzer apkanalyzer
|
|
ln -s ../libexec/cmdline-tools/latest/bin/avdmanager avdmanager
|
|
ln -s ../libexec/cmdline-tools/latest/bin/lint lint
|
|
ln -s ../libexec/cmdline-tools/latest/bin/profgen profgen
|
|
ln -s ../libexec/cmdline-tools/latest/bin/resourceshrinker resourceshrinker
|
|
ln -s ../libexec/cmdline-tools/latest/bin/retrace retrace
|
|
ln -s ../libexec/cmdline-tools/latest/bin/screenshot2 screenshot2
|
|
ln -s ../libexec/cmdline-tools/latest/bin/sdkmanager sdkmanager
|
|
working-directory: ${{prefix}}/bin
|
|
env:
|
|
linux:
|
|
DIST_URL: https://dl.google.com/android/repository/commandlinetools-linux-{{version.raw}}_latest.zip
|
|
darwin:
|
|
DIST_URL: https://dl.google.com/android/repository/commandlinetools-mac-{{version.raw}}_latest.zip
|
|
|
|
provides:
|
|
- bin/apkanalyzer
|
|
- bin/avdmanager
|
|
- bin/lint
|
|
- bin/profgen
|
|
- bin/resourceshrinker
|
|
- bin/retrace
|
|
- bin/screenshot2
|
|
- bin/sdkmanager
|
|
|
|
test:
|
|
- echo y | sdkmanager --install "platforms;android-30"
|
|
- cat $ANDROID_HOME/platforms/android-30/source.properties | grep "AndroidVersion.ApiLevel=30"
|