Commit Graph

300 Commits

Author SHA1 Message Date
mcarare
7cf165fed2 Bug 1964352 - Enable standard:parameter-list-spacing ktlint rule and fix errors. r=geckoview-reviewers,android-reviewers,nalexander
Kotlin style guide: No new line before parameter type.

Differential Revision: https://phabricator.services.mozilla.com/D248505
2025-05-09 13:56:13 +00:00
Aaditya
435f34d647 Bug 1956870 - Adding gradlew lint to android-{fenix|focus|ac} linters and reporting lint errors on phabricator. r=android-reviewers,nalexander
Currently CI runs gradlew lint for android projects using build-fat-aar which is not needed now that we can run lint from root project. Current setup also doesn't update mozlint.json so phabricator doesn't recognize the lint failures. This bug adds gradlew lint to mach lint through the android-{fenix|focus|ac} linters in addition of ktlint and detekt which were added in D216999

This patch changes android lint configuration to generate JSON report of errors and then reads these errors in lints.py to report in the same format as other linters.

Creating new treeherder task for each of `android-{fenix|focus|ac}` linter as android-fenix can take up to 20 minutes ot run now with the addition of gradlew lint, which is almost the same as the existing mozlint-android-lints task takes, so doing this in parallel will be nice.

Follow up work would include removing all the original detekt, ktlint and lint tasks from treeherder which will make creating these new tasks more justified.

Differential Revision: https://phabricator.services.mozilla.com/D243832
2025-05-08 05:54:24 +00:00
mcarare
ce734efdf2 Bug 1851774 - Update ktlint to 1.5.0 and disable some new rules. r=android-reviewers,jonalmeida
This also fixes one violation of standard-wrapping rule that needs to be enabled for existing trailing commas rules.

Differential Revision: https://phabricator.services.mozilla.com/D247734
2025-05-06 08:23:07 +00:00
Nicolas Guichard
e57f0beabb Bug 1938622 - Enable kotlin code indexing again using forked semanticdb-kotlinc. r=nalexander,geckoview-reviewers,jcristau
Upstream semanticdb-kotlinc at github.com/sourcegraph/scip-kotlin does
not support kotlin 2 yet, so we forked the repository and added support
at github.com/mozsearch/semanticdb-kotlinc.

The upstream project originally builds on GitHub Actions and publishes
to Maven Central as com.sourcegraph:semanticdb-kotlinc.

Instead, we currently publish to maven.mozilla.org as
com.github.mozsearch:semanticdb-kotlinc.

Differential Revision: https://phabricator.services.mozilla.com/D245420
2025-04-28 09:39:03 +00:00
adhingra
31ae3ed36c Bug 1954548 - Clean up plugins/dependencies using version catalog r=android-reviewers,RyanVM,jonalmeida
Simple changes in this one, just to unblock some other patches, will clean up in more detail in followup patches

Differential Revision: https://phabricator.services.mozilla.com/D239802
2025-03-26 14:01:35 +00:00
Ryan VanderMeulen
d4312b4ad4 Bug 1955985 - Remove space-assignment usage in Gradle files. r=geckoview-reviewers,android-reviewers,webcompat-reviewers,twisniewski,adhingra,ohall
Differential Revision: https://phabricator.services.mozilla.com/D242727
2025-03-24 15:55:48 +00:00
Ted Campbell
ae94992376 Bug 1951190 - Put gradle 'build' folders in TOPOBJDIR for top-level builds. r=android-reviewers,adhingra
For consistency with the rest of the build system, have gradle build folders be
created in TOPOBJDR. Put the logic in shared-settings.gradle and apply it to all
projects. Existing gradle and taskcluster configuration uses the 'gradle/build'
prefix, so continue using that for now.

Only apply this when building top-level for now since a fair bit of automation
of fenix/focus/a-c projects expects build artifacts in the source directory.

Plugins are compiled as "composite builds" so they somewhat exist in their own
world. For simplicity, just manually specify the `buildDir` for each plugin.

Differential Revision: https://phabricator.services.mozilla.com/D240116
2025-03-15 02:03:53 +00:00
Alexandru Marc
00c4379930 Backed out changeset dc6b7a30f4c2 (bug 1951190) for causing Android build bustages 2025-03-15 01:45:14 +02:00
Ted Campbell
cf1ed52934 Bug 1951190 - Put gradle 'build' folders in TOPOBJDIR for top-level builds. r=android-reviewers,adhingra
For consistency with the rest of the build system, have gradle build folders be
created in TOPOBJDR. Put the logic in shared-settings.gradle and apply it to all
projects. Existing gradle and taskcluster configuration uses the 'gradle/build'
prefix, so continue using that for now.

Only apply this when building top-level for now since a fair bit of automation
of fenix/focus/a-c projects expects build artifacts in the source directory.

Plugins are compiled as "composite builds" so they somewhat exist in their own
world. For simplicity, just manually specify the `buildDir` for each plugin.

Differential Revision: https://phabricator.services.mozilla.com/D240116
2025-03-14 20:39:39 +00:00
pstanciu
4d231c0ba8 Backed out changeset f74a557cdb43 (bug 1951190) for causing btime failures. CLOSED TREE 2025-03-14 12:52:28 +02:00
Ted Campbell
1b3e5c9053 Bug 1951190 - Put gradle 'build' folders in TOPOBJDIR for top-level builds. r=android-reviewers,adhingra
For consistency with the rest of the build system, have gradle build folders be
created in TOPOBJDR. Put the logic in shared-settings.gradle and apply it to all
projects. Existing gradle and taskcluster configuration uses the 'gradle/build'
prefix, so continue using that for now.

Only apply this when building top-level for now since a fair bit of automation
of fenix/focus/a-c projects expects build artifacts in the source directory.

Plugins are compiled as "composite builds" so they somewhat exist in their own
world. For simplicity, just manually specify the `buildDir` for each plugin.

Differential Revision: https://phabricator.services.mozilla.com/D240116
2025-03-13 23:24:31 +00:00
Makoto Kato
4cfa16824a Bug 1952878 - Use libs.versions.ktlint for ktlint version of geckoview. r=geckoview-reviewers,calu
Actually, GeckoView's ktlint version is hard coded. But Fenix and AC
define it into `libs.versions.toml`. So we should use same file since we
use same version.

Differential Revision: https://phabricator.services.mozilla.com/D240859
2025-03-11 08:17:17 +00:00
Ryan VanderMeulen
86cfedaccc Bug 1952504 - Add scip-java to version catalog and bump version to 0.10.4. r=android-reviewers,mcarare
Differential Revision: https://phabricator.services.mozilla.com/D240730
2025-03-07 15:13:24 +00:00
Ryan VanderMeulen
1b7c05831c Bug 1897958 - Update Gradle files for Kotlin 2.x and Compose Compiler changes. r=geckoview-reviewers,android-reviewers,tthibaud,owlish
Differential Revision: https://phabricator.services.mozilla.com/D213832
2025-03-06 23:24:14 +00:00
Ryan VanderMeulen
f1e28c07d2 Bug 1897958 - Disable Kotlin code indexing until there is a compatible scip-kotlin plugin available. r=android-reviewers,pollymce
Differential Revision: https://phabricator.services.mozilla.com/D213828
2025-03-06 23:24:13 +00:00
Aaditya Dhingra
4425245f16 Bug 1924520 - Enable gradle configuration cache to improve build speed. r=firefox-build-system-reviewers,geckoview-reviewers,android-reviewers,webcompat-reviewers,nalexander,twisniewski,owlish,ohall,willdurand
Differential Revision: https://phabricator.services.mozilla.com/D232874
2025-03-04 22:00:41 +00:00
Cristian Tuns
0b7c7fb4a9 Backed out 2 changesets (bug 1924520) partial backout for as requested by Aaditya Dhingra. CLOSED TREE
Backed out changeset 17764af0218a (bug 1924520)
Backed out changeset 4447d8955f60 (bug 1924520)
2025-03-03 14:12:45 -05:00
Aaditya Dhingra
18e3428c12 Bug 1949260 - Part 3 - Make ApkSizePlugin and ConfigPlugin project plugins instead of settings plugins. r=android-reviewers,nalexander,jonalmeida
Differential Revision: https://phabricator.services.mozilla.com/D238964
2025-03-03 17:12:26 +00:00
Aaditya Dhingra
5f9d749a96 Bug 1949260 - Part 2 - Replace DependenciesPlugin with gradle version catalog. r=geckoview-reviewers,android-reviewers,webcompat-reviewers,nalexander,twisniewski,owlish,jonalmeida,tthibaud
Differential Revision: https://phabricator.services.mozilla.com/D238804
2025-03-03 17:12:25 +00:00
Aaditya Dhingra
64ad68597e Bug 1924520 - Enable gradle configuration cache to improve build speed. r=firefox-build-system-reviewers,geckoview-reviewers,android-reviewers,webcompat-reviewers,nalexander,twisniewski,owlish,ohall,willdurand
Differential Revision: https://phabricator.services.mozilla.com/D232874
2025-03-03 14:03:48 +00:00
Aaditya Dhingra
71d2e31543 Bug 1924520 - Move geckoBinariesOnlyIf to MachExec class. r=nalexander
Differential Revision: https://phabricator.services.mozilla.com/D237038
2025-03-03 14:03:48 +00:00
Aaditya Dhingra
98b4b7e69d Bug 1946226 - Don't parse TOML multiple times. r=janerik,tthibaud
We currently parse `Cargo.lock` for every single Gradle project. This is unnecessary: once is enough. Moreover, this can be a parallelizable and build-cache friendly task. This patch places the task in the :geckoview project, since that's where the version of native Glean is most relevant

Differential Revision: https://phabricator.services.mozilla.com/D234384
2025-02-10 19:32:19 +00:00
Thinker Li
cdd658462b Bug 1945334 - Make gradle supports beta build. r=firefox-build-system-reviewers,nalexander
Remove 'b[0-9]' from MOZ_APP_VERSION before computing version code.

MOZ_APP_VERSION is "136.0b0" with
"--as-milestone=early-beta". However, computeVersionCode() in
m-c/build.gradle fails to parse it. It supports only "136.0a0" or
alike.

Differential Revision: https://phabricator.services.mozilla.com/D236463
2025-02-03 19:44:52 +00:00
Aaditya Dhingra
927af60958 Bug 1931557 - Configuration cache friendly listeners for build profile markers and add marker for time spent waiting for the gradle lockfile. r=florian,geckoview-reviewers,tthibaud
This commit moves toward configuration cache friendly listeners for
build profile markers.  In addition, this approach gets events
for (isolated) projects that use `includeBuild`.  Gradle is evolving
rapidly in this area; I expect there will be different, more
configuration cache friendly, ways to listen for task evaluation
events in the near future.

Differential Revision: https://phabricator.services.mozilla.com/D230473
2025-01-14 01:55:17 +00:00
mcarare
86a56a4607 Bug 1897176 - Allow unit tests to access and use app resources. r=tthibaud
Differential Revision: https://phabricator.services.mozilla.com/D223722
2024-10-01 06:57:53 +00:00
Jan-Erik Rediger
5257698874 Bug 1921235 - Gradle: Enforce the Glean version at the top-level. r=RyanVM
This was done for Fenix (bug 1917825) and Focus (bug 1920953),
but Searchfox calls Gradle from the top-level, so apparently we need it
here too.

I would like if we can define it once and it's just used across the
whole tree, but I don't know how.

With this patch `mach android compile-all` at the top-level works.

Differential Revision: https://phabricator.services.mozilla.com/D223759
2024-09-26 16:57:06 +00:00
mcarare
0769cdd14c Bug 1894766 - Reduce noise of downloadDependencies task errors. r=tthibaud
Differential Revision: https://phabricator.services.mozilla.com/D211756
2024-09-17 18:39:45 +00:00
Ryan VanderMeulen
72eda52215 Bug 1918780 - Migrate Protobuf to the AC dependencies plugin. r=android-reviewers,mcarare
Differential Revision: https://phabricator.services.mozilla.com/D222171
2024-09-17 14:23:52 +00:00
Nicolas Guichard
e8fd65dc51 Bug 1893181 - Enforce buildToolsVersion from toplevel Gradle project too. r=nalexander
The resolution of bug 1906365 was incomplete, the buildToolsVersion was
not enforced when building AC, Fenix or Focus from the toplevel Gradle
project.

Differential Revision: https://phabricator.services.mozilla.com/D221845
2024-09-11 16:35:55 +00:00
Ryan VanderMeulen
bf385a5e2a Bug 1917498 - Migrate the remaining AndroidX libraries to the AC dependencies plugin and clean up the manifests. r=android-reviewers,mcarare
Differential Revision: https://phabricator.services.mozilla.com/D221415
2024-09-09 11:30:09 +00:00
Ryan VanderMeulen
ca4b1d7add Bug 1913314 - Migrate the OSS Licenses Gradle Plugin to the AC dependencies plugin. r=android-reviewers,mcarare
Differential Revision: https://phabricator.services.mozilla.com/D220199
2024-08-27 12:40:46 +00:00
Ryan VanderMeulen
14c52e181d Bug 1914260 - Update scip-java to version 0.10.3. r=geckoview-reviewers,owlish
Differential Revision: https://phabricator.services.mozilla.com/D219802
2024-08-23 23:52:04 +00:00
Ryan VanderMeulen
fad1101e99 Bug 1914294 - Migrate AndroidX Benchmark to the AC dependencies plugin. r=android-reviewers,mcarare
Differential Revision: https://phabricator.services.mozilla.com/D219828
2024-08-22 13:08:38 +00:00
mcarare
0a4567ce2d Bug 1880792, 1880801, 1880805 - Compile Focus, Fenix, AC and GV with SDK 35. r=android-reviewers,geckoview-reviewers,ohall
Differential Revision: https://phabricator.services.mozilla.com/D217428
2024-08-08 08:02:32 +00:00
Noemi Erli
078b6e5660 Backed out 9 changesets (bug 1880805, bug 1880792) for causing Android build bustages CLOSED TREE
Backed out changeset 31bdbc9aeaa4 (bug 1880805)
Backed out changeset 774f35ca40c6 (bug 1880805)
Backed out changeset 245c3192541e (bug 1880805)
Backed out changeset b6ebbf12ab50 (bug 1880805)
Backed out changeset 17995dc18511 (bug 1880805)
Backed out changeset 42b34af74a6b (bug 1880805)
Backed out changeset 2f77befbf593 (bug 1880805)
Backed out changeset 974b02a7b0c6 (bug 1880792)
Backed out changeset bb02a20ea5fd (bug 1880792)
2024-08-07 21:36:15 +03:00
mcarare
49d00e7fbe Bug 1880792, 1880801, 1880805 - Compile Focus, Fenix, AC and GV with SDK 35. r=android-reviewers,geckoview-reviewers,ohall
Differential Revision: https://phabricator.services.mozilla.com/D217428
2024-08-07 14:20:46 +00:00
Norisz Fay
817e11ed18 Backed out 9 changesets (bug 1880805, bug 1880792) for causing WR bustages
Backed out changeset b4a34334966e (bug 1880805)
Backed out changeset 930b186197c7 (bug 1880805)
Backed out changeset a123725cb63e (bug 1880805)
Backed out changeset 361853f53ba9 (bug 1880805)
Backed out changeset b23f3321ac09 (bug 1880805)
Backed out changeset ed4650fa6bec (bug 1880805)
Backed out changeset 413d884fda78 (bug 1880805)
Backed out changeset e7fff6a1e708 (bug 1880792)
Backed out changeset 781599462673 (bug 1880792)
2024-08-07 14:55:34 +03:00
mcarare
fc9b57303d Bug 1880792, 1880801, 1880805 - Compile Focus, Fenix, AC and GV with SDK 35. r=android-reviewers,geckoview-reviewers,ohall
Differential Revision: https://phabricator.services.mozilla.com/D217428
2024-08-07 10:45:53 +00:00
Narcis Beleuzu
a84dc052f1 Backed out 9 changesets (bug 1880805, bug 1880792) for gradle-dependencies TL bustages. CLOSED TREE
Backed out changeset f94e6acf0cd3 (bug 1880805)
Backed out changeset 22e14524bf1f (bug 1880805)
Backed out changeset 774b263652b5 (bug 1880805)
Backed out changeset 77fe8fb48620 (bug 1880805)
Backed out changeset 3ae77f91197e (bug 1880805)
Backed out changeset 1ffaa88f56da (bug 1880805)
Backed out changeset 1dee3246c6a2 (bug 1880805)
Backed out changeset 9abb09c562ef (bug 1880792)
Backed out changeset 24a1c7a574c4 (bug 1880792)
2024-08-06 22:41:06 +03:00
mcarare
9c0704c7b3 Bug 1880792, 1880801, 1880805 - Compile Focus, Fenix, AC and GV with SDK 35. r=android-reviewers,geckoview-reviewers,ohall
Differential Revision: https://phabricator.services.mozilla.com/D217428
2024-08-06 17:38:52 +00:00
Ryan VanderMeulen
87f1f41111 Bug 1884192 - Use jvmToolchain for setting the target JVM version. r=mcarare
Differential Revision: https://phabricator.services.mozilla.com/D217824
2024-07-26 15:10:51 +00:00
Nicolas Guichard
677fa97c13 Bug 1881001 - Use the same AGP version for AC and GeckoView. r=geckoview-reviewers,nalexander,owlish
Delaying the definition of the generateSDKBindings task's arguments
ensures the android.bootClasspath has been populated.

