Skip to content

Commit

Permalink
Merge pull request #1 from matrix-org/android_dev
Browse files Browse the repository at this point in the history
Support getting android dev apks
  • Loading branch information
erikjohnston committed Feb 4, 2015
2 parents d8e660d + 312365a commit e767d87
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
11 changes: 9 additions & 2 deletions console/download/fetchbuild.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,17 @@ function fetch_ios_build($stream) {
}

// XXX: c+p tastic but probably not worth factoring out for this
function fetch_android_build() {
function fetch_android_build($stream) {
$streams = array(
'master' => 'MatrixAndroidSDK',
'develop' => 'MatrixAndroidSDKDevelop'
);

$jenkinsjob = $streams[$stream];

$context = _get_jenkins_stream_context();

$resp = json_decode(file_get_contents('http://matrix.org/jenkins/job/MatrixAndroidSDK/lastSuccessfulBuild/api/json', false, $context), true);
$resp = json_decode(file_get_contents("http://matrix.org/jenkins/job/$jenkinsjob/lastSuccessfulBuild/api/json", false, $context), true);

$build = $resp['number'];

Expand Down
6 changes: 5 additions & 1 deletion console/download/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
echo '<meta http-equiv="refresh" content="0; url='.$url.'">';
}
else if (ereg('Android|android',$_SERVER['HTTP_USER_AGENT'])) {
$buildinfo = fetch_android_build();
$stream = 'master';
if (isset($_GET['dev'])) {
$stream = 'develop';
}
$buildinfo = fetch_android_build($stream);

//$latest = trim(file_get_contents('LATEST-android'));
$url = "http://matrix.org/console/download/{$buildinfo['apkPath']}";
Expand Down

0 comments on commit e767d87

Please sign in to comment.