Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19385 from taku0/android_sdk_sources
androidenv: Add API sources
- Loading branch information
Showing
6 changed files
with
220 additions
and
3 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh -e | ||
|
||
xsltproc generate-sources.xsl repository-11.xml > sources.nix |
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,52 @@ | ||
<?xml version="1.0"?> | ||
|
||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
xmlns:sdk="http://schemas.android.com/sdk/android/repository/11"> | ||
|
||
<xsl:output omit-xml-declaration="yes" indent="no" /> | ||
|
||
<xsl:template name="repository-url"> | ||
<xsl:variable name="raw-url" select="sdk:archives/sdk:archive/sdk:url"/> | ||
<xsl:choose> | ||
<xsl:when test="starts-with($raw-url, 'http')"> | ||
<xsl:value-of select="$raw-url"/> | ||
</xsl:when> | ||
<xsl:otherwise> | ||
<xsl:text>https://dl.google.com/android/repository/</xsl:text> | ||
<xsl:value-of select="$raw-url"/> | ||
</xsl:otherwise> | ||
</xsl:choose> | ||
</xsl:template> | ||
|
||
<xsl:template match="/sdk:sdk-repository"> | ||
# This file is generated from generate-sources.sh. DO NOT EDIT. | ||
# Execute generate-sources.sh or fetch.sh to update the file. | ||
{stdenv, fetchurl, unzip}: | ||
|
||
let | ||
buildSource = args: | ||
stdenv.mkDerivation (args // { | ||
buildInputs = [ unzip ]; | ||
buildCommand = '' | ||
mkdir -p $out | ||
cd $out | ||
unzip $src | ||
''; | ||
}); | ||
in | ||
{ | ||
<xsl:for-each select="sdk:source"><xsl:sort select="sdk:api-level" data-type="number"/> | ||
source_<xsl:value-of select="sdk:api-level" /> = buildSource { | ||
name = "android-source-<xsl:value-of select="sdk:api-level" />"; | ||
src = fetchurl { | ||
url = <xsl:call-template name="repository-url"/>; | ||
sha1 = "<xsl:value-of select="sdk:archives/sdk:archive/sdk:checksum[@type='sha1']" />"; | ||
}; | ||
meta = { | ||
description = "Source code for Android API <xsl:value-of select="sdk:api-level" />"; | ||
}; | ||
}; | ||
</xsl:for-each> | ||
} | ||
</xsl:template> | ||
</xsl:stylesheet> |
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,140 @@ | ||
|
||
# This file is generated from generate-sources.sh. DO NOT EDIT. | ||
# Execute generate-sources.sh or fetch.sh to update the file. | ||
{stdenv, fetchurl, unzip}: | ||
|
||
let | ||
buildSource = args: | ||
stdenv.mkDerivation (args // { | ||
buildInputs = [ unzip ]; | ||
buildCommand = '' | ||
mkdir -p $out | ||
cd $out | ||
unzip $src | ||
''; | ||
}); | ||
in | ||
{ | ||
|
||
source_14 = buildSource { | ||
name = "android-source-14"; | ||
src = fetchurl { | ||
url = https://dl.google.com/android/repository/sources-14_r01.zip; | ||
sha1 = "eaf4ed7dcac46e68516a1b4aa5b0d9e5a39a7555"; | ||
}; | ||
meta = { | ||
description = "Source code for Android API 14"; | ||
}; | ||
}; | ||
|
||
source_15 = buildSource { | ||
name = "android-source-15"; | ||
src = fetchurl { | ||
url = https://dl.google.com/android/repository/sources-15_r02.zip; | ||
sha1 = "e5992a5747c9590783fbbdd700337bf0c9f6b1fa"; | ||
}; | ||
meta = { | ||
description = "Source code for Android API 15"; | ||
}; | ||
}; | ||
|
||
source_16 = buildSource { | ||
name = "android-source-16"; | ||
src = fetchurl { | ||
url = https://dl.google.com/android/repository/sources-16_r02.zip; | ||
sha1 = "0f83c14ed333c45d962279ab5d6bc98a0269ef84"; | ||
}; | ||
meta = { | ||
description = "Source code for Android API 16"; | ||
}; | ||
}; | ||
|
||
source_17 = buildSource { | ||
name = "android-source-17"; | ||
src = fetchurl { | ||
url = https://dl.google.com/android/repository/sources-17_r01.zip; | ||
sha1 = "6f1f18cd2d2b1852d7f6892df9cee3823349d43a"; | ||
}; | ||
meta = { | ||
description = "Source code for Android API 17"; | ||
}; | ||
}; | ||
|
||
source_18 = buildSource { | ||
name = "android-source-18"; | ||
src = fetchurl { | ||
url = https://dl.google.com/android/repository/sources-18_r01.zip; | ||
sha1 = "8b49fdf7433f4881a2bfb559b5dd05d8ec65fb78"; | ||
}; | ||
meta = { | ||
description = "Source code for Android API 18"; | ||
}; | ||
}; | ||
|
||
source_19 = buildSource { | ||
name = "android-source-19"; | ||
src = fetchurl { | ||
url = https://dl.google.com/android/repository/sources-19_r02.zip; | ||
sha1 = "433a1d043ef77561571250e94cb7a0ef24a202e7"; | ||
}; | ||
meta = { | ||
description = "Source code for Android API 19"; | ||
}; | ||
}; | ||
|
||
source_20 = buildSource { | ||
name = "android-source-20"; | ||
src = fetchurl { | ||
url = https://dl.google.com/android/repository/sources-20_r01.zip; | ||
sha1 = "8da3e40f2625f9f7ef38b7e403f49f67226c0d76"; | ||
}; | ||
meta = { | ||
description = "Source code for Android API 20"; | ||
}; | ||
}; | ||
|
||
source_21 = buildSource { | ||
name = "android-source-21"; | ||
src = fetchurl { | ||
url = https://dl.google.com/android/repository/sources-21_r01.zip; | ||
sha1 = "137a5044915d32bea297a8c1552684802bbc2e25"; | ||
}; | ||
meta = { | ||
description = "Source code for Android API 21"; | ||
}; | ||
}; | ||
|
||
source_22 = buildSource { | ||
name = "android-source-22"; | ||
src = fetchurl { | ||
url = https://dl.google.com/android/repository/sources-22_r01.zip; | ||
sha1 = "98320e13976d11597a4a730a8d203ac9a03ed5a6"; | ||
}; | ||
meta = { | ||
description = "Source code for Android API 22"; | ||
}; | ||
}; | ||
|
||
source_23 = buildSource { | ||
name = "android-source-23"; | ||
src = fetchurl { | ||
url = https://dl.google.com/android/repository/sources-23_r01.zip; | ||
sha1 = "b0f15da2762b42f543c5e364c2b15b198cc99cc2"; | ||
}; | ||
meta = { | ||
description = "Source code for Android API 23"; | ||
}; | ||
}; | ||
|
||
source_24 = buildSource { | ||
name = "android-source-24"; | ||
src = fetchurl { | ||
url = https://dl.google.com/android/repository/sources-24_r01.zip; | ||
sha1 = "6b96115830a83d654479f32ce4b724ca9011148b"; | ||
}; | ||
meta = { | ||
description = "Source code for Android API 24"; | ||
}; | ||
}; | ||
|
||
} |