Updating AGP apparently changes the default location of apilint's
apilint-result.json and api.txt, this moves them to a less foreign
location. Unfortunately apilint only seems to use relative paths here.

Differential Revision: https://phabricator.services.mozilla.com/D215654
2024-07-22 14:12:27 +00:00
Ryan VanderMeulen
44a081ecff Bug 1904166 - Update scip-java to version 0.10.0. r=calu
Differential Revision: https://phabricator.services.mozilla.com/D214660
2024-06-29 14:28:56 +00:00
Makoto Kato
c5245f0453 Bug 1896020 - Upgrade apilint gradle plugin to 0.5.3. r=geckoview-reviewers,calu
apilint gradle plugin 0.5.3 supports Windows platform.

Differential Revision: https://phabricator.services.mozilla.com/D213051
2024-06-11 03:07:38 +00:00
Florian Quèze
767edda236 Bug 1892641 - include timestamps in BUILDSTATUS lines from gradle, r=glandium.
Differential Revision: https://phabricator.services.mozilla.com/D208531
2024-04-30 08:17:13 +00:00
kycn
7738bbeeb5 Bug 1892641 - Add profile markers for gradle project evaluations and task executions to capture execution times in the build profiles. r=florian,glandium
Differential Revision: https://phabricator.services.mozilla.com/D208094
2024-04-30 08:17:13 +00:00
Ryan VanderMeulen
6b5b727c81 Bug 1893237 - Update scip-java to version 0.9.10. r=android-reviewers,avirvara
Differential Revision: https://phabricator.services.mozilla.com/D208528
2024-04-29 15:18:40 +00:00
Ryan VanderMeulen
8a74644569 Bug 1886433 - Use the AC dependencies plugin for GeckoView where possible. r=android-reviewers,amejiamarmol
Differential Revision: https://phabricator.services.mozilla.com/D205221
2024-03-20 21:40:21 +00:00
Gabriel Luong
278dd91720 Bug 1822393 - Set the source and target compatibility compile options for non-GeckoView projects. r=owlish,nalexander,geckoview-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D201853
2024-02-13 21:15:55 -05:00
Geoff Brown
1d549c0f96 Bug 1825116 - do not run spotless lint on firefox-android projects. r=owlish,geckoview-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D201543
2024-01-31 13:43:13 -07:00