This repository has been archived by the owner on Feb 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Moves nightly/beta configuration to be a "build type" #1693
Merged
boek
merged 1 commit into
mozilla-mobile:master
from
mitchhentges:gradle-channel-build-type
Apr 22, 2019
+63
−155
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 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
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 |
---|---|---|
|
@@ -39,12 +39,12 @@ def __init__( | |
self.date = arrow.get(date_string) | ||
self.trust_level = trust_level | ||
|
||
def craft_assemble_release_task(self, architectures, is_staging=False): | ||
def craft_assemble_nightly_task(self, architectures, is_staging=False): | ||
artifacts = { | ||
'public/target.{}.apk'.format(arch): { | ||
"type": 'file', | ||
"path": '/opt/fenix/app/build/outputs/apk/' | ||
'{}Greenfield/release/app-{}-greenfield-release-unsigned.apk'.format(arch, arch), | ||
'{}/nightly/app-{}-nightly-unsigned.apk'.format(arch, arch), | ||
"expires": taskcluster.stringDate(taskcluster.fromNow(DEFAULT_EXPIRES_IN)), | ||
} | ||
for arch in architectures | ||
|
@@ -72,7 +72,7 @@ def craft_assemble_release_task(self, architectures, is_staging=False): | |
) | ||
|
||
gradle_commands = ( | ||
'./gradlew --no-daemon -PcrashReports=true -Ptelemetry=true clean test assembleRelease', | ||
'./gradlew --no-daemon -PcrashReports=true -Ptelemetry=true clean test assembleNightly', | ||
) | ||
|
||
command = ' && '.join( | ||
|
@@ -172,8 +172,8 @@ def craft_ktlint_task(self): | |
def craft_lint_task(self): | ||
return self._craft_clean_gradle_task( | ||
name='lint', | ||
description='Running lint for arm64 release variant', | ||
gradle_task='lintAarch64GreenfieldRelease', | ||
description='Running lint for aarch64 release variant', | ||
gradle_task='lintAarch64Release', | ||
treeherder={ | ||
'jobKind': 'test', | ||
'machine': { | ||
|
@@ -331,22 +331,20 @@ def _craft_default_task_definition( | |
def craft_master_commit_signing_task( | ||
self, assemble_task_id, variant | ||
): | ||
architecture, build_type, product = _get_architecture_and_build_type_and_product_from_variant(variant) | ||
product = convert_camel_case_into_kebab_case(product) | ||
postfix = convert_camel_case_into_kebab_case('{}-{}'.format(architecture, build_type)) | ||
architecture, build_type = get_architecture_and_build_type_from_variant(variant) | ||
routes = [ | ||
'index.project.mobile.fenix.branch.master.revision.{}.{}.{}'.format( | ||
self.commit, product, postfix | ||
'index.project.mobile.fenix.v2.branch.master.revision.{}.{}.{}'.format( | ||
self.commit, build_type, architecture | ||
mitchhentges marked this conversation as resolved.
Show resolved
Hide resolved
|
||
), | ||
'index.project.mobile.fenix.branch.master.latest.{}.{}'.format( | ||
product, postfix | ||
'index.project.mobile.fenix.v2.branch.master.latest.{}.{}.{}'.format( | ||
product, build_type, architecture | ||
), | ||
'index.project.mobile.fenix.branch.master.pushdate.{}.{}.{}.revision.{}.{}.{}'.format( | ||
'index.project.mobile.fenix.v2.branch.master.pushdate.{}.{}.{}.revision.{}.{}.{}'.format( | ||
self.date.year, self.date.month, self.date.day, self.commit, | ||
product, postfix | ||
build_type, architecture | ||
), | ||
'index.project.mobile.fenix.branch.master.pushdate.{}.{}.{}.latest.{}.{}'.format( | ||
self.date.year, self.date.month, self.date.day, product, postfix | ||
'index.project.mobile.fenix.v2.branch.master.pushdate.{}.{}.{}.latest.{}.{}'.format( | ||
self.date.year, self.date.month, self.date.day, build_type, architecture | ||
), | ||
] | ||
|
||
|
@@ -439,15 +437,13 @@ def craft_push_task( | |
|
||
|
||
def _craft_treeherder_platform_from_variant(variant): | ||
architecture, build_type, _ = _get_architecture_and_build_type_and_product_from_variant( | ||
variant | ||
) | ||
architecture, build_type = get_architecture_and_build_type_from_variant(variant) | ||
return 'android-{}-{}'.format(architecture, build_type) | ||
|
||
|
||
def _craft_treeherder_group_symbol_from_variant(variant): | ||
_, __, product = _get_architecture_and_build_type_and_product_from_variant(variant) | ||
return product | ||
_, build_type = get_architecture_and_build_type_from_variant(variant) | ||
return build_type | ||
|
||
|
||
def _craft_artifacts_from_variant(variant): | ||
|
@@ -461,29 +457,19 @@ def _craft_artifacts_from_variant(variant): | |
|
||
|
||
def _craft_apk_full_path_from_variant(variant): | ||
architecture, build_type, product = _get_architecture_and_build_type_and_product_from_variant( | ||
variant | ||
) | ||
|
||
short_variant = variant[:-len(build_type)] | ||
architecture, build_type = get_architecture_and_build_type_from_variant(variant) | ||
postfix = '-unsigned' if build_type.startswith('release') else '' | ||
product = lower_case_first_letter(product) | ||
|
||
return '/opt/fenix/app/build/outputs/apk/{short_variant}/{build_type}/app-{architecture}-{product}-{build_type}{postfix}.apk'.format( # noqa: E501 | ||
return '/opt/fenix/app/build/outputs/apk/{architecture}/{build_type}/app-{architecture}-{build_type}{postfix}.apk'.format( # noqa: E501 | ||
architecture=architecture, | ||
build_type=build_type, | ||
product=product, | ||
short_variant=short_variant, | ||
postfix=postfix | ||
) | ||
|
||
|
||
_SUPPORTED_ARCHITECTURES = ('aarch64', 'arm', 'x86') | ||
_SUPPORTED_BUILD_TYPES = ('Debug', 'Release', 'ReleaseRaptor') | ||
_SUPPORTED_PRODUCTS = ('FirefoxBeta', 'FirefoxNightly', 'FirefoxRelease', 'Greenfield') | ||
|
||
|
||
def _get_architecture_and_build_type_and_product_from_variant(variant): | ||
def get_architecture_and_build_type_from_variant(variant): | ||
for supported_architecture in _SUPPORTED_ARCHITECTURES: | ||
if variant.startswith(supported_architecture): | ||
architecture = supported_architecture | ||
|
@@ -496,32 +482,8 @@ def _get_architecture_and_build_type_and_product_from_variant(variant): | |
) | ||
) | ||
|
||
for supported_build_type in _SUPPORTED_BUILD_TYPES: | ||
if variant.endswith(supported_build_type): | ||
build_type = lower_case_first_letter(supported_build_type) | ||
break | ||
else: | ||
raise ValueError( | ||
'Cannot identify build type in "{}". ' | ||
'Expected to find one of these supported ones: {}'.format( | ||
variant, _SUPPORTED_BUILD_TYPES | ||
) | ||
) | ||
|
||
remaining_variant_data = variant[len(architecture):len(variant) - len(build_type)] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
for supported_product in _SUPPORTED_PRODUCTS: | ||
if remaining_variant_data == supported_product: | ||
product = supported_product | ||
break | ||
else: | ||
raise ValueError( | ||
'Cannot identify product in "{}" "{}". ' | ||
'Expected to find one of these supported ones: {}'.format( | ||
remaining_variant_data, variant, _SUPPORTED_PRODUCTS | ||
) | ||
) | ||
|
||
return architecture, build_type, product | ||
build_type = variant[len(architecture):] | ||
return architecture, build_type | ||
|
||
|
||
def schedule_task(queue, taskId, task): | ||
|
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 |
---|---|---|
|
@@ -17,4 +17,4 @@ | |
./gradlew -q \ | ||
ktlint \ | ||
detekt \ | ||
app:assembleX86GreenfieldDebug | ||
app:assembleX86Debug |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are flavor specific sources in
src
. If we remove those flavors then let's remove the sources too.