-
Notifications
You must be signed in to change notification settings - Fork 984
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "nix: refactor android sdk package"
This reverts commit 68b9b18.
- Loading branch information
Showing
18 changed files
with
135 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# | ||
# This Nix expression centralizes the configuration for the Android development environment | ||
# | ||
|
||
{ stdenv, config, callPackage, androidenv, openjdk, mkShell }: | ||
|
||
let | ||
androidComposition = androidenv.composeAndroidPackages { | ||
toolsVersion = "26.1.1"; | ||
platformToolsVersion = "29.0.6"; | ||
buildToolsVersions = [ "29.0.2" ]; | ||
includeEmulator = false; | ||
platformVersions = [ "29" ]; | ||
includeSources = false; | ||
includeDocs = false; | ||
includeSystemImages = false; | ||
systemImageTypes = [ "default" ]; | ||
lldbVersions = [ "3.1.4508709" ]; | ||
cmakeVersions = [ "3.10.2" ]; | ||
includeNDK = true; | ||
ndkVersion = "21.0.6113669"; | ||
useGoogleAPIs = false; | ||
useGoogleTVAddOns = false; | ||
includeExtras = [ "extras;android;m2repository" "extras;google;m2repository" ]; | ||
}; | ||
licensedAndroidEnv = stdenv.mkDerivation rec { | ||
name = "licensed-android-sdk"; | ||
version = "licensed"; | ||
phases = [ "installPhase" "licensePhase" ]; | ||
installPhase = '' | ||
mkdir -p $out/libexec/android-sdk | ||
ln -s "${androidComposition.androidsdk}/bin" $out/bin | ||
for d in ${androidComposition.androidsdk}/libexec/android-sdk/*; do | ||
ln -s $d $out/$(basename $d) | ||
done | ||
''; | ||
licensePhase = stdenv.lib.optionalString config.android_sdk.accept_license '' | ||
mkdir -p $out/licenses | ||
echo -e "\n601085b94cd77f0b54ff86406957099ebe79c4d6" > "$out/licenses/android-googletv-license" | ||
echo -e "\n24333f8a63b6825ea9c5514f83c2829b004d1fee" > "$out/licenses/android-sdk-license" | ||
echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$out/licenses/android-sdk-preview-license" | ||
echo -e "\nd975f751698a77b662f1254ddbeed3901e976f5a" > "$out/licenses/intel-android-extra-license" | ||
echo -e "\n33b6a2b64607f11b759f320ef9dff4ae5c47d97a" > "$out/licenses/google-gdk-license" | ||
''; | ||
}; | ||
shell = mkShell { | ||
shellHook = '' | ||
export JAVA_HOME="${openjdk}" | ||
export ANDROID_HOME="${licensedAndroidEnv}" | ||
export ANDROID_SDK_ROOT="$ANDROID_HOME" | ||
export ANDROID_NDK_ROOT="${androidComposition.androidsdk}/libexec/android-sdk/ndk-bundle" | ||
export ANDROID_NDK_HOME="$ANDROID_NDK_ROOT" | ||
export ANDROID_NDK="$ANDROID_NDK_ROOT" | ||
export PATH="$ANDROID_HOME/bin:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools:$ANDROID_HOME/build-tools:$PATH" | ||
''; | ||
}; | ||
|
||
in { | ||
drv = licensedAndroidEnv; | ||
inherit androidComposition shell; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
{ mergeSh, mkShell, curl, flock, git, gradle, jq, maven, nodejs, | ||
projectNodePackage, androidShell, status-go }: | ||
{ mkShell, curl, flock, git, gradle, jq, maven, nodejs, | ||
projectNodePackage, androidEnvShellHook, status-go }: | ||
|
||
mergeSh (mkShell { | ||
mkShell { | ||
buildInputs = [ | ||
curl flock # used in reset-node_modules.sh | ||
git gradle jq maven nodejs | ||
curl | ||
flock # used in reset-node_modules.sh | ||
git | ||
gradle | ||
jq | ||
maven | ||
nodejs | ||
projectNodePackage | ||
]; | ||
shellHook = '' | ||
${androidEnvShellHook} | ||
${status-go.shell.shellHook} | ||
$STATUS_REACT_HOME/nix/mobile/reset-node_modules.sh "${projectNodePackage}" | ||
''; | ||
}) [ status-go.shell androidShell ] | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,41 @@ | ||
{ config, lib, stdenvNoCC, callPackage, mkShell, | ||
status-go, mergeSh, xcodeWrapper }: | ||
{ config, lib, stdenvNoCC, callPackage, status-go, | ||
localMavenRepoBuilder, composeXcodeWrapper, mkShell, mergeSh }: | ||
|
||
let | ||
inherit (lib) catAttrs concatStrings optional unique; | ||
|
||
projectNodePackage = callPackage ./node-package.nix { }; | ||
|
||
localMavenRepoBuilder = callPackage ../tools/maven/maven-repo-builder.nix { }; | ||
|
||
xcodewrapperArgs = { | ||
version = "11.4.1"; | ||
}; | ||
xcodeWrapper = composeXcodeWrapper xcodewrapperArgs; | ||
fastlane = callPackage ./fastlane { }; | ||
|
||
android = callPackage ./android { | ||
androidPlatform = callPackage ./android { | ||
inherit localMavenRepoBuilder projectNodePackage; | ||
status-go = status-go.android; | ||
}; | ||
|
||
ios = callPackage ./ios { | ||
iosPlatform = callPackage ./ios { | ||
inherit xcodeWrapper projectNodePackage fastlane; | ||
status-go = status-go.ios; | ||
}; | ||
|
||
selectedSources = [ | ||
fastlane | ||
status-go.android | ||
status-go.ios | ||
fastlane | ||
android | ||
ios | ||
androidPlatform | ||
iosPlatform | ||
]; | ||
|
||
projectNodePackage = callPackage ./node-package.nix { inherit (lib) importJSON; }; | ||
|
||
in { | ||
buildInputs = unique (catAttrs "buildInputs" selectedSources); | ||
|
||
shell = mergeSh (mkShell {}) (catAttrs "shell" selectedSources); | ||
|
||
# CHILD DERIVATIONS | ||
android = androidPlatform; | ||
ios = iosPlatform; | ||
|
||
# TARGETS | ||
inherit android ios fastlane; | ||
inherit fastlane xcodeWrapper; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.