Unverified Commit a3a5306f authored by Georg Koppen's avatar Georg Koppen
Browse files

Bug 33556: Add android-components

parent f33d3e07
#!/bin/bash
[% c("var/set_default_env") -%]
[% pc(c('var/compiler'), 'var/setup', { compiler_tarfile => c('input_files_by_name/' _ c('var/compiler')) }) %]
distdir=/var/tmp/dist
builddir=/var/tmp/build/[% project %]
mkdir -p $distdir/[% project %]
mkdir -p /var/tmp/build
[% IF !c("var/fetch_gradle_dependencies") %]
# XXX: Make this more generic and not only for geckoview-beta.
geckoview_version=$(find . -type f -name geckoview-beta-*.aar | cut -d \- -f 6 | cut -d \. -f 1-3)
gradle_repo=$rootdir/[% c('input_files_by_name/gradle-dependencies') %]
cp -r $gradle_repo/dl/android/maven2/* $gradle_repo
cp -r $gradle_repo/maven2/* $gradle_repo
cp -r $gradle_repo/m2/* $gradle_repo
tar -C $distdir -xf [% c('input_files_by_name/application-services') %]
# XXX: We could be smarter and just copy over the projects that are needed
# according to the Gradle dependencies list.
cp -rf $distdir/application-services/maven/org $gradle_repo
tar -C $distdir -xf [% c('input_files_by_name/geckoview') %]
[% END %]
tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz
cd $builddir-[% c('version') %]
patch -p1 < $rootdir/git.patch
[% IF c("var/fetch_gradle_dependencies") %]
# XXX: fetching deps for `assembleGeckoBeta -x lint` by using that same target
# results in some missing dependencies for yet unknown reasons. Thus, we use
# `assemble` instead for now.
gradle --debug -no-daemon assemble
[% ELSE %]
patch -p1 < $rootdir/mavenLocal.patch
# Make sure our GeckoView dependency is used. XXX: Make this more generic and
# not only for geckoview-beta.
cp -f $distdir/geckoview/*.aar $gradle_repo/org/mozilla/geckoview/geckoview-beta/$geckoview_version/geckoview-beta-$geckoview_version.aar
gradle_args="--offline --no-daemon -Dmaven.repo.local=$gradle_repo"
gradle $gradle_args assembleGeckoBeta -x lint
gradle $gradle_args publish
find components -regex '.*[0-9].\(aar\|pom\)' -exec cp --parents {} $distdir \;
# Package
cd $distdir
find components -type d -name maven -exec cp -rf {} [% project %] \;
[% c('tar', {
tar_src => [ project ],
tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
}) %]
[% END %]
# vim: filetype=yaml sw=2
version: v52.0.3
filename: '[% project %]-[% c("version") %]-[% c("var/build_id") %].tar.gz'
git_hash: 98aedbeb17261966052dda3dbd9b2953e015e435 # v52.0.3
git_url: https://github.com/mozilla-mobile/android-components
var:
container:
use_container: 1
# This should be updated when the list of gradle dependencies is changed.
gradle_dependencies_version: 1
# Switch to make it easier to grab all dependencies during a dry-run.
fetch_gradle_dependencies: 0
targets:
nightly:
version: '[% c("abbrev") %]'
git_hash: 98aedbeb17261966052dda3dbd9b2953e015e435
input_files:
- project: container-image
- name: '[% c("var/compiler") %]'
project: '[% c("var/compiler") %]'
- name: geckoview
project: geckoview
pkg_type: merge_aars
enable: '[% !c("var/fetch_gradle_dependencies") %]'
- name: application-services
project: application-services
enable: '[% !c("var/fetch_gradle_dependencies") %]'
- filename: 'gradle-dependencies-[% c("var/gradle_dependencies_version") %]'
name: gradle-dependencies
exec: '[% INCLUDE "fetch-gradle-dependencies" %]'
enable: '[% !c("var/fetch_gradle_dependencies") %]'
- filename: git.patch
- filename: mavenLocal.patch
enable: '[% !c("var/fetch_gradle_dependencies") %]'
From a77b847b6451c598176137b944edf27e6e7202a2 Mon Sep 17 00:00:00 2001
From: Georg Koppen <gk@torproject.org>
Date: Sun, 19 Apr 2020 17:59:16 +0000
Subject: [PATCH 1/5] git patch
diff --git a/components/support/base/build.gradle b/components/support/base/build.gradle
index aa4c1b005..4318f1334 100644
--- a/components/support/base/build.gradle
+++ b/components/support/base/build.gradle
@@ -37,7 +37,7 @@ android {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- buildConfigField("String", "GIT_HASH", "\"" + getGitHash() + "\"")
+ buildConfigField("String", "GIT_HASH", "\"release build\"")
}
}
--
2.27.0.rc0
This diff is collapsed.
From 6a88b59457dd38f0e8d69f0c2988bb2952075536 Mon Sep 17 00:00:00 2001
From: Georg Koppen <gk@torproject.org>
Date: Wed, 20 May 2020 14:18:12 +0000
Subject: [PATCH] mavenLocal() fixes
diff --git a/build.gradle b/build.gradle
index 9f298887a..278245d30 100644
--- a/build.gradle
+++ b/build.gradle
@@ -6,6 +6,7 @@ import static org.gradle.api.tasks.testing.TestResult.ResultType
buildscript {
repositories {
+ mavenLocal()
if (project.hasProperty("googleRepo")) {
maven {
name "Google"
@@ -48,6 +49,7 @@ plugins {
allprojects {
repositories {
+ mavenLocal()
if (project.hasProperty("googleRepo")) {
maven {
name "Google"
diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle
index 9f05b8434..f97029ccf 100644
--- a/buildSrc/build.gradle
+++ b/buildSrc/build.gradle
@@ -7,6 +7,7 @@ plugins {
}
repositories {
+ mavenLocal()
jcenter()
}
diff --git a/buildSrc/settings.gradle b/buildSrc/settings.gradle
index c31ad3840..fb6526db3 100644
--- a/buildSrc/settings.gradle
+++ b/buildSrc/settings.gradle
@@ -1,10 +1,15 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+pluginManagement {
+ repositories {
+ mavenLocal()
+ }
+}
buildCache {
local {
directory = new File(rootDir, '../.build-cache')
removeUnusedEntriesAfterDays = 30
}
-}
\ No newline at end of file
+}
diff --git a/settings.gradle b/settings.gradle
index a6e8dfa49..049fa29d6 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -4,8 +4,15 @@
import org.yaml.snakeyaml.Yaml
+pluginManagement {
+ repositories {
+ mavenLocal()
+ }
+}
+
buildscript {
repositories {
+ mavenLocal()
jcenter()
}
--
2.28.0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment