android-studio-preview: Print a deprecation warning
Hope this is ok... :)
This commit is contained in:
parent
d8b44edd8f
commit
88bfbf6c7d
|
@ -1,4 +1,4 @@
|
||||||
{ channel, pname, version, build, sha256Hash }:
|
{ channel, pname, version, build, sha256Hash, deprecated ? false }:
|
||||||
|
|
||||||
{ bash
|
{ bash
|
||||||
, buildFHSUserEnv
|
, buildFHSUserEnv
|
||||||
|
@ -37,6 +37,18 @@
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
# TODO: This is a bit stupid to be honest...
|
||||||
|
# The problem is that we have to make sure this is only executed if the
|
||||||
|
# derivation is actually build to avoid always printing this warning (e.g.
|
||||||
|
# "nix-env -qaP"). Since this will always evaluate to "" it won't actually
|
||||||
|
# change the derivation (only generate a side-effect) but we have to make
|
||||||
|
# sure this expression is evaluated lazily!
|
||||||
|
printDeprecationWarning = if deprecated then (builtins.trace ''
|
||||||
|
android-studio-preview and androidStudioPackages.preview are old aliases
|
||||||
|
and will be dropped at some point, please use androidStudioPackages.beta
|
||||||
|
instead (corresponds to the correct channel name).''
|
||||||
|
"")
|
||||||
|
else "";
|
||||||
drvName = "android-studio-${channel}-${version}";
|
drvName = "android-studio-${channel}-${version}";
|
||||||
androidStudio = stdenv.mkDerivation {
|
androidStudio = stdenv.mkDerivation {
|
||||||
name = drvName;
|
name = drvName;
|
||||||
|
@ -130,7 +142,7 @@ in
|
||||||
text = ''
|
text = ''
|
||||||
#!${bash}/bin/bash
|
#!${bash}/bin/bash
|
||||||
${fhsEnv}/bin/${drvName}-fhs-env ${androidStudio}/bin/studio.sh
|
${fhsEnv}/bin/${drvName}-fhs-env ${androidStudio}/bin/studio.sh
|
||||||
'';
|
'' + printDeprecationWarning;
|
||||||
} // {
|
} // {
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "The Official IDE for Android (${channel} channel)";
|
description = "The Official IDE for Android (${channel} channel)";
|
||||||
|
|
|
@ -23,8 +23,12 @@ let
|
||||||
sha256Hash = "0r93yzw87cgzz60p60gknij5vaqmv1a1kyd4cr9gx8cbxw46lhwh";
|
sha256Hash = "0r93yzw87cgzz60p60gknij5vaqmv1a1kyd4cr9gx8cbxw46lhwh";
|
||||||
};
|
};
|
||||||
in rec {
|
in rec {
|
||||||
# Old alias
|
# TODO: Drop old alias after 18.09
|
||||||
preview = beta;
|
preview = mkStudio (betaVersion // {
|
||||||
|
channel = "beta";
|
||||||
|
pname = "android-studio-preview";
|
||||||
|
deprecated = true;
|
||||||
|
});
|
||||||
|
|
||||||
# Attributes are named by their corresponding release channels
|
# Attributes are named by their corresponding release channels
|
||||||
|
|
||||||
|
|
|
@ -15170,7 +15170,7 @@ with pkgs;
|
||||||
|
|
||||||
androidStudioPackages = callPackage ../applications/editors/android-studio { };
|
androidStudioPackages = callPackage ../applications/editors/android-studio { };
|
||||||
android-studio = androidStudioPackages.stable;
|
android-studio = androidStudioPackages.stable;
|
||||||
android-studio-preview = androidStudioPackages.beta;
|
android-studio-preview = androidStudioPackages.preview; # TODO: Drop old alias after 18.09
|
||||||
|
|
||||||
antfs-cli = callPackage ../applications/misc/antfs-cli {};
|
antfs-cli = callPackage ../applications/misc/antfs-cli {};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue